mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-03 03:38:15 +00:00
Make kubectl factory build clients for version
Fix ClientConfigForVersion to actually use provided version.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user