From 43022591d1c703d9628a8152652a3f173e633751 Mon Sep 17 00:00:00 2001 From: bprashanth Date: Fri, 26 Aug 2016 10:06:00 -0700 Subject: [PATCH] Get network name via e2e environment. --- hack/ginkgo-e2e.sh | 1 + test/e2e/framework/test_context.go | 2 ++ test/e2e/ingress.go | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hack/ginkgo-e2e.sh b/hack/ginkgo-e2e.sh index daf1e4ad2c..cdd69147db 100755 --- a/hack/ginkgo-e2e.sh +++ b/hack/ginkgo-e2e.sh @@ -127,6 +127,7 @@ export PATH=$(dirname "${e2e_test}"):"${PATH}" --repo-root="${KUBE_ROOT}" \ --node-instance-group="${NODE_INSTANCE_GROUP:-}" \ --prefix="${KUBE_GCE_INSTANCE_PREFIX:-e2e}" \ + --network="${KUBE_GCE_NETWORK:-${KUBE_GKE_NETWORK:-e2e}}" \ ${KUBE_CONTAINER_RUNTIME:+"--container-runtime=${KUBE_CONTAINER_RUNTIME}"} \ ${MASTER_OS_DISTRIBUTION:+"--master-os-distro=${MASTER_OS_DISTRIBUTION}"} \ ${NODE_OS_DISTRIBUTION:+"--node-os-distro=${NODE_OS_DISTRIBUTION}"} \ diff --git a/test/e2e/framework/test_context.go b/test/e2e/framework/test_context.go index 8ef1babca2..448e6b858b 100644 --- a/test/e2e/framework/test_context.go +++ b/test/e2e/framework/test_context.go @@ -95,6 +95,7 @@ type CloudConfig struct { NodeInstanceGroup string NumNodes int ClusterTag string + Network string Provider cloudprovider.Interface } @@ -150,6 +151,7 @@ func RegisterClusterFlags() { flag.StringVar(&cloudConfig.Zone, "gce-zone", "", "GCE zone being used, if applicable") 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.") flag.IntVar(&cloudConfig.NumNodes, "num-nodes", -1, "Number of nodes in the cluster") flag.StringVar(&cloudConfig.ClusterTag, "cluster-tag", "", "Tag used to identify resources. Only required if provider is aws.") diff --git a/test/e2e/ingress.go b/test/e2e/ingress.go index 045890d9db..648bd0421a 100644 --- a/test/e2e/ingress.go +++ b/test/e2e/ingress.go @@ -159,7 +159,7 @@ var _ = framework.KubeDescribe("Loadbalancing: L7 [Feature:Ingress]", func() { // but we want to allow easy testing where a user might've hand // configured firewalls. if framework.ProviderIs("gce", "gke") { - ExpectNoError(gcloudCreate("firewall-rules", fmt.Sprintf("ingress-80-443-%v", ns), framework.TestContext.CloudConfig.ProjectID, "--allow", "tcp:80,tcp:443", "--network", "e2e")) + ExpectNoError(gcloudCreate("firewall-rules", fmt.Sprintf("ingress-80-443-%v", ns), framework.TestContext.CloudConfig.ProjectID, "--allow", "tcp:80,tcp:443", "--network", framework.TestContext.CloudConfig.Network)) } else { framework.Logf("WARNING: Not running on GCE/GKE, cannot create firewall rules for :80, :443. Assuming traffic can reach the external ips of all nodes in cluster on those ports.") }