-
Notifications
You must be signed in to change notification settings - Fork 61
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
K8SPG-712: Allow overriding default configurations #1108
Conversation
"# Generated by postgres-operator. DO NOT EDIT.\n" + | ||
"# Your changes will not be saved.\n" | ||
"# Generated by postgres-operator. DO NOT EDIT UNLESS YOU KNOW WHAT YOU'RE DOING.\n" + | ||
"# If you want to override the config, annotate this ConfigMap with " + naming.OverrideConfigAnnotation + "=true\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂 🎻
// OverrideConfigAnnotation is an annotation used to prevent the controller from reconciling | ||
// ConfigMaps when a user wants to manually override their contents. When this annotation | ||
// is present, the controller will not update the ConfigMap, allowing users to make custom | ||
// modifications that won't be overwritten during reconciliation. | ||
OverrideConfigAnnotation = perconaAnnotationPrefix + "override-config" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mention the ticket here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -504,9 +507,22 @@ func (r *Reconciler) SetupWithManager(mgr manager.Manager) error { | |||
} | |||
} | |||
|
|||
// K8SPG-712: Allow overriding default configurations | |||
configMapPredicate := builder.WithPredicates(predicate.Funcs{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can cover this in our controller tests if it is not a major change for the controller_test.go file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@egegunes please check unit tests
CHANGE DESCRIPTION
Our support team wants to have the ability to change all Patroni configuration options. For this we're introducing an annotation (
pgv2.percona.com/override-config
) that if a ConfigMap has it, operator won't reconcile the ConfigMap. So you can annotate the ConfigMap and change any values in it. Beware that there's a sync period (~1m) after changing the ConfigMap and your changes to be reflected to file mounted to the container.CHECKLIST
Jira
Needs Doc
) and QA (Needs QA
)?Tests
Config/Logging/Testability