Fixes 'Zone is empty' errors in PD upgrade tests; skips pd tests with inline volume in multizone clusters

This commit is contained in:
Cheng Xing
2018-03-15 15:00:13 -07:00
parent 02611149c1
commit fe76c9f779
3 changed files with 20 additions and 0 deletions

View File

@@ -708,6 +708,14 @@ func createPD(zone string) (string, error) {
return "", err
}
if zone == "" && TestContext.CloudConfig.MultiZone {
zones, err := gceCloud.GetAllZonesFromCloudProvider()
if err != nil {
return "", err
}
zone, _ = zones.PopAny()
}
tags := map[string]string{}
err = gceCloud.CreateDisk(pdName, gcecloud.DiskTypeSSD, zone, 10 /* sizeGb */, tags)
if err != nil {