From 4d2ff08bfa184206cace3ce3ce9b5ac8e10e380a Mon Sep 17 00:00:00 2001 From: SataQiu Date: Fri, 26 May 2023 12:36:19 +0800 Subject: [PATCH] e2e-framework: code cleanup for mismatched comments --- test/e2e/framework/job/rest.go | 2 +- test/e2e/framework/kubectl/builder.go | 2 +- test/e2e/framework/metrics/kubelet_metrics.go | 4 ++-- test/e2e/framework/node/runtimeclass/runtimeclass.go | 2 +- test/e2e/framework/pod/pod_client.go | 2 +- test/e2e/framework/pod/wait.go | 2 +- test/e2e/framework/volume/fixtures.go | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/e2e/framework/job/rest.go b/test/e2e/framework/job/rest.go index 7497032600d..9c24bab24db 100644 --- a/test/e2e/framework/job/rest.go +++ b/test/e2e/framework/job/rest.go @@ -59,7 +59,7 @@ func CreateJob(ctx context.Context, c clientset.Interface, ns string, job *batch return c.BatchV1().Jobs(ns).Create(ctx, job, metav1.CreateOptions{}) } -// CreateJob uses c to update a job in namespace ns. If the returned error is +// UpdateJob uses c to update a job in namespace ns. If the returned error is // nil, the returned Job is valid and has been updated. func UpdateJob(ctx context.Context, c clientset.Interface, ns string, job *batchv1.Job) (*batchv1.Job, error) { return c.BatchV1().Jobs(ns).Update(ctx, job, metav1.UpdateOptions{}) diff --git a/test/e2e/framework/kubectl/builder.go b/test/e2e/framework/kubectl/builder.go index 3811fa57219..e33acb7d1b3 100644 --- a/test/e2e/framework/kubectl/builder.go +++ b/test/e2e/framework/kubectl/builder.go @@ -49,7 +49,7 @@ func NewKubectlCommand(namespace string, args ...string) *KubectlBuilder { return b } -// WithEnv appends the given environment and returns itself. +// AppendEnv appends the given environment and returns itself. func (b *KubectlBuilder) AppendEnv(env []string) *KubectlBuilder { if b.cmd.Env == nil { b.cmd.Env = os.Environ() diff --git a/test/e2e/framework/metrics/kubelet_metrics.go b/test/e2e/framework/metrics/kubelet_metrics.go index 545f61388b6..fd0776d1b2b 100644 --- a/test/e2e/framework/metrics/kubelet_metrics.go +++ b/test/e2e/framework/metrics/kubelet_metrics.go @@ -44,7 +44,7 @@ const ( // Taken from k8s.io/kubernetes/pkg/kubelet/metrics podStartDurationKey = "pod_start_duration_seconds" // Taken from k8s.io/kubernetes/pkg/kubelet/metrics - PodStartSLIDurationKey = "pod_start_sli_duration_seconds" + podStartSLIDurationKey = "pod_start_sli_duration_seconds" // Taken from k8s.io/kubernetes/pkg/kubelet/metrics cgroupManagerOperationsKey = "cgroup_manager_duration_seconds" // Taken from k8s.io/kubernetes/pkg/kubelet/metrics @@ -155,7 +155,7 @@ func GetDefaultKubeletLatencyMetrics(ms KubeletMetrics) KubeletLatencyMetrics { podWorkerDurationKey, podWorkerStartDurationKey, podStartDurationKey, - PodStartSLIDurationKey, + podStartSLIDurationKey, cgroupManagerOperationsKey, dockerOperationsLatencyKey, podWorkerStartDurationKey, diff --git a/test/e2e/framework/node/runtimeclass/runtimeclass.go b/test/e2e/framework/node/runtimeclass/runtimeclass.go index 753ce651c08..f6557c5dc5c 100644 --- a/test/e2e/framework/node/runtimeclass/runtimeclass.go +++ b/test/e2e/framework/node/runtimeclass/runtimeclass.go @@ -55,7 +55,7 @@ func NewRuntimeClassPod(runtimeClassName string) *v1.Pod { } } -// Check if test-handler is configured by reading the configuration from container runtime config. +// NodeSupportsPreconfiguredRuntimeClassHandler checks if test-handler is configured by reading the configuration from container runtime config. // If no error is returned, the container runtime is assumed to support the test-handler, otherwise an error will be returned. func NodeSupportsPreconfiguredRuntimeClassHandler(ctx context.Context, f *framework.Framework) error { node, err := e2enode.GetRandomReadySchedulableNode(ctx, f.ClientSet) diff --git a/test/e2e/framework/pod/pod_client.go b/test/e2e/framework/pod/pod_client.go index 7289c184526..94a728dfe99 100644 --- a/test/e2e/framework/pod/pod_client.go +++ b/test/e2e/framework/pod/pod_client.go @@ -331,7 +331,7 @@ func removeString(slice []string, s string) []string { return newSlice } -// RemovePodFinalizer removes the pod's finalizer +// RemoveFinalizer removes the pod's finalizer func (c *PodClient) RemoveFinalizer(ctx context.Context, podName string, finalizerName string) { framework.Logf("Removing pod's %q finalizer: %q", podName, finalizerName) c.Update(ctx, podName, func(pod *v1.Pod) { diff --git a/test/e2e/framework/pod/wait.go b/test/e2e/framework/pod/wait.go index 5d79d959dfa..5b019cce166 100644 --- a/test/e2e/framework/pod/wait.go +++ b/test/e2e/framework/pod/wait.go @@ -541,7 +541,7 @@ func WaitForPodNotFoundInNamespace(ctx context.Context, c clientset.Interface, p return nil } -// PodsResponding waits for the pods to response. +// WaitForPodsResponding waits for the pods to response. func WaitForPodsResponding(ctx context.Context, c clientset.Interface, ns string, controllerName string, wantName bool, timeout time.Duration, pods *v1.PodList) error { if timeout == 0 { timeout = podRespondingTimeout diff --git a/test/e2e/framework/volume/fixtures.go b/test/e2e/framework/volume/fixtures.go index 19e3c275da0..17396be1c45 100644 --- a/test/e2e/framework/volume/fixtures.go +++ b/test/e2e/framework/volume/fixtures.go @@ -620,7 +620,7 @@ func generateWriteCmd(content, path string) []string { return commands } -// generateReadBlockCmd generates the corresponding command lines to read from a block device with the given file path. +// GenerateReadBlockCmd generates the corresponding command lines to read from a block device with the given file path. func GenerateReadBlockCmd(fullPath string, numberOfCharacters int) []string { var commands []string commands = []string{"head", "-c", strconv.Itoa(numberOfCharacters), fullPath}