mirror of https://github.com/k3s-io/k3s
Fixes 'Zone is empty' errors in PD upgrade tests; skips pd tests with inline volume in multizone clusters
parent
02611149c1
commit
fe76c9f779
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue