Fix mispelled key name in kubeconfig 07/113707/1
authorIgor D.C <igor.duarte.cardoso@intel.com>
Thu, 8 Oct 2020 23:50:55 +0000 (23:50 +0000)
committerIgor D.C <igor.duarte.cardoso@intel.com>
Thu, 8 Oct 2020 23:55:37 +0000 (23:55 +0000)
Fixes the mispelled "currentcontext" with the right key name
"current-context" which was introduced as a regression with or
before the latest version of the kubeconfig code (probably a bad
search/replace).

This 1-character long bug was preventing the generated kubeconfigs
from being correctly interpreted by kubectl. Thus, kubectl couldn't
set any context of the kubeconfig as the current context.

Observable output before this fix:
$ kubectl get pods
The connection to the server localhost:8080 was refused - did you
specify the right host or port?

Issue-ID: MULTICLOUD-1143
Change-Id: I617d1e20b7be2567729b84d3746b22e4ceaf8b9d
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
src/dcm/pkg/module/cluster.go

index 33de7ac..9aecc6c 100644 (file)
@@ -59,7 +59,7 @@ type KubeConfig struct {
        Kind           string            `yaml:"kind"`
        Clusters       []KubeCluster     `yaml:"clusters"`
        Contexts       []KubeContext     `yaml:"contexts"`
-       CurrentContext string            `yaml:"current-context`
+       CurrentContext string            `yaml:"current-context"`
        Preferences    map[string]string `yaml:"preferences"`
        Users          []KubeUser        `yaml:"users"`
 }