destroy-controller should prompt for --destroy-all-models and storage options
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Low
|
Unassigned |
Bug Description
When running juju destroy-controller on a system with live models, Juju aborts after taking users to a prompt. It should either abort immediately or continue the interactive session.
Example:
juju destroy-controller c-2
WARNING! This command will destroy the "c-2" controller.
This includes all machines, applications, data and other resources.
Continue? (y/N):y
Destroying controller
ERROR cannot destroy controller "c-2"
The controller has live hosted models. If you want
to destroy all hosted models in the controller,
run this command again with the --destroy-
option.
Models:
admin/default (alive), 2 machines, 1 application
admin/misc (alive), 4 machines, 1 application
Here is a possible alternative:
juju destroy-controller c-2
WARNING! This command will destroy the "c-2" controller.
This includes all machines, applications, data and other resources.
Continue? (y/N):y
Destroying controller
ERROR cannot destroy controller "c-2"
The controller has live hosted models. Do you want
to destroy all hosted models? Skip this step by
running this command again with the --destroy-
option.
Models:
admin/default (alive), 2 machines, 1 application
admin/misc (alive), 4 machines, 1 application
Destroy all models? (y/N):y
A similar stanza could be made for storage:
Destroy storage? (destroy/
I'd prefer it just fails fast and says if you still want to do this rerun all-models vs waiting until after the "Are you
the command with --destroy-
sure" to check if it can/will do it.
In this way we don't need extra interactive bits to the command.
On Mon, May 20, 2019 at 6:45 PM Tim McNamara <email address hidden>
wrote:
> Public bug reported: all-models all-models release/ Abort) /bugs.launchpad .net/bugs/ 1829797 all-models and storage /bugs.launchpad .net/juju/ +bug/1829797/ +subscriptions
>
> When running juju destroy-controller on a system with live models, Juju
> aborts after taking users to a prompt. It should either abort
> immediately or continue the interactive session.
>
>
> Example:
>
> juju destroy-controller c-2
> WARNING! This command will destroy the "c-2" controller.
> This includes all machines, applications, data and other resources.
>
> Continue? (y/N):y
> Destroying controller
> ERROR cannot destroy controller "c-2"
>
> The controller has live hosted models. If you want
> to destroy all hosted models in the controller,
> run this command again with the --destroy-
> option.
>
> Models:
> admin/default (alive), 2 machines, 1 application
> admin/misc (alive), 4 machines, 1 application
>
>
> Here is a possible alternative:
>
>
> juju destroy-controller c-2
> WARNING! This command will destroy the "c-2" controller.
> This includes all machines, applications, data and other resources.
>
> Continue? (y/N):y
> Destroying controller
> ERROR cannot destroy controller "c-2"
>
> The controller has live hosted models. Do you want
> to destroy all hosted models? Skip this step by
> running this command again with the --destroy-
> option.
>
> Models:
> admin/default (alive), 2 machines, 1 application
> admin/misc (alive), 4 machines, 1 application
>
> Destroy all models? (y/N):y
>
>
> A similar stanza could be made for storage:
>
> Destroy storage? (destroy/
>
> ** Affects: juju
> Importance: Low
> Status: Triaged
>
>
> ** Tags: cli destroy-controller destroy-model usability
>
> --
> You received this bug notification because you are subscribed to juju.
> https:/
>
> Title:
> destroy-controller should prompt for --destroy-
> options
>
> To manage notifications about this bug go to:
> https:/
>