Make kubectl factory build clients for version

Fix ClientConfigForVersion to actually use provided version.
This commit is contained in:
Jeff Lowdermilk
2015-01-29 13:31:22 -08:00
parent 919b2d20e0
commit 93ef8b8bcb
2 changed files with 29 additions and 2 deletions

View File

@@ -329,17 +329,19 @@ func (c *clientCache) ClientConfigForVersion(version string) (*client.Config, er
return nil, err
}
c.defaultConfig = config
if c.matchVersion {
if err := client.MatchesServerVersion(config); err != nil {
return nil, err
}
}
}
// TODO: have a better config copy method
config := *c.defaultConfig
if len(version) != 0 {
config.Version = version
}
client.SetKubernetesDefaults(&config)
return &config, nil
}