-
Notifications
You must be signed in to change notification settings - Fork 114
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 Down can run on build and test failure #189
Conversation
/lgtm |
This reverts part of #148. |
I see that the defer was removed out of a concern that down will be called multiple times. But since os.Exit is called, this should not be the case. os.Exit will not call deferred functions. |
// ensure tearing down the cluster happens last. | ||
// down should be called both when Up and Test fails to ensure resources are being cleaned up. | ||
defer func() { | ||
if opts.ShouldDown() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps should be if opts.ShouldDown() { defer ....
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder, olemarkus The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add the down logic back into a
defer
so that resources are cleaned up on cluster up and test failures.Fixes #188
Fixes kubernetes/kops#13349