From 0da37d8c544ff961800828ed9e8999a116aa12aa Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Thu, 29 Jun 2023 09:55:50 +0800 Subject: [PATCH] chore: omit comparison to bool constant --- pkg/kubelet/kubelet_server_journal.go | 2 +- test/e2e/node/pod_resize.go | 4 ++-- test/e2e/node/pods.go | 2 +- test/e2e/storage/vsphere/vsphere_volume_diskformat.go | 6 +++--- test/e2e/windows/kubelet_stats.go | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/kubelet/kubelet_server_journal.go b/pkg/kubelet/kubelet_server_journal.go index bf3114519c6..2cd88e46c9c 100644 --- a/pkg/kubelet/kubelet_server_journal.go +++ b/pkg/kubelet/kubelet_server_journal.go @@ -354,7 +354,7 @@ func copyFileLogs(ctx context.Context, w io.Writer, services []string) { // in that order stopping on first success. func heuristicsCopyFileLogs(ctx context.Context, w io.Writer, service string) { logFileNames := [3]string{ - fmt.Sprintf("%s", service), + service, fmt.Sprintf("%s.log", service), fmt.Sprintf("%s/%s.log", service, service), } diff --git a/test/e2e/node/pod_resize.go b/test/e2e/node/pod_resize.go index 43f36a19f52..6153256f45e 100644 --- a/test/e2e/node/pod_resize.go +++ b/test/e2e/node/pod_resize.go @@ -429,7 +429,7 @@ func waitForPodResizeActuation(c clientset.Interface, podClient *e2epod.PodClien if err != nil { return nil, err } - if verifyPodAllocations(pod, expectedContainers, false) == false { + if !verifyPodAllocations(pod, expectedContainers, false) { continue } return pod, nil @@ -438,7 +438,7 @@ func waitForPodResizeActuation(c clientset.Interface, podClient *e2epod.PodClien } waitContainerCgroupValuesEqualsExpected := func() error { for start := time.Now(); time.Since(start) < PollTimeout; time.Sleep(PollInterval) { - if verifyPodContainersCgroupValues(patchedPod, expectedContainers, false) == false { + if !verifyPodContainersCgroupValues(patchedPod, expectedContainers, false) { continue } return nil diff --git a/test/e2e/node/pods.go b/test/e2e/node/pods.go index e30c82988c9..c2ddade6245 100644 --- a/test/e2e/node/pods.go +++ b/test/e2e/node/pods.go @@ -726,7 +726,7 @@ func (v *podStartVerifier) Verify(event watch.Event) error { } if status := e2epod.FindContainerStatusInPod(pod, "blocked"); status != nil { - if (status.Started != nil && *status.Started == true) || status.LastTerminationState.Terminated != nil || status.State.Waiting == nil { + if (status.Started != nil && *status.Started) || status.LastTerminationState.Terminated != nil || status.State.Waiting == nil { return fmt.Errorf("pod %s on node %s should not have started the blocked container: %#v", pod.Name, pod.Spec.NodeName, status) } } diff --git a/test/e2e/storage/vsphere/vsphere_volume_diskformat.go b/test/e2e/storage/vsphere/vsphere_volume_diskformat.go index 45d91e54e6e..23a391739ee 100644 --- a/test/e2e/storage/vsphere/vsphere_volume_diskformat.go +++ b/test/e2e/storage/vsphere/vsphere_volume_diskformat.go @@ -194,15 +194,15 @@ func verifyDiskFormat(ctx context.Context, client clientset.Interface, nodeName } isDiskFormatCorrect := false if diskFormat == "eagerzeroedthick" { - if eagerlyScrub == true && thinProvisioned == false { + if eagerlyScrub && !thinProvisioned { isDiskFormatCorrect = true } } else if diskFormat == "zeroedthick" { - if eagerlyScrub == false && thinProvisioned == false { + if !eagerlyScrub && !thinProvisioned { isDiskFormatCorrect = true } } else if diskFormat == "thin" { - if eagerlyScrub == false && thinProvisioned == true { + if !eagerlyScrub && thinProvisioned { isDiskFormatCorrect = true } } diff --git a/test/e2e/windows/kubelet_stats.go b/test/e2e/windows/kubelet_stats.go index b8ce353bf4b..00d6e7e1913 100644 --- a/test/e2e/windows/kubelet_stats.go +++ b/test/e2e/windows/kubelet_stats.go @@ -224,7 +224,7 @@ func findWindowsNode(ctx context.Context, f *framework.Framework) (v1.Node, erro } } - if foundNode == false { + if !foundNode { e2eskipper.Skipf("Could not find and ready and schedulable Windows nodes") }