mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #79921 from s-ito-ts/remove_unnecessary_check
e2e test: Remove unnecessary return value check
This commit is contained in:
commit
15ade86935
@ -113,8 +113,7 @@ func SpreadServiceOrFail(f *framework.Framework, replicaCount int, image string)
|
|||||||
// Now make sure they're spread across zones
|
// Now make sure they're spread across zones
|
||||||
zoneNames, err := framework.GetClusterZones(f.ClientSet)
|
zoneNames, err := framework.GetClusterZones(f.ClientSet)
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
ret, _ := checkZoneSpreading(f.ClientSet, pods, zoneNames.List())
|
checkZoneSpreading(f.ClientSet, pods, zoneNames.List())
|
||||||
framework.ExpectEqual(ret, true)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the name of the zone in which a Node is running
|
// Find the name of the zone in which a Node is running
|
||||||
@ -147,7 +146,7 @@ func getZoneNameForPod(c clientset.Interface, pod v1.Pod) (string, error) {
|
|||||||
|
|
||||||
// Determine whether a set of pods are approximately evenly spread
|
// Determine whether a set of pods are approximately evenly spread
|
||||||
// across a given set of zones
|
// across a given set of zones
|
||||||
func checkZoneSpreading(c clientset.Interface, pods *v1.PodList, zoneNames []string) (bool, error) {
|
func checkZoneSpreading(c clientset.Interface, pods *v1.PodList, zoneNames []string) {
|
||||||
podsPerZone := make(map[string]int)
|
podsPerZone := make(map[string]int)
|
||||||
for _, zoneName := range zoneNames {
|
for _, zoneName := range zoneNames {
|
||||||
podsPerZone[zoneName] = 0
|
podsPerZone[zoneName] = 0
|
||||||
@ -173,7 +172,6 @@ func checkZoneSpreading(c clientset.Interface, pods *v1.PodList, zoneNames []str
|
|||||||
gomega.Expect(minPodsPerZone).To(gomega.BeNumerically("~", maxPodsPerZone, 1),
|
gomega.Expect(minPodsPerZone).To(gomega.BeNumerically("~", maxPodsPerZone, 1),
|
||||||
"Pods were not evenly spread across zones. %d in one zone and %d in another zone",
|
"Pods were not evenly spread across zones. %d in one zone and %d in another zone",
|
||||||
minPodsPerZone, maxPodsPerZone)
|
minPodsPerZone, maxPodsPerZone)
|
||||||
return true, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SpreadRCOrFail Check that the pods comprising a replication
|
// SpreadRCOrFail Check that the pods comprising a replication
|
||||||
@ -229,6 +227,5 @@ func SpreadRCOrFail(f *framework.Framework, replicaCount int32, image string, ar
|
|||||||
// Now make sure they're spread across zones
|
// Now make sure they're spread across zones
|
||||||
zoneNames, err := framework.GetClusterZones(f.ClientSet)
|
zoneNames, err := framework.GetClusterZones(f.ClientSet)
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
ret, _ := checkZoneSpreading(f.ClientSet, pods, zoneNames.List())
|
checkZoneSpreading(f.ClientSet, pods, zoneNames.List())
|
||||||
framework.ExpectEqual(ret, true)
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user