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

Ensure cleanup of AWS resources #57

Merged
merged 1 commit into from
Nov 23, 2020

Conversation

timebertt
Copy link
Member

What this PR does / why we need it:

Before this PR, the destroy logic and testing was executed as part of a cleanup action. This is a bit dirty, as the destroy logic is part of the actual test and not just cleanup.
Also, this could lead to resource leakage on AWS and on the test-machinery cluster, because if one cleanup action fails (e.g. the destroy logic) no further cleanup actions are executed.

Now, the destroy logic is executed as a deferred function to ensure that the cleanup actions are still run, even if the test itself fails.
Additionally, a real cleanup action is added, that cleans up AWS resources left over from the test via the aws go sdk, so we can avoid manual cleanup on test failures.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
@schrodit, thanks for your help and input!

Release note:


Co-authored-by: Tim Schrodi <tim.schrodi@sap.com>
@timebertt timebertt requested a review from a team as a code owner November 20, 2020 17:48
@gardener-robot gardener-robot added needs/review Needs review size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) labels Nov 20, 2020
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Nov 20, 2020
@timebertt
Copy link
Member Author

Side-note from @schrodit and me: we should refactor the infrastructure integration tests in the provider extensions in a similar way, as I already had to cleanup resources on AWS left-over from such a test manually.

Copy link
Member

@rfranzke rfranzke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants