Skip to content

Commit

Permalink
Refine error message if no out-of-cluster Kubernetes config provided
Browse files Browse the repository at this point in the history
  • Loading branch information
lippserd committed Sep 11, 2024
1 parent 1d7d092 commit 45bd064
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/icinga-kubernetes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ func main() {

kconfig, err := kclientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, &overrides).ClientConfig()
if err != nil {
if kclientcmd.IsEmptyConfig(err) {
klog.Fatal(
"no configuration provided: set KUBECONFIG environment variable or --kubeconfig CLI flag to" +
" a kubeconfig file with cluster access configured")
}

klog.Fatal(errors.Wrap(err, "can't configure Kubernetes client"))
}

Expand Down

0 comments on commit 45bd064

Please sign in to comment.