Merge pull request #32613 from madhusudancs/fed-clientcmd-bug-31947-fix
Automatic merge from submit-queue Fix clientcmd for a non-host cluster client running in a pod. This is based on @errordeveloper's PR #32438. It fixes a case where default config is invalid and original config, i.e. `mergedConfig` is empty. It also adds a test for the case where default config is invalid and original config is neither invalid nor empty. cc @errordeveloper @kubernetes/sig-cluster-federation @pwittrock @colhom
This commit is contained in:
@@ -114,8 +114,11 @@ func (config *DeferredLoadingClientConfig) ClientConfig() (*restclient.Config, e
|
||||
// "empty due to defaults"
|
||||
// TODO: this shouldn't be a global - the client config rules should be
|
||||
// handling this.
|
||||
defaultConfig, err := DefaultClientConfig.ClientConfig()
|
||||
if err == nil && !reflect.DeepEqual(mergedConfig, defaultConfig) {
|
||||
defaultConfig, defErr := DefaultClientConfig.ClientConfig()
|
||||
if IsConfigurationInvalid(defErr) && !IsEmptyConfig(err) {
|
||||
return mergedConfig, nil
|
||||
}
|
||||
if defErr == nil && !reflect.DeepEqual(mergedConfig, defaultConfig) {
|
||||
return mergedConfig, nil
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user