mirror of https://github.com/k3s-io/k3s
e2e tests should be multizone aware
Pass MULTIZONE=true env. variable to e2e test framework.pull/6/head
parent
873d0a73cf
commit
a327302200
|
@ -133,6 +133,7 @@ export PATH=$(dirname "${e2e_test}"):"${PATH}"
|
|||
--provider="${KUBERNETES_PROVIDER}" \
|
||||
--gce-project="${PROJECT:-}" \
|
||||
--gce-zone="${ZONE:-}" \
|
||||
--gce-multizone="${MULTIZONE:-false}" \
|
||||
--gke-cluster="${CLUSTER_NAME:-}" \
|
||||
--kube-master="${KUBE_MASTER:-}" \
|
||||
--cluster-tag="${CLUSTER_ID:-}" \
|
||||
|
|
|
@ -281,6 +281,7 @@ garbage-collector-enabled
|
|||
gather-logs-sizes
|
||||
gather-metrics-at-teardown
|
||||
gather-resource-usage
|
||||
gce-multizone
|
||||
gce-project
|
||||
gce-service-account
|
||||
gce-upgrade-script
|
||||
|
|
|
@ -72,7 +72,10 @@ func setupProviderConfig() error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("error parsing GCE/GKE region from zone %q: %v", zone, err)
|
||||
}
|
||||
managedZones := []string{zone} // Only single-zone for now
|
||||
managedZones := []string{} // Manage all zones in the region
|
||||
if !framework.TestContext.CloudConfig.MultiZone {
|
||||
managedZones = []string{zone}
|
||||
}
|
||||
cloudConfig.Provider, err = gcecloud.CreateGCECloud(framework.TestContext.CloudConfig.ProjectID, region, zone, managedZones, "" /* networkUrl */, nil /* nodeTags */, "" /* nodeInstancePerfix */, nil /* tokenSource */, false /* useMetadataServer */)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error building GCE/GKE provider: %v", err)
|
||||
|
|
|
@ -129,6 +129,7 @@ type NodeTestContextType struct {
|
|||
type CloudConfig struct {
|
||||
ProjectID string
|
||||
Zone string
|
||||
MultiZone bool
|
||||
Cluster string
|
||||
MasterName string
|
||||
NodeInstanceGroup string
|
||||
|
@ -194,6 +195,7 @@ func RegisterClusterFlags() {
|
|||
flag.StringVar(&cloudConfig.MasterName, "kube-master", "", "Name of the kubernetes master. Only required if provider is gce or gke")
|
||||
flag.StringVar(&cloudConfig.ProjectID, "gce-project", "", "The GCE project being used, if applicable")
|
||||
flag.StringVar(&cloudConfig.Zone, "gce-zone", "", "GCE zone being used, if applicable")
|
||||
flag.BoolVar(&cloudConfig.MultiZone, "gce-multizone", false, "If true, start GCE cloud provider with multizone support.")
|
||||
flag.StringVar(&cloudConfig.Cluster, "gke-cluster", "", "GKE name of cluster being used, if applicable")
|
||||
flag.StringVar(&cloudConfig.NodeInstanceGroup, "node-instance-group", "", "Name of the managed instance group for nodes. Valid only for gce, gke or aws. If there is more than one group: comma separated list of groups.")
|
||||
flag.StringVar(&cloudConfig.Network, "network", "e2e", "The cloud provider network for this e2e cluster.")
|
||||
|
|
Loading…
Reference in New Issue