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

kaos doesn't rollback correctly from failed cloud deployments #80

Open
aalhour opened this issue Nov 13, 2019 · 1 comment
Open

kaos doesn't rollback correctly from failed cloud deployments #80

aalhour opened this issue Nov 13, 2019 · 1 comment
Assignees
Labels
bug Something isn't working
Projects

Comments

@aalhour
Copy link
Contributor

aalhour commented Nov 13, 2019

What is the current behaviour?

When a kaos build deploy command fails, it results in a .kaos/<CLOUD>/None file, which then would make kaos think that a backend was already build for that cloud. When the user tries to truly build the backend for that same cloud, the following gets reported back:

➜ kaos build deploy -c GCP -vy
Aborting - kaos backend is already built.

Even though the .kaos directory doesn't contain a valid backend and the list of backends reports only one:

➜ kaos build list
+-------+---------+----------+-------+
| index | context | provider |  env  |
+-------+---------+----------+-------+
|   0   |  DOCKER |  DOCKER  | local |
+-------+---------+----------+-------+

➜ tree .kaos
.kaos
├── config
└── state
    ├── AWS
    │   └── None
    ├── DOCKER
    │   ├── config.json
    │   └── terraform.tfstate
    └── GCP
        └── None

6 directories, 3 files

Trying to destroy the GCP backend would result in the following error (valid scenario):

➜ kaos destroy -c GCP -vy
Warning - kaos [prod] backend in GCP has not been deployed!

What is the expected behaviour?

When kaos fails to build a backend, the None file should be removed, the .kaos/<CLOUD> should be correctly removed.

How to reproduce? (e.g. logs, minimal example, etc...)

  • Move your GCP credentials file somewhere else or just empty the GOOGLE_APPLICATION_CREDENTIALS environment variable
  • Try to build kaos backend on GCP: kaos build deploy -c GCP -vy
  • Make sure that the failure led to the creation of .kaos/GCP/None file
  • Re-run GCP build command: kaos build deploy -c GCP -vy
  • Get the Aborting - kaos backend is already built. error back

Context (Environment)

  • kaos Cloud Provider: LOCAL, AWS and GCP
  • Operating System: mac OS

Additional Details

  • The kaos build deploy command could search for the terraform.tfstate inside the cloud directory rather than asserting that the directory exists
@aalhour aalhour added this to To do in kaos via automation Nov 13, 2019
@aalhour aalhour added the bug Something isn't working label Nov 13, 2019
@github-actions
Copy link

Thanks for supporting the development of kaos with your first issue! We look forward to handling it.

@ms-shankar ms-shankar self-assigned this Nov 14, 2019
@ms-shankar ms-shankar moved this from To do to In progress in kaos Nov 14, 2019
@ms-shankar ms-shankar moved this from In progress to Done in kaos Nov 15, 2019
@ms-shankar ms-shankar moved this from Done to In Review in kaos Nov 15, 2019
@ms-shankar ms-shankar moved this from In Review to Done in kaos Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
kaos
  
Done
Development

No branches or pull requests

2 participants