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

feat: [sc-117029] Add keep annotation to KOTS #5037

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

nvanthao
Copy link
Member

Story details: https://app.shortcut.com/replicated/story/117029
Demo: https://www.loom.com/share/3a33f7af9a4b4df39c2ff309aaa99f48?sid=a032f5d3-16e0-4e8a-aac9-655bacc3bfff

Changes

  • implement new annotation kots.io/keep: "true" for KOTS to skip deleting the manifest if the annotation present in non-Helm install
  • misc update in KOTS debug setup. I run DEBUG_KOTSADM=1 make debug to debug the code changes.

@nvanthao nvanthao added the type::feature New feature or request label Dec 10, 2024
@nvanthao nvanthao force-pushed the gerard/sc-117029/keep-annotation branch from e54e660 to e5e5969 Compare December 10, 2024 01:33
// if this is a keep resource, don't delete it
// e.g. for migration to Helm v1beta2
if keep, ok := o.Metadata.Annotations["kots.io/keep"]; ok && keep == "true" {
logger.Infof("skipping deletion of resource %s/%s", o.Kind, o.Metadata.Name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to mention the reason in the log message as well

Suggested change
logger.Infof("skipping deletion of resource %s/%s", o.Kind, o.Metadata.Name)
logger.Infof("skipping deletion of resource %s/%s because kots.io/keep annotation is set", o.Kind, o.Metadata.Name)

@sgalsaleh sgalsaleh merged commit 53df28f into main Dec 10, 2024
122 checks passed
@sgalsaleh sgalsaleh deleted the gerard/sc-117029/keep-annotation branch December 10, 2024 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants