Skip to content

Commit

Permalink
fix: e2e test not recognizing .kube/config (argoproj#1581)
Browse files Browse the repository at this point in the history
Signed-off-by: Julie Vogelman <[email protected]>
  • Loading branch information
juliev0 authored Feb 1, 2022
1 parent 19f8477 commit 0f34941
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/e2e/fixtures/e2e_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,15 @@ type E2ESuite struct {

func (s *E2ESuite) SetupSuite() {
var err error
kubeConfig, _ := os.LookupEnv(common.EnvVarKubeConfig)

kubeConfig, found := os.LookupEnv(common.EnvVarKubeConfig)
if !found {
home, _ := os.UserHomeDir()
kubeConfig = home + "/.kube/config"
if _, err := os.Stat(kubeConfig); err != nil && os.IsNotExist(err) {
kubeConfig = ""
}
}
s.restConfig, err = common.GetClientConfig(kubeConfig)
s.CheckError(err)
s.kubeClient, err = kubernetes.NewForConfig(s.restConfig)
Expand Down

0 comments on commit 0f34941

Please sign in to comment.