chore: omit comparison to bool constant

This commit is contained in:
guoguangwu 2023-06-29 09:55:50 +08:00
parent 1c7e87cff2
commit 0da37d8c54
5 changed files with 8 additions and 8 deletions

View File

@ -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),
}

View File

@ -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

View File

@ -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)
}
}

View File

@ -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
}
}

View File

@ -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")
}