diff --git a/tests/e2e/kubetest2-kops/deployer/build.go b/tests/e2e/kubetest2-kops/deployer/build.go index ed11d3f462f58..6eb5df69b43bd 100644 --- a/tests/e2e/kubetest2-kops/deployer/build.go +++ b/tests/e2e/kubetest2-kops/deployer/build.go @@ -78,12 +78,6 @@ func (d *deployer) verifyBuildFlags() error { d.BuildOptions.KopsRoot = d.KopsRoot d.BuildOptions.StageLocation = d.StageLocation - for _, envvar := range d.env() { - // Set all of the env vars we use for kops in the current process - // so that the tester inherits them when shelling out to kops - i := strings.Index(envvar, "=") - os.Setenv(envvar[0:i], envvar[i+1:]) - } return nil } diff --git a/tests/e2e/kubetest2-kops/deployer/common.go b/tests/e2e/kubetest2-kops/deployer/common.go index 098b24e92f8d7..f480fef0e99bf 100644 --- a/tests/e2e/kubetest2-kops/deployer/common.go +++ b/tests/e2e/kubetest2-kops/deployer/common.go @@ -106,7 +106,7 @@ func (d *deployer) initialize() error { d.SSHPrivateKeyPath = privateKey d.SSHPublicKeyPath = publicKey } - d.createBucket = os.Getenv("KOPS_STATE_STORE") == "" + d.createBucket = true } } if d.SSHUser == "" { @@ -119,6 +119,14 @@ func (d *deployer) initialize() error { } d.terraform = t } + if d.commonOptions.ShouldTest() { + for _, envvar := range d.env() { + // Set all of the env vars we use for kops in the current process + // so that the tester inherits them when shelling out to kops + i := strings.Index(envvar, "=") + os.Setenv(envvar[0:i], envvar[i+1:]) + } + } return nil }