Skip to content

cmd/catalog: Default to the $KUBECONFIG environment variable when building client configs #2303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/catalog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const (
// config flags defined globally so that they appear on the test binary as well
var (
kubeConfigPath = flag.String(
"kubeconfig", "", "absolute path to the kubeconfig file")
"kubeconfig", os.Getenv("KUBECONFIG"), "absolute path to the kubeconfig file")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When providing the value through the CLI flag, that value still takes precedence over the local $KUBECONFIG environment variable, which seems like the correct behavior. Might be worth calling out that behavior in this flags description?


wakeupInterval = flag.Duration(
"interval", defaultWakeupInterval, "wakeup interval")
Expand Down