-
Notifications
You must be signed in to change notification settings - Fork 36
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
Skip destroy if state is empty #80
Conversation
/test |
Testrun: e2e-2wjl5 +--------------+--------------+--------+----------+ | NAME | STEP | PHASE | DURATION | +--------------+--------------+--------+----------+ | pod-e2e-test | pod-e2e-test | Failed | 12m2s | +--------------+--------------+--------+----------+ |
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.
Thanks!
I have some minor nits.
e241b9b
to
b7f79ae
Compare
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.
Very nice!
/lgtm
Sounds reasonable. Great! |
/test |
Testrun: e2e-gxhrj +--------------+--------------+--------+----------+ | NAME | STEP | PHASE | DURATION | +--------------+--------------+--------+----------+ | pod-e2e-test | pod-e2e-test | Failed | 11m47s | +--------------+--------------+--------+----------+ |
FYI: the test can only run successfully after the PR build has finished, as it uses the image built by the PR job. |
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.
/lgtm
0e64637
to
d05f9c9
Compare
/test |
Testrun: e2e-k9xpd +--------------+--------------+-----------+----------+ | NAME | STEP | PHASE | DURATION | +--------------+--------------+-----------+----------+ | pod-e2e-test | pod-e2e-test | Succeeded | 2m51s | +--------------+--------------+-----------+----------+ |
@vpnachev, @timebertt thanks for your reviews. Another commit was necessary for a successful |
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.
/lgtm
How to categorize this PR?
/area dev-productivity
/area usability
/kind enhancement
/priority normal
What this PR does / why we need it:
If Terraform never ran successfully because of a broken configuration, it'll also fail during the
destroy
step as described in the linked issue. We can skip further execution in such cases if the state is empty and just remove the finalizer from the stateConfigMap
.Which issue(s) this PR fixes:
Fixes #78
Special notes for your reviewer:
There are other cases in which the state is empty in terms of the Terraform object structure can be found in the state
ConfigMap
butresources
are empty:I decided not take a shortcut here because we'd need to explicitly parse the structure and thus introduce a version dependency to Terraform. Still, Terraform will handle such cases gracefully i.e., the only overhead is that we might run Terraform
destroy
even though it's not necessary (/cc @timebertt).Along the way I updated:
Release note: