Repository navigation
fix(tiller): respect resource policy on upgrade - #5225
Merged
bacongobbler merged 1 commit intoJan 29, 2019
Merged
Conversation
Don't delete a resource on upgrade if it is annotated with helm.io/resource-policy=keep. This can cause data loss for users if the annotation is ignored (e.g. for a PVC). Closes helm#3673 Signed-off-by: James Ravn <[email protected]>
jsravn
force-pushed
the
respect-resource-policy-on-upgrade
branch
from
January 29, 2019 13:58
3470f4f to
7757ebf
Compare
bacongobbler
approved these changes
Jan 29, 2019
bacongobbler
left a comment
Member
There was a problem hiding this comment.
Makes sense to me. Thanks for the unit test to cover this change as well as the general package sanitation. LGTM!
2 of 3 tasks
eraac
pushed a commit
to eraac/helm
that referenced
this pull request
Mar 21, 2019
Don't delete a resource on upgrade if it is annotated with helm.io/resource-policy=keep. This can cause data loss for users if the annotation is ignored (e.g. for a PVC). Closes helm#3673 Signed-off-by: James Ravn <[email protected]> Signed-off-by: Kevin Labesse <[email protected]>
Closed
3 tasks
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 this PR does / why we need it:
Don't delete a resource on upgrade if it is annotated with
helm.io/resource-policy=keep. This can cause data loss for users if the
annotation is ignored (e.g. for a PVC).
Use case:
helm.io/resource-policy=keepto ensure helm never removes them.Unfortunately, in the current implementation, this annotation only works when
helm deleteis run. If the resource is removed from the chart or renamed, helm will ignore the annotation and delete it on a chart upgrade. This is easy to do accidentally. I believe this annotation should apply in any situation where helm might delete the resource, including on upgrades.Closes #3673
Special notes for your reviewer:
I don't think this will cause backwards compatibility problems. It might be surprising new behavior though if someone is relying on upgrades/resource renames to delete things with
helm.io/resource-policy=keepon them (but that seems pretty strange!). An alternative approach would be to add a new resource policy, likealways-keep.If applicable: