fix(chart): make aif-ui-config survive helm uninstall - #219
Closed
leomiraanda wants to merge 1 commit into
Closed
Conversation
syncUIConfigMap's own doc comment already claimed the ConfigMap "is intentionally not deleted when the CR is removed", but nothing enforced that: configmap.yaml had no helm.sh/resource-policy: keep, so a plain helm uninstall (including the operator's own finalizer path) deleted it along with the rest of the release, silently losing any custom operator-connection/catalog settings on a reinstall. Adding the resource-policy annotation makes the ConfigMap survive uninstall with its ownership labels/annotations intact, so a same-identity reinstall adopts it with zero conflict and zero manual intervention — verified live end-to-end (uninstall -> reinstall keeps the exact same object, no ownership error). If the release identity changes instead (different release name), Helm's ownership check still correctly rejects the mismatch; that case is handled by the aif-operator's own pre-install adoption step (SUSEAI-1039, PR #218), not by this chart.
Contributor
Author
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.
Summary
Follow-up to #218 (SUSEAI-1039). While fixing the ownership-adoption bug, found a doc/behavior mismatch:
syncUIConfigMap's own comment claimsaif-ui-config"is intentionally not deleted when the CR is removed," but nothing actually enforced that —charts/aif-ui/templates/configmap.yamlhad nohelm.sh/resource-policy: keep, so a plainhelm uninstall(including the operator's own finalizer path) deleted it along with everything else in the release, silently losing any custom operator-connection/catalog settings on reinstall.Fix
Add
helm.sh/resource-policy: keepto the ConfigMap. Helm's own uninstall logic then skips deleting it, leaving its existing ownership labels/annotations intact — so a same-identity reinstall adopts it automatically with zero conflict, no adoption step needed at all for that path.If the release name changes instead, Helm's ownership check still (correctly) rejects the mismatch — that case is what #218's
adoptUIConfigMaphandles, not this chart change. The two fixes are complementary, not overlapping: this one closes the common "uninstall/reinstall under the same name" path outright; #218 covers the cases where the ConfigMap's identity doesn't already match (self-heal, UI-created, or release renamed).Testing
Live-verified end-to-end on a real cluster:
helm.sh/resource-policy: keep+ correct ownership stamps.helm uninstall→ Helm explicitly reportsThese resources were kept due to the resource policy: [ConfigMap] aif-ui-config; Deployment/Service fully removed, CM'suid/resourceVersionunchanged (same object, not deleted+recreated).helm install(same release name) → adopts with zero conflict,uid/resourceVersionstill identical throughout the whole cycle.helm installunder a different release name against the surviving CM → correctly fails the ownership check on the mismatchedmeta.helm.sh/release-name, confirming the boundary with fix(operator,chart): adopt pre-existing aif-ui-config ConfigMap into Helm ownership #218's fix is exactly where intended.Test plan
helm lint/helm templatecleango build,go vet,gofmtclean (comment-only operator change)