fix: preserve generated secrets across helm upgrades#25
Open
bicisteadm wants to merge 1 commit intodreamcommerce:mainfrom
Open
fix: preserve generated secrets across helm upgrades#25bicisteadm wants to merge 1 commit intodreamcommerce:mainfrom
bicisteadm wants to merge 1 commit intodreamcommerce:mainfrom
Conversation
Use lookup to check if the Secret already exists before generating new random passwords. Without this, every helm upgrade regenerates the mysql-pass and mysql-root-pass values, breaking database connectivity since MySQL retains the original password in its persistent volume.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #24
Summary
Use lookup to check if the Secret already exists before generating new random passwords
Only generate new passwords on first install, reuse existing values on upgrade
Increases default password length from 10 to 16 characters
Problem
Every helm upgrade regenerated the MySQL passwords in the Secret, but MySQL retained the original password in its persistent volume, causing Access denied errors.
Test plan
Fresh helm install — verify Secret is created and DB connects
helm upgrade — verify Secret retains original passwords and DB still connects
helm uninstall + helm install (without deleting Secret) — verify existing Secret is reused