mirror of https://github.com/hashicorp/terraform
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.pull/26333/head
parent
6ec34b1f44
commit
2d4cd8d8a6
@ -0,0 +1,41 @@
|
||||
{
|
||||
"format_version": "0.1",
|
||||
"provider_schemas": {
|
||||
"registry.terraform.io/hashicorp/test": {
|
||||
"provider": {
|
||||
"version": 0,
|
||||
"block": {
|
||||
"attributes": {
|
||||
"region": {
|
||||
"description_kind": "plain",
|
||||
"optional": true,
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"description_kind": "plain"
|
||||
}
|
||||
},
|
||||
"resource_schemas": {
|
||||
"test_instance": {
|
||||
"version": 0,
|
||||
"block": {
|
||||
"attributes": {
|
||||
"ami": {
|
||||
"type": "string",
|
||||
"optional": true,
|
||||
"description_kind": "plain"
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"optional": true,
|
||||
"computed": true,
|
||||
"description_kind": "plain"
|
||||
}
|
||||
},
|
||||
"description_kind": "plain"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
test = {
|
||||
source = "hashicorp/test"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue