mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 14:14:39 +00:00
Detect zone of MIG in e2e VPA tests
I was running e2e VPA tests and some were failing because the tests assume thata they're running on: - zonal single-zone cluster, or - regional multi-zone cluster. And I was running them on regional, single-zoned cluster. Change-Id: I110a70d2249f981b60cf76d1ad674ccfcedd8fb3
This commit is contained in:
@@ -184,16 +184,12 @@ func (p *Provider) EnsureLoadBalancerResourcesDeleted(ip, portRange string) erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getGCEZoneForGroup(group string) (string, error) {
|
func getGCEZoneForGroup(group string) (string, error) {
|
||||||
zone := framework.TestContext.CloudConfig.Zone
|
output, err := exec.Command("gcloud", "compute", "instance-groups", "managed", "list",
|
||||||
if framework.TestContext.CloudConfig.MultiZone {
|
"--project="+framework.TestContext.CloudConfig.ProjectID, "--format=value(zone)", "--filter=name="+group).CombinedOutput()
|
||||||
output, err := exec.Command("gcloud", "compute", "instance-groups", "managed", "list",
|
if err != nil {
|
||||||
"--project="+framework.TestContext.CloudConfig.ProjectID, "--format=value(zone)", "--filter=name="+group).CombinedOutput()
|
return "", fmt.Errorf("Failed to get zone for node group %s: %s", group, output)
|
||||||
if err != nil {
|
|
||||||
return "", fmt.Errorf("Failed to get zone for node group %s: %s", group, output)
|
|
||||||
}
|
|
||||||
zone = strings.TrimSpace(string(output))
|
|
||||||
}
|
}
|
||||||
return zone, nil
|
return strings.TrimSpace(string(output)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteNode deletes a node which is specified as the argument
|
// DeleteNode deletes a node which is specified as the argument
|
||||||
|
Reference in New Issue
Block a user