remove unnessary confusion of dead values

This commit is contained in:
deads2k
2017-05-12 14:39:56 -04:00
parent e401dc7498
commit 75bd27a595
6 changed files with 5 additions and 34 deletions

View File

@@ -103,14 +103,8 @@ func (c *ClientCache) clientConfigForVersion(requiredVersion *schema.GroupVersio
if err != nil {
return nil, err
}
if requiredVersion == nil && config.GroupVersion != nil {
// if someone has set the values via flags, our config will have the groupVersion set
// that means it is required.
requiredVersion = config.GroupVersion
}
// required version may still be nil, since config.GroupVersion may have been nil. Do the check
// before looking up from the cache
// only lookup in the cache if the requiredVersion is set
if requiredVersion != nil {
if config, ok := c.configs[*requiredVersion]; ok {
return copyConfig(config), nil