mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #109709 from shiftstack/nonfatal_openstack_config_k8s
Don't fail when OpenStack config contains unknown directives
This commit is contained in:
commit
b578d61606
@ -330,7 +330,19 @@ func readConfig(config io.Reader) (Config, error) {
|
||||
|
||||
err := gcfg.ReadInto(&cfg, config)
|
||||
if err != nil {
|
||||
return cfg, err
|
||||
// Warn instead of failing on non-fatal config parsing errors.
|
||||
// This is important during the transition to external CCM we
|
||||
// may be sharing user-managed configuration KCM, using legacy
|
||||
// cloud provider, and CCM using external cloud provider.
|
||||
// We do not want to prevent KCM from starting if the user adds
|
||||
// new configuration which is only present in OpenStack CCM.
|
||||
if gcfg.FatalOnly(err) == nil {
|
||||
klog.Warningf("Non-fatal error parsing OpenStack cloud config. "+
|
||||
"This may happen when passing config directives exclusive to OpenStack CCM to the legacy cloud provider. "+
|
||||
"Legacy cloud provider has correctly parsed all directives it knows about: %s", err)
|
||||
} else {
|
||||
return cfg, err
|
||||
}
|
||||
}
|
||||
|
||||
if cfg.Global.SecretName != "" && cfg.Global.SecretNamespace != "" {
|
||||
|
Loading…
Reference in New Issue
Block a user