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

terraform destroy doesn't wait for application destruction and doesn't have an option to specify --force --no-wait #642

Closed
dparv opened this issue Dec 10, 2024 · 3 comments
Labels
kind/feature suggests new feature or enhancement state/will-not-fix out of focus in observable time

Comments

@dparv
Copy link

dparv commented Dec 10, 2024

Requirements

Currently the terraform apply does wait for some things like storage to be created - which is great, but the terraform destroy doesn't wait, just send the commands to the controller and exits as completed, while some applications are stuck in error and can't be destroyed.

One thing that would be good is to add the waiting for the application removal.

Also it would be good to add a parameter on the application / model resource, something like force_on_destroy true/false and/or nowait_on_destroy: true/false that will allow the pipeline to run juju remove-model --force and --no-wait in those errored out cases.

Urgency

Casually wishlisting

Notes & References

No response

@dparv dparv added kind/feature suggests new feature or enhancement state/untriaged untriaged bug report labels Dec 10, 2024
@hmlanigan
Copy link
Member

Duplicate of #521

@hmlanigan hmlanigan marked this as a duplicate of #521 Dec 19, 2024
@hmlanigan
Copy link
Member

In many ways the --force flag in juju is a mis-feature. Adding it to terraform would exaserbate the problem and allow it to easily slip normal use. When it should be used with extreme care. It can leave a model in an undesirable state.

Sometimes, the removal of the application may fail as Juju encounters errors
and failures that need to be dealt with before an application can be removed.
For example, Juju will not remove an application if there are hook failures.
However, at times, there is a need to remove an application ignoring
all operational errors. In these rare cases, use --force option but note
that --force will also remove all units of the application, its subordinates
and, potentially, machines without given them the opportunity to shutdown cleanly.

Application removal is a multi-step process. Under normal circumstances, Juju will not
proceed to the next step until the current step has finished.

Using it in development means that juju and/or charm bugs are not fixed unit they are found by customers, not in test.

@hmlanigan hmlanigan removed the state/untriaged untriaged bug report label Dec 19, 2024
@alesstimec alesstimec added the state/will-not-fix out of focus in observable time label Dec 20, 2024
@alesstimec
Copy link
Member

As @hmlanigan pointed out this feature is out of scope of the terraform provider. If issues occur, those should be addressed by charm authors or juju developers. The terraform provider should not use the --force flag as it might leave the model in an undesirable state for future use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature suggests new feature or enhancement state/will-not-fix out of focus in observable time
Projects
None yet
Development

No branches or pull requests

3 participants