Skip to content

Commit 1bb74b0

Browse files
committed
build: allow custom kubeconfig env var in hack script
1 parent 551c84a commit 1bb74b0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hack/check-operator-ready.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ func main() {
3535
var timeout int
3636
var kubeconfigPath string
3737

38-
defaultKubeconfigPath := filepath.Join(homedir.HomeDir(), ".kube", "config")
38+
defaultKubeconfigPath := os.Getenv("KUBECONFIG")
39+
if defaultKubeconfigPath == "" {
40+
defaultKubeconfigPath = filepath.Join(homedir.HomeDir(), ".kube", "config")
41+
}
3942

4043
pflag.IntVar(&timeout, "timeout", 300, "The timeout for the check.")
4144
pflag.StringVar(&kubeconfigPath, "kubeconfig-path", defaultKubeconfigPath, "Absolute path to the KubeconfigPath file")

0 commit comments

Comments
 (0)