Return error if kube client can't be initialized
@@ -202,7 +202,7 @@ func createKubeClient(flags *flag.FlagSet, inCluster bool) (kube_client.Interfac
config, err = clientConfig.ClientConfig()
}
if err != nil {
- fmt.Errorf("error connecting to the client: %v", err)
+ return nil, fmt.Errorf("error connecting to the client: %v", err)
}
config.ContentType = *contentType
return kube_client.NewForConfigOrDie(config), nil
