Merge pull request #73271 from jbartosik/vpa-e2e-regio-tweak

Detect zone of MIG in e2e VPA tests
k3s-v1.15.3
Kubernetes Prow Robot 2019-04-24 12:24:28 -07:00 committed by GitHub
commit 9edb70f8e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 9 deletions

View File

@ -184,16 +184,12 @@ func (p *Provider) EnsureLoadBalancerResourcesDeleted(ip, portRange string) erro
}
func getGCEZoneForGroup(group string) (string, error) {
zone := framework.TestContext.CloudConfig.Zone
if framework.TestContext.CloudConfig.MultiZone {
output, err := exec.Command("gcloud", "compute", "instance-groups", "managed", "list",
"--project="+framework.TestContext.CloudConfig.ProjectID, "--format=value(zone)", "--filter=name="+group).CombinedOutput()
if err != nil {
return "", fmt.Errorf("Failed to get zone for node group %s: %s", group, output)
}
zone = strings.TrimSpace(string(output))
output, err := exec.Command("gcloud", "compute", "instance-groups", "managed", "list",
"--project="+framework.TestContext.CloudConfig.ProjectID, "--format=value(zone)", "--filter=name="+group).CombinedOutput()
if err != nil {
return "", fmt.Errorf("Failed to get zone for node group %s: %s", group, output)
}
return zone, nil
return strings.TrimSpace(string(output)), nil
}
// DeleteNode deletes a node which is specified as the argument