Skip to content

command: Providers schema shows required_providers#26318

Merged
alisdair merged 1 commit intomasterfrom
alisdair/providers-schema-required-providers
Sep 22, 2020
Merged

command: Providers schema shows required_providers#26318
alisdair merged 1 commit intomasterfrom
alisdair/providers-schema-required-providers

Conversation

@alisdair
Copy link
Copy Markdown
Contributor

@alisdair alisdair commented Sep 21, 2020

The providers schema command is using the Config.ProviderTypes method, which had not been kept up to date with the changes to provider requirements detection made in Config.ProviderRequirements. This resulted in any currently-unused providers being omitted from the output.

This commit changes the ProviderTypes method to use the same underlying logic as ProviderRequirements, which ensures that required_providers blocks are taken into account.

Includes an integration test case to verify that this fixes the provider schemas command bug.

Fixes #26306. Diff best viewed ignoring whitespace, due to the new nil check if statement.

@alisdair alisdair requested a review from a team September 21, 2020 20:40
@alisdair alisdair self-assigned this Sep 21, 2020
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 21, 2020

Codecov Report

Merging #26318 into master will decrease coverage by 0.01%.
The diff coverage is 53.33%.

Impacted Files Coverage Δ
configs/config.go 68.46% <53.33%> (+0.43%) ⬆️
terraform/node_resource_plan.go 92.52% <0.00%> (-1.87%) ⬇️
configs/resource.go 80.46% <0.00%> (-1.18%) ⬇️

@alisdair alisdair force-pushed the alisdair/providers-schema-required-providers branch from 7191700 to d079957 Compare September 22, 2020 14:13
The providers schema command is using the Config.ProviderTypes method,
which had not been kept up to date with the changes to provider
requirements detection made in Config.ProviderRequirements. This
resulted in any currently-unused providers being omitted from the
output.

This commit changes the ProviderTypes method to use the same underlying
logic as ProviderRequirements, which ensures that `required_providers`
blocks are taken into account.

Includes an integration test case to verify that this fixes the provider
schemas command bug.
@alisdair alisdair force-pushed the alisdair/providers-schema-required-providers branch from d079957 to 18f9ea5 Compare September 22, 2020 14:28
@alisdair alisdair merged commit 85ddb38 into master Sep 22, 2020
@alisdair alisdair deleted the alisdair/providers-schema-required-providers branch September 22, 2020 16:42
@ghost
Copy link
Copy Markdown

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

"terraform providers schema" only includes providers already being used

2 participants