switch kubeconfig types to internal map[string]*struct

This commit is contained in:
deads2k
2015-06-29 14:39:48 -04:00
parent 33278e7910
commit 55f574c267
17 changed files with 181 additions and 190 deletions

View File

@@ -43,10 +43,10 @@ func MinifyConfig(config *Config) error {
return fmt.Errorf("cannot locate context %v", config.CurrentContext)
}
newContexts := map[string]Context{}
newContexts := map[string]*Context{}
newContexts[config.CurrentContext] = currContext
newClusters := map[string]Cluster{}
newClusters := map[string]*Cluster{}
if len(currContext.Cluster) > 0 {
if _, exists := config.Clusters[currContext.Cluster]; !exists {
return fmt.Errorf("cannot locate cluster %v", currContext.Cluster)
@@ -55,7 +55,7 @@ func MinifyConfig(config *Config) error {
newClusters[currContext.Cluster] = config.Clusters[currContext.Cluster]
}
newAuthInfos := map[string]AuthInfo{}
newAuthInfos := map[string]*AuthInfo{}
if len(currContext.AuthInfo) > 0 {
if _, exists := config.AuthInfos[currContext.AuthInfo]; !exists {
return fmt.Errorf("cannot locate user %v", currContext.AuthInfo)