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: operator uninstall with operands #45

Merged

Conversation

exdx
Copy link
Member

@exdx exdx commented Apr 19, 2021

Signed-off-by: Daniel Sover dsover@redhat.com

Closes #39

Removes the subscription, optionally the operatorgroup, and the CSV and operands (if the CSV is found on cluster). The Operator object associated with the CSV will remain on-cluster if there are any CRDs still on-cluster after uninstall runs, since it does not remove CRDs currently.

@exdx exdx force-pushed the feat/operand-delete branch 2 times, most recently from 67e2991 to 224985e Compare April 21, 2021 19:45
@exdx
Copy link
Member Author

exdx commented Apr 21, 2021

Thanks for the review. Looks a lot better but I'm still concerned about the 2nd issue I brought up originally...how do we reconcile the fact that kubectl operator uninstall leaves the Operator object associated with the CSV on-cluster if the operator installs CRDs (which are labelled and adopted by the Operator object automatically via its controller)

@exdx
Copy link
Member Author

exdx commented Apr 21, 2021

I'm not sure there's a great solution, but it seems problematic to the UX

@exdx exdx requested a review from joelanford April 21, 2021 19:54
@joelanford
Copy link
Member

how do we reconcile the fact that kubectl operator uninstall leaves the Operator object associated with the CSV on-cluster if the operator installs CRDs

In my opinion, I think its okay to leave the Operator object in place on-cluster as a breadcrumb for finding CRDs. If I remember correctly, kubectl operator uninstall does not currently delete the Operator object, so this PR would not revert that aspect of the existing functionality.

In follow-on issues we could cover CRD and Operator deletion strategies as separate concerns.

@exdx
Copy link
Member Author

exdx commented Apr 21, 2021

how do we reconcile the fact that kubectl operator uninstall leaves the Operator object associated with the CSV on-cluster if the operator installs CRDs

In my opinion, I think its okay to leave the Operator object in place on-cluster as a breadcrumb for finding CRDs. If I remember correctly, kubectl operator uninstall does not currently delete the Operator object, so this PR would not revert that aspect of the existing functionality.

In follow-on issues we could cover CRD and Operator deletion strategies as separate concerns.

SGTM

Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

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

Looking great. Pretty much down to nits around consistent log style, and one suggestion to reduce duplication.

internal/pkg/action/operator_uninstall.go Outdated Show resolved Hide resolved
internal/pkg/action/operator_uninstall.go Outdated Show resolved Hide resolved
internal/pkg/action/operator_uninstall.go Outdated Show resolved Hide resolved
internal/pkg/action/operator_uninstall.go Outdated Show resolved Hide resolved
internal/pkg/action/operator_uninstall.go Outdated Show resolved Hide resolved
internal/pkg/action/operator_uninstall.go Show resolved Hide resolved
Copy link
Contributor

@timflannagan timflannagan left a comment

Choose a reason for hiding this comment

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

Just a quick drive-by while checking if tide had been rolled out yet.

internal/cmd/operator_uninstall.go Outdated Show resolved Hide resolved
internal/cmd/operator_uninstall.go Outdated Show resolved Hide resolved
@exdx exdx requested a review from benluddy April 27, 2021 21:03
internal/cmd/operator_uninstall.go Outdated Show resolved Hide resolved
internal/pkg/action/operator_uninstall.go Outdated Show resolved Hide resolved
internal/pkg/action/operator_uninstall_test.go Outdated Show resolved Hide resolved
@exdx
Copy link
Member Author

exdx commented Apr 28, 2021

squashed commits

@exdx exdx requested a review from joelanford April 28, 2021 21:05
Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

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

My final couple of comments. After this I'll be ready to merge.

internal/pkg/action/operator_uninstall.go Outdated Show resolved Hide resolved
internal/cmd/operator_uninstall.go Outdated Show resolved Hide resolved
Signed-off-by: Daniel Sover <dsover@redhat.com>
@joelanford
Copy link
Member

/approve

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: exdx, joelanford

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 29, 2021
@benluddy
Copy link

benluddy commented May 3, 2021

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFE] Delete operator and operands safely in one command
6 participants