operator-framework / kubectl-operator

Manage Kubernetes Operators from the command line
https://operatorframework.io/
Apache License 2.0
128 stars 37 forks source link

Uninstall improvements #55

Closed joelanford closed 2 years ago

joelanford commented 3 years ago

This PR adds flags and functionality for deleting more operator-related objects

It also simplifies the operand.DeletionStrategy type to be a string instead of a struct.

Lastly, it adds a specific error for CancelStrategyError to decouple the uninstall CLI from the uninstall action. This enables moving CLI-specific logging to the CLI layer.


We can probably debate the UX for the re-added deletion flags, but ever since we've removed --delete-all on the main branch, I've found myself rebuilding from the v0.3.0 tag so I could keep using it.

The frequency that I personally do kubectl operator install, run a few tests, and then do kubectl operator uninstall -X tells me that it is a very useful option to have, and I think that merits adding it back in, at least until we come up with an alternative that maintains a simple install, test, wipe clean type of workflow.

openshift-ci[bot] commented 3 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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: - ~~[OWNERS](https://github.com/operator-framework/kubectl-operator/blob/main/OWNERS)~~ [joelanford] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
joelanford commented 3 years ago

Is there something I'm forgetting about why a full wipe of an operator is something we can't/shouldn't support? The one thing that comes to mind for me is that it could leave other operators that depend on this one in a broken state, but it seems like that's already possible with --operand-strategy=delete.

estroz commented 2 years ago

/lgtm