Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/e2e/framework/pv_util.go
Expand Up @@ -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 {
Expand Down
10 changes: 10 additions & 0 deletions test/e2e/framework/util.go
Expand Up @@ -348,6 +348,16 @@ func SkipUnlessMultizone(c clientset.Interface) {
}
}

func SkipIfMultizone(c clientset.Interface) {
zones, err := GetClusterZones(c)
if err != nil {
Skipf("Error listing cluster zones")
}
if zones.Len() > 1 {
Skipf("Requires more than one zone")
}
}

func SkipUnlessClusterMonitoringModeIs(supportedMonitoring ...string) {
if !ClusterMonitoringModeIs(supportedMonitoring...) {
Skipf("Only next monitoring modes are supported %v (not %s)", supportedMonitoring, TestContext.ClusterMonitoringMode)
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/storage/pd.go
Expand Up @@ -70,6 +70,8 @@ var _ = utils.SIGDescribe("Pod Disks", func() {
cs = f.ClientSet
ns = f.Namespace.Name

framework.SkipIfMultizone(cs)

podClient = cs.CoreV1().Pods(ns)
nodeClient = cs.CoreV1().Nodes()
nodes = framework.GetReadySchedulableNodesOrDie(cs)
Expand Down