Skip to content

removed orphaned data sources from the working state #27621

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

Merged
merged 1 commit into from
Jan 29, 2021

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Jan 28, 2021

When removing data source instances via alterations to a for_each value, the orphaned instance must be removed from both the refresh state, and the working state. While the refreshState represents what the data source is currently, plan-time evaluations will still happen against the working state.

Fixes #27617

This will require a manual backport for 0.14

When evaluating orphaned data sources during plan, they need to be
removed from both the refresh state and the current working state.
@jbardin jbardin requested a review from a team January 28, 2021 21:55
@codecov
Copy link

codecov bot commented Jan 28, 2021

Codecov Report

Merging #27621 (2df2d21) into master (c066127) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted Files Coverage Δ
terraform/node_resource_plan_orphan.go 73.91% <100.00%> (+1.18%) ⬆️
terraform/evaluate.go 52.89% <0.00%> (+0.41%) ⬆️
terraform/node_resource_plan.go 98.05% <0.00%> (+1.94%) ⬆️

_, diags = ctx.Apply()
if diags.HasErrors() {
t.Fatal(diags.Err())
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This slipped into the change from the file I had open already, but I left it since it's a bit of code that should have been deleted. Apply shouldn't be called in the plan test, and does not check anything.

@ghost
Copy link

ghost commented Mar 1, 2021

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 Mar 1, 2021
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.

Output shows values from previous applies when using for loop with data source
2 participants