Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't fail when OpenStack config contains unknown directives #109709

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion staging/src/k8s.io/legacy-cloud-providers/openstack/openstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down