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

Backport 26192 #26231

Merged
merged 3 commits into from
Sep 14, 2020
Merged

Backport 26192 #26231

merged 3 commits into from
Sep 14, 2020

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Sep 14, 2020

0.13 backport of #26192

A provider cannot influence CreateThenDelete vs DeleteThenCreate, so we
shouldn't attribute this to the provider in the error.
If a resource is forced CreateBeforeDestroy from a dependent resource,
and that dependent has no changes, the plan is changed from
CreateThenDelete to DeleteThenCreate causing an apply error.
When applying a plan, a forced CreateBeforeDestroy may not be set during
the apply walk when downstream resources are no longer present in the
graph. We still need to stick to that plan, and both the
NodeApplyableResourceInstance EvalTree and the individual Eval nodes
need to operate on that planned value.

Ensure that we always check for an existing plan when determining
CreateBeforeDestroy status. This must happen in 2 different code paths
due to the eval node pattern currently in-use. Future refactoring may be
able to unify these code-paths to make this less fragile.
@jbardin jbardin requested a review from a team September 14, 2020 12:54
Copy link
Contributor

@mildwonkey mildwonkey left a comment

Choose a reason for hiding this comment

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

🎉

@codecov
Copy link

codecov bot commented Sep 14, 2020

Codecov Report

Merging #26231 into v0.13 will decrease coverage by 0.01%.
The diff coverage is 40.00%.

Impacted Files Coverage Δ
terraform/eval_diff.go 68.22% <35.71%> (-1.25%) ⬇️
terraform/node_resource_apply_instance.go 80.31% <100.00%> (+0.15%) ⬆️
terraform/node_resource_plan.go 91.80% <0.00%> (-1.64%) ⬇️
states/statefile/version4.go 57.54% <0.00%> (-0.29%) ⬇️

@jbardin jbardin merged commit a784cbe into v0.13 Sep 14, 2020
@jbardin jbardin deleted the jbardin/backport-26192 branch September 14, 2020 12:57
@ghost
Copy link

ghost commented Oct 15, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Oct 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants