jiebi/CodeConvo huggingface dataset:
return nil } <del> keyCert.CertFile = path.Join(s.ServerCert.CertDirectory, s.ServerCert.PairName+".crt") keyCert.KeyFile = path.Join(s.ServerCert.CertDirectory, s.ServerCert.PairName+".key") canReadCertAndKey, err := certutil.CanReadCertAndKey(keyCert.CertFile, keyCert.KeyFile) if err != nil { return err </del> <ins> canReadCertAndKey := false if len(s.ServerCert.CertDirectory) > 0 { if len(s.ServerCert.PairName) == 0 { return fmt.Errorf("PairName is required if CertDirectory is set") } keyCert.CertFile = path.Join(s.ServerCert.CertDirectory, s.ServerCert.PairName+".crt") keyCert.KeyFile = path.Join(s.ServerCert.CertDirectory, s.ServerCert.PairName+".key") if canRead, err := certutil.CanReadCertAndKey(keyCert.CertFile, keyCert.KeyFile); err != nil { return err } else { canReadCertAndKey = canRead } </ins> } if !canReadCertAndKey { // add either the bind address or localhost to the valid alternates bindIP := s.BindAddress.String()
if cert, key, err := certutil.GenerateSelfSignedCertKeyWithFixtures(publicAddress, alternateIPs, alternateDNS, s.ServerCert.FixtureDirectory); err != nil { return fmt.Errorf("unable to generate self signed cert: %v", err) <del> } else { </del> <ins> } else if len(keyCert.CertFile) > 0 && len(keyCert.KeyFile) > 0 { </ins> if err := certutil.WriteCert(keyCert.CertFile, cert); err != nil { return err } if err := certutil.WriteKey(keyCert.KeyFile, key); err != nil { return err } glog.Infof("Generated self-signed cert (%s, %s)", keyCert.CertFile, keyCert.KeyFile) <ins> } else { tlsCert, err := tls.X509KeyPair(cert, key) if err != nil { return fmt.Errorf("unable to generate self signed cert: %v", err) } s.ServerCert.GeneratedCert = &tlsCert glog.Infof("Generated self-signed cert in-memory") </ins> } }
if err != nil { return nil, err } <ins> // Fall back to ARM API if the address is empty string. // TODO: this is a workaround because IMDS is not stable enough. // It should be removed after IMDS fixing the issue. if strings.TrimSpace(ipAddress.PrivateIP) == "" { return addressGetter(name) } // Use ip address got from instance metadata. </ins> addresses := []v1.NodeAddress{ {Type: v1.NodeInternalIP, Address: ipAddress.PrivateIP}, {Type: v1.NodeHostName, Address: string(name)},
config := clientcmdapi.NewConfig() credentials := clientcmdapi.NewAuthInfo() <del> credentials.Token = clientCfg.BearerToken </del> <ins> credentials.TokenFile = "/var/run/secrets/kubernetes.io/serviceaccount/token" </ins> credentials.ClientCertificate = clientCfg.TLSClientConfig.CertFile if len(credentials.ClientCertificate) == 0 { credentials.ClientCertificateData = clientCfg.TLSClientConfig.CertData
(disk.Vhd != nil && disk.Vhd.URI != nil && diskURI != "" && *disk.Vhd.URI == diskURI) || (disk.ManagedDisk != nil && *disk.ManagedDisk.ID == diskURI) { // found the disk <del> glog.V(4).Infof("azureDisk - find disk: lun %d name %q uri %q", *disk.Lun, diskName, diskURI) </del> <ins> glog.V(2).Infof("azureDisk - find disk: lun %d name %q uri %q", *disk.Lun, diskName, diskURI) </ins> return *disk.Lun, nil } }
if err == nil { // Volume is already attached to node. <del> glog.V(4).Infof("Attach operation is successful. volume %q is already attached to node %q at lun %d.", volumeSource.DiskName, instanceid, lun) </del> <ins> glog.V(2).Infof("Attach operation is successful. volume %q is already attached to node %q at lun %d.", volumeSource.DiskName, instanceid, lun) </ins> } else { <del> glog.V(4).Infof("GetDiskLun returned: %v. Initiating attaching volume %q to node %q.", err, volumeSource.DataDiskURI, nodeName) </del> <ins> glog.V(2).Infof("GetDiskLun returned: %v. Initiating attaching volume %q to node %q.", err, volumeSource.DataDiskURI, nodeName) </ins> getLunMutex.LockKey(instanceid) defer getLunMutex.UnlockKey(instanceid)
glog.Warningf("no LUN available for instance %q (%v)", nodeName, err) return "", fmt.Errorf("all LUNs are used, cannot attach volume %q to instance %q (%v)", volumeSource.DiskName, instanceid, err) } <del> glog.V(4).Infof("Trying to attach volume %q lun %d to node %q.", volumeSource.DataDiskURI, lun, nodeName) </del> <ins> glog.V(2).Infof("Trying to attach volume %q lun %d to node %q.", volumeSource.DataDiskURI, lun, nodeName) </ins> isManagedDisk := (*volumeSource.Kind == v1.AzureManagedDisk) err = diskController.AttachDisk(isManagedDisk, volumeSource.DiskName, volumeSource.DataDiskURI, nodeName, lun, compute.CachingTypes(*volumeSource.CachingMode)) if err == nil { <del> glog.V(4).Infof("Attach operation successful: volume %q attached to node %q.", volumeSource.DataDiskURI, nodeName) </del> <ins> glog.V(2).Infof("Attach operation successful: volume %q attached to node %q.", volumeSource.DataDiskURI, nodeName) </ins> } else { glog.V(2).Infof("Attach volume %q to instance %q failed with %v", volumeSource.DataDiskURI, instanceid, err) return "", fmt.Errorf("Attach volume %q to instance %q failed with %v", volumeSource.DiskName, instanceid, err)
nodeName := types.NodeName(a.plugin.host.GetHostName()) diskName := volumeSource.DiskName <del> glog.V(5).Infof("azureDisk - WaitForAttach: begin to GetDiskLun by diskName(%s), DataDiskURI(%s), nodeName(%s), devicePath(%s)", </del> <ins> glog.V(2).Infof("azureDisk - WaitForAttach: begin to GetDiskLun by diskName(%s), DataDiskURI(%s), nodeName(%s), devicePath(%s)", </ins> diskName, volumeSource.DataDiskURI, nodeName, devicePath) lun, err := diskController.GetDiskLun(diskName, volumeSource.DataDiskURI, nodeName) if err != nil { return "", err } <del> glog.V(5).Infof("azureDisk - WaitForAttach: GetDiskLun succeeded, got lun(%v)", lun) </del> <ins> glog.V(2).Infof("azureDisk - WaitForAttach: GetDiskLun succeeded, got lun(%v)", lun) </ins> exec := a.plugin.host.GetExec(a.plugin.GetPluginName()) io := &osIOHandler{}
func (detacher *azureDiskDetacher) UnmountDevice(deviceMountPath string) error { err := util.UnmountPath(deviceMountPath, detacher.plugin.host.GetMounter(detacher.plugin.GetPluginName())) if err == nil { <del> glog.V(4).Infof("azureDisk - Device %s was unmounted", deviceMountPath) </del> <ins> glog.V(2).Infof("azureDisk - Device %s was unmounted", deviceMountPath) </ins> } else { <del> glog.Infof("azureDisk - Device %s failed to unmount with error: %s", deviceMountPath, err.Error()) </del> <ins> glog.Warningf("azureDisk - Device %s failed to unmount with error: %s", deviceMountPath, err.Error()) </ins> } return err }
logOptions.SinceSeconds = &sec } <del> if len(o.Selector) > 0 && o.Tail != -1 { </del> <ins> if len(o.Selector) > 0 && o.Tail == -1 { </ins> logOptions.TailLines = &selectorTail } else if o.Tail != -1 { logOptions.TailLines = &o.Tail
return duration } <ins> // contextForChannel derives a child context from a parent channel. // // The derived context's Done channel is closed when the returned cancel function // is called or when the parent channel is closed, whichever happens first. // // Note the caller must *always* call the CancelFunc, otherwise resources may be leaked. func contextForChannel(parentCh <-chan struct{}) (context.Context, context.CancelFunc) { ctx, cancel := context.WithCancel(context.Background()) go func() { select { case <-parentCh: cancel() case <-ctx.Done(): } }() return ctx, cancel } </ins> // ExponentialBackoff repeats a condition check with exponential backoff. // // It checks the condition up to Steps times, increasing the wait by multiplying
// PollUntil always waits interval before the first run of 'condition'. // 'condition' will always be invoked at least once. func PollUntil(interval time.Duration, condition ConditionFunc, stopCh <-chan struct{}) error { <del> return WaitFor(poller(interval, 0), condition, stopCh) </del> <ins> ctx, cancel := contextForChannel(stopCh) defer cancel() return WaitFor(poller(interval, 0), condition, ctx.Done()) </ins> } // PollImmediateUntil tries a condition func until it returns true, an error or stopCh is closed.
// timeout has elapsed and then closes the channel. // // Over very short intervals you may receive no ticks before the channel is <del> // closed. A timeout of 0 is interpreted as an infinity. </del> <ins> // closed. A timeout of 0 is interpreted as an infinity, and in such a case // it would be the caller's responsibility to close the done channel. // Failure to do so would result in a leaked goroutine. </ins> // // Output ticks are not buffered. If the channel is not ready to receive an // item, the tick is skipped.
} } } <ins> func TestContextForChannel(t *testing.T) { var wg sync.WaitGroup parentCh := make(chan struct{}) done := make(chan struct{}) for i := 0; i < 3; i++ { wg.Add(1) go func() { defer wg.Done() ctx, cancel := contextForChannel(parentCh) defer cancel() <-ctx.Done() }() } go func() { wg.Wait() close(done) }() // Closing parent channel should cancel all children contexts close(parentCh) select { case <-done: case <-time.After(ForeverTestTimeout): t.Errorf("unexepcted timeout waiting for parent to cancel child contexts") } } </ins>
} } <del> // TestVolumeBindingStress creates <podLimit> pods, each with <volsPerPod> unbound PVCs. </del> <ins> // TestVolumeBindingStress creates <podLimit> pods, each with <volsPerPod> unbound or prebound PVCs. </ins> // PVs are precreated. func TestVolumeBindingStress(t *testing.T) { testVolumeBindingStress(t, 0, false, 0)
pvs := []*v1.PersistentVolume{} pvcs := []*v1.PersistentVolumeClaim{} for i := 0; i < podLimit*volsPerPod; i++ { <ins> var ( pv      *v1.PersistentVolume pvc     *v1.PersistentVolumeClaim pvName  = fmt.Sprintf("pv-stress-%v", i) pvcName = fmt.Sprintf("pvc-stress-%v", i) ) </ins> // Don't create pvs for dynamic provisioning test if !dynamic { <del> pv := makePV(fmt.Sprintf("pv-stress-%v", i), *scName, "", "", node1) </del> <ins> if rand.Int()%2 == 0 { // static unbound pvs pv = makePV(pvName, *scName, "", "", node1) } else { // static prebound pvs pv = makePV(pvName, classImmediate, pvcName, config.ns, node1) } </ins> if pv, err := config.client.CoreV1().PersistentVolumes().Create(pv); err != nil { t.Fatalf("Failed to create PersistentVolume %q: %v", pv.Name, err) } pvs = append(pvs, pv) } <del> pvc := makePVC(fmt.Sprintf("pvc-stress-%v", i), config.ns, scName, "") </del> <ins> if pv != nil && pv.Spec.ClaimRef != nil && pv.Spec.ClaimRef.Name == pvcName { pvc = makePVC(pvcName, config.ns, &classImmediate, pv.Name) } else { pvc = makePVC(pvcName, config.ns, scName, "") } </ins> if pvc, err := config.client.CoreV1().PersistentVolumeClaims(config.ns).Create(pvc); err != nil { t.Fatalf("Failed to create PersistentVolumeClaim %q: %v", pvc.Name, err) }
"//staging/src/k8s.io/cli-runtime/pkg/genericclioptions/resource:go_default_library", "//staging/src/k8s.io/client-go/dynamic:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/typed/batch/v1:go_default_library", <ins> "//staging/src/k8s.io/client-go/kubernetes/typed/batch/v1beta1:go_default_library", </ins> "//staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/k8s.io/klog:go_default_library",
<ins> /* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package create import ( "testing" batchv1 "k8s.io/api/batch/v1" batchv1beta1 "k8s.io/api/batch/v1beta1" corev1 "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func TestCreateCronJob(t *testing.T) { cronjobName := "test-job" tests := map[string]struct { image    string command  []string schedule string restart  string expected *batchv1beta1.CronJob }{ "just image and OnFailure restart policy": { image:    "busybox", schedule: "0/5 * * * ?", restart:  "OnFailure", expected: &batchv1beta1.CronJob{ TypeMeta: metav1.TypeMeta{APIVersion: batchv1beta1.SchemeGroupVersion.String(), Kind: "CronJob"}, ObjectMeta: metav1.ObjectMeta{ Name: cronjobName, }, Spec: batchv1beta1.CronJobSpec{ Schedule: "0/5 * * * ?", JobTemplate: batchv1beta1.JobTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Name: cronjobName, }, Spec: batchv1.JobSpec{ Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ Containers: []corev1.Container{ { Name:  cronjobName, Image: "busybox", }, }, RestartPolicy: corev1.RestartPolicyOnFailure, }, }, }, }, }, }, }, "image, command , schedule and Never restart policy": { image:    "busybox", command:  []string{"date"}, schedule: "0/5 * * * ?", restart:  "Never", expected: &batchv1beta1.CronJob{ TypeMeta: metav1.TypeMeta{APIVersion: batchv1beta1.SchemeGroupVersion.String(), Kind: "CronJob"}, ObjectMeta: metav1.ObjectMeta{ Name: cronjobName, }, Spec: batchv1beta1.CronJobSpec{ Schedule: "0/5 * * * ?", JobTemplate: batchv1beta1.JobTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Name: cronjobName, }, Spec: batchv1.JobSpec{ Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ Containers: []corev1.Container{ { Name:    cronjobName, Image:   "busybox", Command: []string{"date"}, }, }, RestartPolicy: corev1.RestartPolicyNever, }, }, }, }, }, }, }, } for name, tc := range tests { t.Run(name, func(t *testing.T) { o := &CreateCronJobOptions{ Name:     cronjobName, Image:    tc.image, Command:  tc.command, Schedule: tc.schedule, Restart:  tc.restart, } cronjob := o.createCronJob() if !apiequality.Semantic.DeepEqual(cronjob, tc.expected) { t.Errorf("expected:n%#vngot:n%#v", tc.expected, cronjob) } }) } } </ins>
uniqueRS := rs.String() if _, ok := q.list[uniqueRS]; ok { <del> return false </del> <ins> delete(q.list, uniqueRS) return true </ins> } <del> delete(q.list, uniqueRS) return true </del> <ins> return false </ins> } func (q *graceTerminateRSList) flushList(handler func(rsToDelete *listItem) (bool, error)) bool {
} for _, rs := range rss { if rsToDelete.RealServer.Equal(rs) { <del> if rs.ActiveConn != 0 { </del> <ins> // Delete RS with no connections // For UDP, ActiveConn is always 0 // For TCP, InactiveConn are connections not in ESTABLISHED state if rs.ActiveConn+rs.InactiveConn != 0 { </ins> return false, nil } klog.Infof("Deleting rs: %s", rsToDelete.String())
Port:    uint16(portNum), } <del> klog.V(5).Infof("Using graceful delete to delete: %v", delDest) </del> <ins> klog.V(5).Infof("Using graceful delete to delete: %v", uniqueRS) </ins> err = proxier.gracefuldeleteManager.GracefulDeleteRS(appliedVirtualServer, delDest) if err != nil { klog.Errorf("Failed to delete destination: %v, error: %v", delDest, err)
# See the License for the specific language governing permissions and # limitations under the License. <del> FROM ubuntu:14.04 </del> <ins> FROM centos </ins> MAINTAINER Jan Safranek, jsafrane@redhat.com <del> ENV DEBIAN_FRONTEND noninteractive RUN apt-get update -qq && apt-get install -y nfs-kernel-server -qq </del> <ins> RUN yum -y install /usr/bin/ps nfs-utils && yum clean all </ins> RUN mkdir -p /exports ADD run_nfs.sh /usr/local/bin/ ADD index.html /exports/index.html
/usr/sbin/rpc.mountd -N 2 -N 3 -V 4 -V 4.1 /usr/sbin/exportfs -r <del> /usr/sbin/rpc.nfsd -N 2 -N 3 -V 4 -V 4.1 2 </del> <ins> # -G 10 to reduce grace time to 10 seconds (the lowest allowed) /usr/sbin/rpc.nfsd -G 10 -N 2 -N 3 -V 4 -V 4.1 2 </ins> echo "NFS started" }
## Syntax and character set _Labels_ are key value pairs. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`).  The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.  The prefix is optional.  If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). <del> If the prefix is omitted, the label key is presumed to be private to the user. System components which use labels must specify a prefix.  The `kubernetes.io/` prefix is reserved for kubernetes core components. </del> <ins> If the prefix is omitted, the label key is presumed to be private to the user. Automated system components (e.g. ```kube-scheduler```, ```kube-controller-manager```, ```kube-apiserver```, ```kubectl```, or other third-party automation) which add labels to end-user objects must specify a prefix.  The `kubernetes.io/` prefix is reserved for kubernetes core components. </ins> Valid label values must be 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
# Post-condition: nginx0 & nginx1 should both have paused set to nothing, and since nginx2 is malformed, it should error kube::test::get_object_assert deployment "{{range.items}}{{.spec.paused}}:{{end}}" "<no value>:<no value>:" kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" <ins> ## Fetch rollout status for multiple resources output_message=$(! kubectl rollout status -f hack/testdata/recursive/deployment/deployment --timeout=1s 2>&1 "${kube_flags[@]:?}") # Post-condition: nginx1 should both exist and nginx2 should error kube::test::if_has_string "${output_message}" "Waiting for deployment "nginx1-deployment" rollout to finish" kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" ## Fetch rollout status for deployments recursively output_message=$(! kubectl rollout status -f hack/testdata/recursive/deployment -R --timeout=1s 2>&1 "${kube_flags[@]:?}") # Post-condition: nginx0 & nginx1 should both exist, nginx2 should error kube::test::if_has_string "${output_message}" "Waiting for deployment "nginx0-deployment" rollout to finish" kube::test::if_has_string "${output_message}" "Waiting for deployment "nginx1-deployment" rollout to finish" kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" </ins> ## Retrieve the rollout history of the deployments recursively output_message=$(! kubectl rollout history -f hack/testdata/recursive/deployment --recursive 2>&1 "${kube_flags[@]}") # Post-condition: nginx0 & nginx1 should both have a history, and since nginx2 is malformed, it should error
t.Errorf("Exepcted RequiresRemount to be false, got %t", has) } } <ins> func TestGetRbdImageSize(t *testing.T) { for i, c := range []struct { Output     string TargetSize int }{ { Output:     `{"name":"kubernetes-dynamic-pvc-18e7a4d9-050d-11e9-b905-548998f3478f","size":10737418240,"objects":2560,"order":22,"object_size":4194304,"block_name_prefix":"rbd_data.9f4ff7238e1f29","format":2}`, TargetSize: 10240, }, { Output:     `{"name":"kubernetes-dynamic-pvc-070635bf-e33f-11e8-aab7-548998f3478f","size":1073741824,"objects":256,"order":22,"object_size":4194304,"block_name_prefix":"rbd_data.670ac4238e1f29","format":2}`, TargetSize: 1024, }, } { size, err := getRbdImageSize([]byte(c.Output)) if err != nil { t.Errorf("Case %d: getRbdImageSize failed: %v", i, err) continue } if size != c.TargetSize { t.Errorf("Case %d: unexpected size, wanted %d, got %d", i, c.TargetSize, size) } } } </ins>
const ( imageWatcherStr = "watcher=" imageSizeStr    = "size " <del> sizeDivStr      = " MB in" </del> kubeLockMagic   = "kubelet_lock_magic_" // The following three values are used for 30 seconds timeout // while waiting for RBD Watcher to expire. rbdImageWatcherInitDelay = 1 * time.Second rbdImageWatcherFactor    = 1.4 rbdImageWatcherSteps     = 10 <ins> rbdImageSizeUnitMiB      = 1024 * 1024 </ins> ) func getDevFromImageAndPool(pool, image string) (string, bool) {
// rbdInfo runs `rbd info` command to get the current image size in MB. func (util *RBDUtil) rbdInfo(b *rbdMounter) (int, error) { var err error <del> var output string var cmd []byte </del> <ins> var output []byte </ins> // If we don't have admin id/secret (e.g. attaching), fallback to user id/secret. id := b.adminId
// rbd: error opening image 1234: (2) No such file or directory // klog.V(4).Infof("rbd: info %s using mon %s, pool %s id %s key %s", b.Image, mon, b.Pool, id, secret) <del> cmd, err = b.exec.Run("rbd", "info", b.Image, "--pool", b.Pool, "-m", mon, "--id", id, "--key="+secret) output = string(cmd) </del> <ins> output, err = b.exec.Run("rbd", "info", b.Image, "--pool", b.Pool, "-m", mon, "--id", id, "--key="+secret, "--format=json") </ins> if err, ok := err.(*exec.Error); ok { if err.Err == exec.ErrNotFound {
} if len(output) == 0 { <del> return 0, fmt.Errorf("can not get image size info %s: %s", b.Image, output) </del> <ins> return 0, fmt.Errorf("can not get image size info %s: %s", b.Image, string(output)) </ins> } <del> // Get the size value string, just between `size ` and ` MB in`, such as `size 1024 MB in 256 objects`. sizeIndex := strings.Index(output, imageSizeStr) divIndex := strings.Index(output, sizeDivStr) if sizeIndex == -1 || divIndex == -1 || divIndex <= sizeIndex+5 { return 0, fmt.Errorf("can not get image size info %s: %s", b.Image, output) } rbdSizeStr := output[sizeIndex+5 : divIndex] rbdSize, err := strconv.Atoi(rbdSizeStr) if err != nil { return 0, fmt.Errorf("can not convert size str: %s to int", rbdSizeStr) } </del> <ins> return getRbdImageSize(output) } </ins> <del> return rbdSize, nil </del> <ins> func getRbdImageSize(output []byte) (int, error) { info := struct { Size int64 `json:"size"` }{} if err := json.Unmarshal(output, &info); err != nil { return 0, fmt.Errorf("parse rbd info output failed: %s, %v", string(output), err) } return int(info.Size / rbdImageSizeUnitMiB), nil </ins> } // rbdStatus runs `rbd status` command to check if there is watcher on the image.
CgroupManagerOperationsKey   = "cgroup_manager_latency_microseconds" PodWorkerStartLatencyKey     = "pod_worker_start_latency_microseconds" PLEGRelistLatencyKey         = "pleg_relist_latency_microseconds" <ins> PLEGDiscardEventsKey         = "pleg_discard_events" </ins> PLEGRelistIntervalKey        = "pleg_relist_interval_microseconds" EvictionStatsAgeKey          = "eviction_stats_age_microseconds" VolumeStatsCapacityBytesKey  = "volume_stats_capacity_bytes"
Help:      "Latency in microseconds for relisting pods in PLEG.", }, ) <ins> PLEGDiscardEvents = prometheus.NewCounterVec( prometheus.CounterOpts{ Subsystem: KubeletSubsystem, Name:      PLEGDiscardEventsKey, Help:      "The number of discard events in PLEG.", }, []string{}, ) </ins> PLEGRelistInterval = prometheus.NewSummary( prometheus.SummaryOpts{ Subsystem: KubeletSubsystem,
prometheus.MustRegister(ContainersPerPodCount) prometheus.MustRegister(newPodAndContainerCollector(containerCache)) prometheus.MustRegister(PLEGRelistLatency) <ins> prometheus.MustRegister(PLEGDiscardEvents) </ins> prometheus.MustRegister(PLEGRelistInterval) prometheus.MustRegister(RuntimeOperations) prometheus.MustRegister(RuntimeOperationsLatency)
} func newTestGenericPLEG() *TestGenericPLEG { <ins> return newTestGenericPLEGWithChannelSize(largeChannelCap) } func newTestGenericPLEGWithChannelSize(eventChannelCap int) *TestGenericPLEG { </ins> fakeRuntime := &containertest.FakeRuntime{} clock := clock.NewFakeClock(time.Time{}) // The channel capacity should be large enough to hold all events in a