mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
Do not return original config, i.e. mergeConfig, when it is empty and default config is invalid.
This commit is contained in:
parent
a96bd93c0f
commit
0433fe0d72
@ -112,11 +112,11 @@ func (config *DeferredLoadingClientConfig) ClientConfig() (*restclient.Config, e
|
|||||||
// "empty due to defaults"
|
// "empty due to defaults"
|
||||||
// TODO: this shouldn't be a global - the client config rules should be
|
// TODO: this shouldn't be a global - the client config rules should be
|
||||||
// handling this.
|
// handling this.
|
||||||
defaultConfig, err := DefaultClientConfig.ClientConfig()
|
defaultConfig, defErr := DefaultClientConfig.ClientConfig()
|
||||||
if IsConfigurationInvalid(err) {
|
if IsConfigurationInvalid(defErr) && !IsEmptyConfig(err) {
|
||||||
return mergedConfig, nil
|
return mergedConfig, nil
|
||||||
}
|
}
|
||||||
if err == nil && !reflect.DeepEqual(mergedConfig, defaultConfig) {
|
if defErr == nil && !reflect.DeepEqual(mergedConfig, defaultConfig) {
|
||||||
return mergedConfig, nil
|
return mergedConfig, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user