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

allow keeping secret name as defined in user spec #137

Merged
merged 3 commits into from
Nov 15, 2023

Conversation

reddec
Copy link
Contributor

@reddec reddec commented Nov 7, 2023

Allow keeping secret name as defined in user spec while keeping current behavior by-default (ie: backward compatible).

PR adds new boolean environment variable KEEP_SECRET_NAME (disabled by default) which instructs operator create secret with name exactly as defined in PostgresUserSpec.

The main motivation is to increase transparency for operations team: understand which secret will be created without having deep knowledge of the operator code (principle of least surprise).

This is "opt-in" flag and doesn't require any configuration change for existing users to keep current behavior.

@reddec
Copy link
Contributor Author

reddec commented Nov 7, 2023

@hitman99 summoning you! 🪄

@hitman99
Copy link
Member

Will review this on monday

@hitman99
Copy link
Member

hitman99 commented Nov 13, 2023

This flag should come with a note of caution. The current logic prevents operator from entering endless reconcile loop as secret is very unlikely to exist. Your change increases a change that specified secret already exists by a lot. It's very easy to copy-paste two CRs and forget to change theSecretName to something different. If the secret already exists, the operator will never stop reconciling the CR until either offending secret is deleted or CR is deleted or updated with another SecretName

@reddec
Copy link
Contributor Author

reddec commented Nov 14, 2023

With KEEP_SECRET_NAME the operator (administrator/devops) at least can see the result secret name. It's not trivial (without reading docs) to understand after manifests quick scan that secret actually will NOT be a secretName but db-<secretName>.

Anyway, I added details in doc. @hitman99

@hitman99 hitman99 merged commit 3c2516d into movetokube:master Nov 15, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants