diff --git a/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_provider.go b/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_provider.go index 1722c053b855..d7db037c6862 100644 --- a/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_provider.go +++ b/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_provider.go @@ -136,11 +136,9 @@ func BuildClusterAPI(opts config.AutoscalingOptions, do cloudprovider.NodeGroupD var err error var config *rest.Config - if opts.KubeConfigPath != "" { - config, err = clientcmd.BuildConfigFromFlags("", opts.KubeConfigPath) - if err != nil { - klog.Fatalf("cannot build config: %v", err) - } + config, err = clientcmd.BuildConfigFromFlags("", opts.KubeConfigPath) + if err != nil { + klog.Fatalf("cannot build config: %v", err) } kubeclient, err := kubernetes.NewForConfig(config)