test/e2e: check both beta and zone label for getting cluster zone

Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
This commit is contained in:
Andrew Sy Kim
2019-08-28 13:14:02 -04:00
parent 07229d6c51
commit 349749644f
32 changed files with 201 additions and 1352 deletions

View File

@@ -34,11 +34,19 @@ func RecreateNodes(c clientset.Interface, nodes []v1.Node) error {
nodeNamesByZone := make(map[string][]string)
for i := range nodes {
node := &nodes[i]
zone := framework.TestContext.CloudConfig.Zone
if z, ok := node.Labels[v1.LabelZoneFailureDomain]; ok {
zone = z
if zone, ok := node.Labels[v1.LabelZoneFailureDomain]; ok {
nodeNamesByZone[zone] = append(nodeNamesByZone[zone], node.Name)
continue
}
nodeNamesByZone[zone] = append(nodeNamesByZone[zone], node.Name)
if zone, ok := node.Labels[v1.LabelZoneFailureDomainStable]; ok {
nodeNamesByZone[zone] = append(nodeNamesByZone[zone], node.Name)
continue
}
defaultZone := framework.TestContext.CloudConfig.Zone
nodeNamesByZone[defaultZone] = append(nodeNamesByZone[defaultZone], node.Name)
}
// Find the sole managed instance group name