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

Update create_before_destroy in state during refresh #26343

Merged
merged 3 commits into from
Sep 24, 2020

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Sep 22, 2020

While create_before_destroy is stored in the instance state, the status would only be updated when a change to the resource was applied. This meant that if a resource was incorrectly created with the wrong option, it would require a change to the resource itself to fix, which may not be possible with all resources.

This change updates the stored create_before_destroy value while the resource is being refreshed.

Fixes #25473

@jbardin jbardin requested a review from a team September 22, 2020 20:50
@codecov
Copy link

codecov bot commented Sep 22, 2020

Codecov Report

Merging #26343 into master will decrease coverage by 0.00%.
The diff coverage is 62.50%.

Impacted Files Coverage Δ
terraform/node_resource_plan_instance.go 97.64% <ø> (ø)
terraform/eval_state.go 59.89% <62.50%> (+0.11%) ⬆️
terraform/node_resource_plan.go 92.66% <0.00%> (-1.84%) ⬇️
dag/marshal.go 54.79% <0.00%> (+1.36%) ⬆️

@jbardin jbardin force-pushed the jbardin/update-cbd-state branch 2 times, most recently from 3d6f869 to 83a79b7 Compare September 22, 2020 21:05
@jbardin jbardin mentioned this pull request Sep 22, 2020
In order to save any changes to lifecycle options, we need to record
those changes during refresh, otherwise they would only be updated when
there is a change in the resource to be applied.
@jbardin jbardin merged commit 435d8bd into master Sep 24, 2020
@jbardin jbardin deleted the jbardin/update-cbd-state branch September 24, 2020 14:03
@ghost
Copy link

ghost commented Oct 25, 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 25, 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.

create_before_destroy cannot be added without updating a resource
2 participants