Skip to content

Commit

Permalink
ci: address shadowing of predeclared identifier
Browse files Browse the repository at this point in the history
- Comparing integers makes more sense than comparing the strings.

Signed-off-by: Praveen M <[email protected]>
  • Loading branch information
iPraveenParihar committed Jan 2, 2025
1 parent 0581c7f commit 7ae404f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions e2e/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1580,10 +1580,17 @@ func k8sVersionGreaterEquals(c kubernetes.Interface, major, minor int) bool {
// return value.
}

maj := strconv.Itoa(major)
min := strconv.Itoa(minor)
vMajor, err := strconv.Atoi(v.Major)
if err != nil {
framework.Failf("failed to convert Kubernetes major version %q to int: %v", v.Major, err)
}

vMinor, err := strconv.Atoi(v.Minor)
if err != nil {
framework.Failf("failed to convert Kubernetes minor version %q to int: %v", v.Minor, err)
}

return (v.Major > maj) || (v.Major == maj && v.Minor >= min)
return (vMajor > major) || (vMajor == major && vMinor >= minor)
}

// waitForJobCompletion polls the status of the given job and waits until the
Expand Down

0 comments on commit 7ae404f

Please sign in to comment.