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

python -m enos.enos destroy doesn't destroy the containers created during the upphase #161

Open
msimonin opened this issue Jun 29, 2017 · 5 comments

Comments

@msimonin
Copy link
Contributor

No description provided.

@rcherrueau
Copy link
Member

rcherrueau commented Jun 29, 2017

The destroy only works if the up phase succeeds to complete. Reason is simple: destroy uses environment information to destroy resources and environment information are written at the end of the up. If the up phase fails, then there is no environment information.

I could maybe fix that by passing an extra argument to each phase. This extra argument would be a closure that lets you explicitly save the environment. So you can save the environment just after the provider.init and henceforth get the necessary environment for the destroy.

Do you want me to implement this?

@msimonin
Copy link
Contributor Author

Here is what I had in mind. The destroy should also remove any container set up during the up phase (registry, cadvisor)

enos deploy
enos destroy

We could follow how kolla is implementing this.
For every role called by up.yml pass a variable action=up|destroy.
Each main.yml then include {{ action }}.yml and call the relevant play.

I agree that calling after a failed up could be problematic since the env is created at the end of the phase.

@rcherrueau
Copy link
Member

Oh, you mean your title was about "destroying registry, cadvisor, ..." and not about "destroying provider resources"?

@msimonin
Copy link
Contributor Author

'resources' is confusing :)

@rcherrueau
Copy link
Member

😄

@msimonin msimonin changed the title python -m enos.enos destroy doesn't destroy the ressources created during the upphase python -m enos.enos destroy doesn't destroy the containers created during the upphase Jun 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants