Skip to content

Commit

Permalink
Add unique error message for when in-cluster config is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Duke0404 committed Aug 12, 2024
1 parent ee6d4f9 commit ed38cbb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cluster-autoscaler/utils/kubernetes/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
failedToBuildConfigErr = "Failed to build config"
failedToParseK8sUrlErr = "Failed to parse Kubernetes url"
failedToBuildClientConfigErr = "Failed to build Kubernetes client configuration"
failedToFindInClusterConfigErr = "Failed to find in-cluster config"
)

// CreateKubeClient creates kube client based on AutoscalingOptions.KubeClientOptions
Expand Down Expand Up @@ -63,7 +64,7 @@ func GetKubeConfig(opts config.KubeClientOptions) *rest.Config {
} else {
kubeConfig, err = rest.InClusterConfig()
if err != nil {
klog.Fatalf("%v: %v", failedToBuildConfigErr, err)
klog.Fatalf("%v: %v", failedToFindInClusterConfigErr, err)
}
}
kubeConfig.QPS = opts.KubeClientQPS
Expand Down

0 comments on commit ed38cbb

Please sign in to comment.