File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,9 @@ Example:
120120 app .Version (version + "\n build time: " + buildstamp + "\n Git ref: " + githash )
121121 app .DefaultEnvars ()
122122
123+ // initialize Masters map to avoid nil map assignment
124+ cfg .Masters = make (map [string ]string )
125+
123126 // Flags related to Kubernetes
124127 app .Flag ("master" , "The Kubernetes API server to connect to (default: auto-detect)" ).Default ("" ).StringMapVar (& cfg .Masters )
125128 app .Flag ("kubeconfig" , "Retrieve target cluster configuration from a Kubernetes configuration file (default: auto-detect)" ).Default (defaultConfig .KubeConfig ).StringVar (& cfg .KubeConfig )
@@ -199,7 +202,7 @@ func newKubeClients(cfg *Config) map[string]kubernetes.Interface {
199202 kubeconfig = clientcmd .RecommendedHomeFile
200203 }
201204 log .Debugf ("use config file %s" , kubeconfig )
202- var clients map [string ]kubernetes.Interface
205+ clients := map [string ]kubernetes.Interface {}
203206 for cluster , master := range cfg .Masters {
204207 clients [cluster ] = newKubeClient (cfg , master , kubeconfig )
205208 }
You can’t perform that action at this time.
0 commit comments