Repository navigation
fix(mail): depend on upstream mail 5.1.0 and stop the per-render restart - #479
Merged
Merged
Conversation
argocd-helm-charts/mail held a copy of the upstream bokysan/docker-postfix chart with no dependency entry, so the chart updater never touched it. Its appVersion was the placeholder v1.0.0, which the chart uses as the image tag, so clusters ran boky/postfix:v1.0.0 from January 2019. Depend on the upstream chart repository at 5.1.0 instead, so the updater follows its releases. This moves the relay to boky/postfix:v5.1.0. Also default mail.recreateOnRedeploy to false. Upstream's true stamps date/deploy-date: <now> into the pod template. Under Argo CD every render then differs, so the app never syncs and each sync restarts the relay. The chart's checksum/configmap annotation still restarts it on config changes.
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 38895005 | Triggered | AWS SES Keys | 43c736c | argocd-helm-charts/mail/charts/mail/README.md | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
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.
What
argocd-helm-charts/mailis now a real wrapper. It depends on the upstream chart repository (https://bokysan.github.io/docker-postfix/, chartmail5.1.0) instead of holding a copy, so the chart updater follows upstream releases.Chart.lockis added and the subchart is vendored unpacked, as for the other wrappers.mail.recreateOnRedeploy: false.Why
dependencies:entry, so the updater skipped it. ItsappVersionwas the placeholderv1.0.0, which the chart uses as the image tag, so every cluster on it runsboky/postfix:v1.0.0, released January 2019. On a production cluster Trivy reports 3 Critical and 13 High fixable CVEs in it, and an end-of-life base hides more.recreateOnRedeploy: true(upstream's default) fights Argo CD. It stampsdate/deploy-date: {{ now }}into the pod template, so every render differs from the live object. The app is permanently OutOfSync, and every sync restarts the relay. The chart'schecksum/configmapannotation already restarts the pod when the configuration changes, so nothing is lost by turning it off.What changes on a cluster
I rendered two production clusters' values with the old copy and with this chart.
boky/postfix:v1.0.0boky/postfix:v5.1.0(base moves from Alpine to Debian slim, upstream v4)selector,serviceNamevolumeClaimTemplatesapiVersion/kind, which the API server already stores, so there's no immutable-field change.mailmail, plus a newmail-headlessdate/deploy-datencagainst port 587/scripts/healthcheck.sh, which ships in the v5 imagepostfix-scriptandopendkim. Without DKIM keys, the image'sopendkim.sh(v5.1.0) runs a sleep loop, so the check still passes./var/spool/postfixspool/subdirectoryQueue on the switch: the old pod's
preStophook flushes the queue before it stops, so the queue moves cleanly when the relay host is reachable. Mail still deferred at that moment stays at the PVC root, unread by the new pod. Sync while the upstream relay is healthy.Upgrade notes
targetRevision. Until then, a cluster can setmail.recreateOnRedeploy: falsein its own values to stop the permanent diff.Testing
helm dependency update, then the subchart unpacked like the updater does. No tarball is committed (*.tgzis gitignored).helm lint argocd-helm-charts/mail: passes.helm templatewith two production clusters' values, old copy against 5.1.0: the results are as in the table above.boky/postfix:v5.1.0exists on Docker Hub, and readscripts/opendkim.shandconfigs/supervisord.confat thev5.1.0tag to confirm the opendkim behaviour.