From 97715b76cecb097ac69994f09b10ff1b0edc3521 Mon Sep 17 00:00:00 2001 From: Andrew McDermott Date: Tue, 28 May 2019 15:50:51 +0100 Subject: [PATCH] Call BuildConfigFromFlags unconditionally This is a follow-up to: bb53e900b016e64566f8ee302e67560e563c067c --- .../cloudprovider/clusterapi/clusterapi_provider.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_provider.go b/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_provider.go index 1722c053b85..d7db037c686 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)