mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Modify e2e.go to arbitrarily pick one of zones we have nodes in for
multizone tests.
This commit is contained in:
parent
8b30aaec39
commit
7c506c6a14
@ -77,7 +77,8 @@ func setupProviderConfig() error {
|
||||
if !framework.TestContext.CloudConfig.MultiZone {
|
||||
managedZones = []string{zone}
|
||||
}
|
||||
cloudConfig.Provider, err = gcecloud.CreateGCECloud(framework.TestContext.CloudConfig.ApiEndpoint,
|
||||
|
||||
gceCloud, err := gcecloud.CreateGCECloud(framework.TestContext.CloudConfig.ApiEndpoint,
|
||||
framework.TestContext.CloudConfig.ProjectID,
|
||||
region, zone, managedZones, "" /* networkUrl */, "" /* subnetworkUrl */, nil, /* nodeTags */
|
||||
"" /* nodeInstancePerfix */, nil /* tokenSource */, false /* useMetadataServer */)
|
||||
@ -85,6 +86,17 @@ func setupProviderConfig() error {
|
||||
return fmt.Errorf("Error building GCE/GKE provider: %v", err)
|
||||
}
|
||||
|
||||
cloudConfig.Provider = gceCloud
|
||||
|
||||
if cloudConfig.Zone == "" && framework.TestContext.CloudConfig.MultiZone {
|
||||
zones, err := gceCloud.GetAllZones()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cloudConfig.Zone, _ = zones.PopAny()
|
||||
}
|
||||
|
||||
case "aws":
|
||||
if cloudConfig.Zone == "" {
|
||||
return fmt.Errorf("gce-zone must be specified for AWS")
|
||||
|
@ -144,7 +144,7 @@ type NodeTestContextType struct {
|
||||
type CloudConfig struct {
|
||||
ApiEndpoint string
|
||||
ProjectID string
|
||||
Zone string
|
||||
Zone string // for multizone tests, arbitrarily chosen zone
|
||||
Region string
|
||||
MultiZone bool
|
||||
Cluster string
|
||||
|
Loading…
Reference in New Issue
Block a user