mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 19:23:40 +00:00
Merge pull request #50238 from mborsz/managed
Automatic merge from submit-queue (batch tested with PRs 50091, 50231, 50238, 50236, 50243) Modify e2e.go to arbitrarily pick one of zones we have nodes in for multizone tests. **What this PR does / why we need it**: When e2e runs in multizone configuration, zone config property can be empty. This PR, in that case, overrides an empty value with arbitrarily chosen zone that we have nodes in. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note ```
This commit is contained in:
commit
969ae1ebee
@ -77,7 +77,8 @@ func setupProviderConfig() error {
|
|||||||
if !framework.TestContext.CloudConfig.MultiZone {
|
if !framework.TestContext.CloudConfig.MultiZone {
|
||||||
managedZones = []string{zone}
|
managedZones = []string{zone}
|
||||||
}
|
}
|
||||||
cloudConfig.Provider, err = gcecloud.CreateGCECloud(framework.TestContext.CloudConfig.ApiEndpoint,
|
|
||||||
|
gceCloud, err := gcecloud.CreateGCECloud(framework.TestContext.CloudConfig.ApiEndpoint,
|
||||||
framework.TestContext.CloudConfig.ProjectID,
|
framework.TestContext.CloudConfig.ProjectID,
|
||||||
region, zone, managedZones, "" /* networkUrl */, "" /* subnetworkUrl */, nil, /* nodeTags */
|
region, zone, managedZones, "" /* networkUrl */, "" /* subnetworkUrl */, nil, /* nodeTags */
|
||||||
"" /* nodeInstancePerfix */, nil /* tokenSource */, false /* useMetadataServer */)
|
"" /* nodeInstancePerfix */, nil /* tokenSource */, false /* useMetadataServer */)
|
||||||
@ -85,6 +86,17 @@ func setupProviderConfig() error {
|
|||||||
return fmt.Errorf("Error building GCE/GKE provider: %v", err)
|
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":
|
case "aws":
|
||||||
if cloudConfig.Zone == "" {
|
if cloudConfig.Zone == "" {
|
||||||
return fmt.Errorf("gce-zone must be specified for AWS")
|
return fmt.Errorf("gce-zone must be specified for AWS")
|
||||||
|
@ -144,7 +144,7 @@ type NodeTestContextType struct {
|
|||||||
type CloudConfig struct {
|
type CloudConfig struct {
|
||||||
ApiEndpoint string
|
ApiEndpoint string
|
||||||
ProjectID string
|
ProjectID string
|
||||||
Zone string
|
Zone string // for multizone tests, arbitrarily chosen zone
|
||||||
Region string
|
Region string
|
||||||
MultiZone bool
|
MultiZone bool
|
||||||
Cluster string
|
Cluster string
|
||||||
|
Loading…
Reference in New Issue
Block a user