Skip to content

enh: (helm) - add annotation to wait for all resources to be deleted before removing CR finalizer#4487

Merged
estroz merged 3 commits intooperator-framework:masterfrom
mikeshng:enh-helm-uninstall
Apr 12, 2021
Merged

enh: (helm) - add annotation to wait for all resources to be deleted before removing CR finalizer#4487
estroz merged 3 commits intooperator-framework:masterfrom
mikeshng:enh-helm-uninstall

Conversation

@mikeshng
Copy link
Copy Markdown
Contributor

@mikeshng mikeshng commented Feb 4, 2021

Signed-off-by: Mike Ng ming@redhat.com

Description of the change:
For Helm based-operators, added annotation helm.sdk.operatorframework.io/uninstall-wait: "true" option to allow all resources to be deleted before removing the custom resource's finalizer.

Motivation for the change:
Closes #4401

Checklist

If the pull request includes user-facing changes, extra documentation is required:

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 7, 2021
…before removing finalizer

Signed-off-by: Mike Ng <ming@redhat.com>
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 9, 2021
For Helm based-operators, added annotation `helm.sdk.operatorframework.io/uninstall-wait: "true"`
to allow all resources to be deleted before removing the custom resource's finalizer.
kind: "addition"
breaking: false No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit : space at the end of the file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Done as suggested.

Comment thread internal/helm/controller/reconcile.go Outdated
_ = r.updateResourceStatus(ctx, o, status)
return reconcile.Result{}, err
}
if !areAllResDeleted {
Copy link
Copy Markdown
Contributor

@camilamacedo86 camilamacedo86 Mar 3, 2021

Choose a reason for hiding this comment

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

Suggested change
if !areAllResDeleted {
if !isAllResourcesDeleted {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Done as suggested.

Copy link
Copy Markdown
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

This PR is very completed. It is a great work has docs, changelogs and tests 🥇
I am ok with the change. Just added a nit suggestion.

However, would be nice check with @joelanford or any other team member before we add this one.
Otherwise /lgtm

status.RemoveCondition(types.ConditionReleaseFailed)
}

log.Info("Removing finalizer")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@mikeshng mikeshng temporarily deployed to deploy March 9, 2021 14:34 Inactive
@mikeshng mikeshng temporarily deployed to deploy March 9, 2021 14:34 Inactive
@mikeshng mikeshng temporarily deployed to deploy March 9, 2021 14:34 Inactive
@mikeshng mikeshng temporarily deployed to deploy March 9, 2021 14:34 Inactive
@mikeshng mikeshng temporarily deployed to deploy March 9, 2021 14:34 Inactive
@mikeshng mikeshng temporarily deployed to deploy March 9, 2021 14:34 Inactive
@estroz estroz self-assigned this Apr 5, 2021
Comment thread internal/helm/release/manager.go
Comment thread internal/helm/release/manager.go Outdated
Copy link
Copy Markdown
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

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

Overall LGTM, just one potential bugfix

Comment thread internal/helm/release/manager.go
Comment thread internal/helm/release/manager.go Outdated
Comment thread internal/helm/release/manager.go Outdated
…ction

Signed-off-by: Mike Ng <ming@redhat.com>
Copy link
Copy Markdown
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

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

Thanks @mikeshng!

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 12, 2021
@estroz estroz merged commit 45273ba into operator-framework:master Apr 12, 2021
@mikeshng mikeshng deleted the enh-helm-uninstall branch April 14, 2021 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Helm operator feature request: for CR delete, add option to wait until all resources are deleted before removing the finalizer

4 participants