Skip to content

Commit 80453cc

Browse files
authored
Merge pull request #18189 from hakman/fix-pre-test
tests: fix KOPS_BASE_URL for build-kubernetes runs
2 parents 4dc291d + cd9375f commit 80453cc

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tests/e2e/kubetest2-kops/deployer/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (d *deployer) verifyBuildFlags() error {
127127
}
128128
d.StageLocation = stageLocation
129129
}
130-
if d.KopsBaseURL == "" && os.Getenv("KOPS_BASE_URL") == "" {
130+
if !d.BuildOptions.BuildKubernetes && d.KopsBaseURL == "" && os.Getenv("KOPS_BASE_URL") == "" {
131131
d.KopsBaseURL = strings.Replace(d.StageLocation, "gs://", "https://storage.googleapis.com/", 1)
132132
}
133133

tests/e2e/kubetest2-kops/deployer/up.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ func (d *deployer) Up() error {
5858
d.KopsBaseURL = baseURL
5959
}
6060

61-
// In PreTestCmd, we need KOPS_BASE_URL to be set for kops calls
62-
if os.Getenv("KOPS_BASE_URL") == "" {
61+
// PreTestCmd inherits the process environment rather than d.env().
62+
if d.KopsBaseURL != "" {
6363
os.Setenv("KOPS_BASE_URL", d.KopsBaseURL)
6464
}
6565

0 commit comments

Comments
 (0)