Merge pull request #109709 from shiftstack/nonfatal_openstack_config_k8s

Don't fail when OpenStack config contains unknown directives
This commit is contained in:
Kubernetes Prow Robot 2022-06-03 09:30:59 -07:00 committed by GitHub
commit b578d61606
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 != "" {