Skip to content

Commit

Permalink
Call BuildConfigFromFlags unconditionally
Browse files Browse the repository at this point in the history
This is a follow-up to: bb53e90
  • Loading branch information
frobware committed May 28, 2019
1 parent 78c0563 commit 7e4b91f
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7e4b91f

Please sign in to comment.