upbound / up

The @upbound CLI
Apache License 2.0
52 stars 41 forks source link

Space: improve destroy command #362

Closed darkmuggle closed 1 year ago

darkmuggle commented 1 year ago

Description of your changes

For Spaces destroy command:

I have:

How has this code been tested

Tested against v0.15.1 with Spaces


******************** DESTRUCTIVE COMMAND ********************
****************** DATA-DESTRUCTION WARNING *****************

 WARNING  Destroying Spaces is a destructive command that will destroy data and oprhan resources.
 WARNING  Before proceeding ensure that Managed Resources in Control Planes have been deleted.
 WARNING  All Spaces components including Control Planes will be destroyed.

To proceed, type: "DESTROY CONFIRMED": DESTROY CONFIRMED
tnthornton commented 1 year ago

Do we want to pipe in allowing them to orphan their resources?

darkmuggle commented 1 year ago

Do we want to pipe in allowing them to orphan their resources?

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 up space destroy --orphan and then up space init things start working again.

darkmuggle commented 1 year ago

@tnthornton @branden if the last drop looks good, go ahead and merge.