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

terraform: Compare locks and provider requirements #26761

Merged
merged 1 commit into from
Nov 6, 2020

Conversation

alisdair
Copy link
Contributor

@alisdair alisdair commented Oct 30, 2020

When building a context, we read the dependency locks and ensure that the provider requirements from the configuration can be satisfied. If the configured requirements change such that the locks need to be updated, we explain this and recommend running "terraform init".

This check is ignored for any providers which are locally marked as in development. This includes unmanaged providers and those listed in the provider installation dev_overrides block.

Fixes #26565.

Screenshot

diags

@alisdair alisdair added cli 0.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged labels Oct 30, 2020
@alisdair alisdair requested a review from a team October 30, 2020 16:39
@alisdair alisdair self-assigned this Oct 30, 2020
@alisdair

This comment has been minimized.

@alisdair
Copy link
Contributor Author

The above comment was a misread of test output. I'll investigate these test failures and re-request review if I can address them.

@alisdair alisdair removed the request for review from a team October 30, 2020 16:45
@alisdair alisdair marked this pull request as draft October 30, 2020 16:45
@alisdair alisdair force-pushed the alisdair/compare-locks-and-provider-requirements branch 2 times, most recently from 019a64c to 184c006 Compare October 30, 2020 17:53
@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #26761 into master will increase coverage by 0.02%.
The diff coverage is 86.66%.

Impacted Files Coverage Δ
command/meta.go 67.75% <42.85%> (-0.85%) ⬇️
terraform/context.go 88.09% <100.00%> (+0.87%) ⬆️
internal/providercache/dir.go 67.34% <0.00%> (-6.13%) ⬇️
states/statefile/version4.go 58.19% <0.00%> (+0.23%) ⬆️
terraform/node_resource_apply_instance.go 75.78% <0.00%> (+0.78%) ⬆️
terraform/eval_diff.go 67.43% <0.00%> (+0.91%) ⬆️
terraform/node_resource_plan.go 97.16% <0.00%> (+1.88%) ⬆️

Copy link
Contributor Author

@alisdair alisdair left a comment

Choose a reason for hiding this comment

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

📝

command/meta.go Outdated Show resolved Hide resolved
@alisdair alisdair marked this pull request as ready for review October 30, 2020 17:59
@alisdair alisdair requested a review from a team October 30, 2020 17:59
@alisdair alisdair force-pushed the alisdair/compare-locks-and-provider-requirements branch 2 times, most recently from b603e2b to 60353da Compare November 5, 2020 19:48
}
opts.LockedDependencies = lockedDependencies

// If any unmanaged providers or dev overrides are enabled, they must
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

terraform/context_test.go Show resolved Hide resolved
@alisdair alisdair force-pushed the alisdair/compare-locks-and-provider-requirements branch from 60353da to 0970f83 Compare November 5, 2020 20:28
Copy link
Contributor

@pselle pselle left a comment

Choose a reason for hiding this comment

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

Two more comments but non-blocking/merge when addressed if you choose to: a readability/whitespace in the tests, and a request for another test case.

terraform/context_test.go Outdated Show resolved Hide resolved
terraform/context_test.go Show resolved Hide resolved
When building a context, we read the dependency locks and ensure that
the provider requirements from the configuration can be satisfied.
If the configured requirements change such that the locks need to be
updated, we explain this and recommend running "terraform init".

This check is ignored for any providers which are locally marked as in
development. This includes unmanaged providers and those listed in the
provider installation `dev_overrides` block.
@alisdair alisdair force-pushed the alisdair/compare-locks-and-provider-requirements branch from 0970f83 to 10cc25f Compare November 6, 2020 17:59
@alisdair alisdair merged commit 60e01f5 into master Nov 6, 2020
@alisdair alisdair deleted the alisdair/compare-locks-and-provider-requirements branch November 6, 2020 18:12
@ghost
Copy link

ghost commented Dec 7, 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 Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
0.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged cli
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pinned required_providers version ignored by terraform plan
2 participants