-
Notifications
You must be signed in to change notification settings - Fork 42
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
Space: improve destroy command #362
Conversation
cmd/up/space/destroy.go
Outdated
|
||
commonParams | ||
|
||
Confirmed bool `name:"yes-really-delete-spaces-and-all-data" type:"bool" help:"Bypass safety checks and destroy Spaces"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I love it, but it probably should be singular -- space instead of spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users might also accept force
:-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally like force
since it follows other conventions 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I like force
and it does follow other conventions, I wanted to make people think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left nits, but it looks good to me.
Do we want to pipe in allowing them to orphan their resources? |
if err := c.mgr.Uninstall(); err != nil { | ||
return err | ||
} | ||
return c.kClient.CoreV1().Namespaces().Delete(context.Background(), nsUpboundSystem, v1.DeleteOptions{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would delete the crossplane and upbound-pull-secret that we ask users to create before deploying. Is that OK? I could at least see it making testing more tedious. Maybe we could introduce a flag to skip deleting the namespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the latest push -- we only delete the namespace if there are no orphans.
Yeah, implemented in the last push. The way I did it was to run not execute any hooks when orphan is set. The other way would be to upgrade and set the deletionPolicy, however that doesn't work with out a token file; it seemed crazy to require a token file to remove something. Since the delete is part of a hook, disabling the hook accomplished the same goal. If you |
@tnthornton @branden if the last drop looks good, go ahead and merge. |
Description of your changes
For Spaces destroy command:
upbound-system
namespace on destroyI have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR, as appropriate.How has this code been tested
Tested against v0.15.1 with Spaces