Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

command/show: fix issue with show and aliased provider #23848

Merged
merged 1 commit into from
Jan 13, 2020

Conversation

mildwonkey
Copy link
Contributor

The formatter in command/format/state.go, when formatting a resource
with an aliased provider, was looking for a schema with the alias (ie,
test.foo), but the schemas are only listed by provider type (test).
Update the state formatter to lookup schemas by provider type only.

Some of the show tests (and a couple others) were not properly cleaning
up the created tmpdirs, so I fixed those. Also, the show tests are using
a statefile named state.tfstate, but were not passing that path to the
show command, so we were getting some false positives (a show command
that returns no state exits 0).

Fixes #21462

@ghost ghost added the sdkv1 [PRs only] Marks changes that may potentially need to be ported to the plugi nSDK label Jan 13, 2020
@mildwonkey mildwonkey requested a review from a team January 13, 2020 16:07
The formatter in `command/format/state.go`, when formatting a resource
with an aliased provider, was looking for a schema with the alias (ie,
test.foo), but the schemas are only listed by provider type (test).
Update the state formatter to lookup schemas by provider type only.

Some of the show tests (and a couple others) were not properly cleaning
up the created tmpdirs, so I fixed those. Also, the show tests are using
a statefile named `state.tfstate`, but were not passing that path to the
show command, so we were getting some false positives (a `show` command
that returns `no state` exits 0).

Fixes part of #21462 (aliased providers)
@mildwonkey mildwonkey merged commit 92f4277 into master Jan 13, 2020
@mildwonkey mildwonkey deleted the mildwonkey/b-show branch January 13, 2020 20:10
@ghost
Copy link

ghost commented Mar 28, 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 and limited conversation to collaborators Mar 28, 2020
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
sdkv1 [PRs only] Marks changes that may potentially need to be ported to the plugi nSDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

terraform show missing schema for provider
2 participants