From b04b5f556c0dbc8aa2532afaf40a8900562f3d2a Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Mon, 4 Jan 2021 11:28:07 -0500 Subject: [PATCH] kubetest2: support specifying admin-access value Otherwise I was getting my IPv6 address, which doesn't work well. --- tests/e2e/kubetest2-kops/deployer/deployer.go | 2 ++ tests/e2e/kubetest2-kops/deployer/up.go | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/e2e/kubetest2-kops/deployer/deployer.go b/tests/e2e/kubetest2-kops/deployer/deployer.go index 5dfd4fdafa..e69b763cbf 100644 --- a/tests/e2e/kubetest2-kops/deployer/deployer.go +++ b/tests/e2e/kubetest2-kops/deployer/deployer.go @@ -55,6 +55,8 @@ type deployer struct { ArtifactsDir string `flag:"-"` + AdminAccess string `flag:"admin-access" desc:"The CIDR to restrict kubernetes API access"` + BuildOptions *builder.BuildOptions } diff --git a/tests/e2e/kubetest2-kops/deployer/up.go b/tests/e2e/kubetest2-kops/deployer/up.go index e34fedca5c..ac85ac7033 100644 --- a/tests/e2e/kubetest2-kops/deployer/up.go +++ b/tests/e2e/kubetest2-kops/deployer/up.go @@ -38,10 +38,15 @@ func (d *deployer) Up() error { return err } + adminAccess := d.AdminAccess + if adminAccess == "" { + adminAccess = publicIP + } + args := []string{ d.KopsBinaryPath, "create", "cluster", "--name", d.ClusterName, - "--admin-access", publicIP, + "--admin-access", adminAccess, "--cloud", d.CloudProvider, "--kubernetes-version", d.KubernetesVersion, "--master-count", "1",