e2e-framework: code cleanup for mismatched comments

This commit is contained in:
SataQiu 2023-05-26 12:36:19 +08:00
parent 2e306e9632
commit 4d2ff08bfa
7 changed files with 8 additions and 8 deletions

View File

@ -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{}) 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. // 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) { 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{}) return c.BatchV1().Jobs(ns).Update(ctx, job, metav1.UpdateOptions{})

View File

@ -49,7 +49,7 @@ func NewKubectlCommand(namespace string, args ...string) *KubectlBuilder {
return b 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 { func (b *KubectlBuilder) AppendEnv(env []string) *KubectlBuilder {
if b.cmd.Env == nil { if b.cmd.Env == nil {
b.cmd.Env = os.Environ() b.cmd.Env = os.Environ()

View File

@ -44,7 +44,7 @@ const (
// Taken from k8s.io/kubernetes/pkg/kubelet/metrics // Taken from k8s.io/kubernetes/pkg/kubelet/metrics
podStartDurationKey = "pod_start_duration_seconds" podStartDurationKey = "pod_start_duration_seconds"
// Taken from k8s.io/kubernetes/pkg/kubelet/metrics // 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 // Taken from k8s.io/kubernetes/pkg/kubelet/metrics
cgroupManagerOperationsKey = "cgroup_manager_duration_seconds" cgroupManagerOperationsKey = "cgroup_manager_duration_seconds"
// Taken from k8s.io/kubernetes/pkg/kubelet/metrics // Taken from k8s.io/kubernetes/pkg/kubelet/metrics
@ -155,7 +155,7 @@ func GetDefaultKubeletLatencyMetrics(ms KubeletMetrics) KubeletLatencyMetrics {
podWorkerDurationKey, podWorkerDurationKey,
podWorkerStartDurationKey, podWorkerStartDurationKey,
podStartDurationKey, podStartDurationKey,
PodStartSLIDurationKey, podStartSLIDurationKey,
cgroupManagerOperationsKey, cgroupManagerOperationsKey,
dockerOperationsLatencyKey, dockerOperationsLatencyKey,
podWorkerStartDurationKey, podWorkerStartDurationKey,

View File

@ -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. // 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 { func NodeSupportsPreconfiguredRuntimeClassHandler(ctx context.Context, f *framework.Framework) error {
node, err := e2enode.GetRandomReadySchedulableNode(ctx, f.ClientSet) node, err := e2enode.GetRandomReadySchedulableNode(ctx, f.ClientSet)

View File

@ -331,7 +331,7 @@ func removeString(slice []string, s string) []string {
return newSlice 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) { func (c *PodClient) RemoveFinalizer(ctx context.Context, podName string, finalizerName string) {
framework.Logf("Removing pod's %q finalizer: %q", podName, finalizerName) framework.Logf("Removing pod's %q finalizer: %q", podName, finalizerName)
c.Update(ctx, podName, func(pod *v1.Pod) { c.Update(ctx, podName, func(pod *v1.Pod) {

View File

@ -541,7 +541,7 @@ func WaitForPodNotFoundInNamespace(ctx context.Context, c clientset.Interface, p
return nil 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 { func WaitForPodsResponding(ctx context.Context, c clientset.Interface, ns string, controllerName string, wantName bool, timeout time.Duration, pods *v1.PodList) error {
if timeout == 0 { if timeout == 0 {
timeout = podRespondingTimeout timeout = podRespondingTimeout

View File

@ -620,7 +620,7 @@ func generateWriteCmd(content, path string) []string {
return commands 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 { func GenerateReadBlockCmd(fullPath string, numberOfCharacters int) []string {
var commands []string var commands []string
commands = []string{"head", "-c", strconv.Itoa(numberOfCharacters), fullPath} commands = []string{"head", "-c", strconv.Itoa(numberOfCharacters), fullPath}