Skip to content

Commit

Permalink
tests: always return a kubeconfig even if we do not create a cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
rquitales committed Mar 12, 2024
1 parent c14edd2 commit 8cd5795
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/clusters/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ func (t *TestClusters) pickCluster() Cluster {
// required for the kubectl command to target the right cluster that the test is running on.
func (t *TestClusters) WrapProviderTestOptions(opts integration.ProgramTestOptions) (integration.ProgramTestOptions, string) {
if t.clusters == nil {
return opts, ""
// Check if KUBECONFIG is set, if it is then use that for the tests.
kcfg := os.Getenv("KUBECONFIG")
if kcfg == "" {
kcfg = os.ExpandEnv("$HOME/.kube/config")
}
return opts, kcfg
}

cluster := t.pickCluster()
Expand Down

0 comments on commit 8cd5795

Please sign in to comment.