-
Notifications
You must be signed in to change notification settings - Fork 118
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
Further specify behaviour of terraform show
#273
Conversation
213b6e0
to
2d0945f
Compare
`run:\s+terraform init`) // v1.1.0 (ref df578afd) | ||
noInitErrRegexp = regexp.MustCompile( | ||
// UNINITIALISED PROVIDERS/MODULES | ||
`Error: Could not satisfy plugin requirements|` + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gofmt and I are of differing opinions as to the best indentation for this section of code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -1,4 +1,5 @@ | |||
// This file contains tests that only compile/work in Go 1.13 and forward | |||
//go:build go1.13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth running go fmt ./...
on the whole project and update all go build lines? Doesn't have to be in this PR though...
On a related note I guess we forgot to update the Readme.md to say that we now require Go 1.17 (as per #216)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll add both of those to #272 as a general tidy-up, so we can get this one merged and fix all the other CI.
Fixes nightly
main
test.This PR aims to test all
terraform show
scenarios described in hashicorp/terraform#30344, and a few more.Also adds a new error type,
ErrStatePlanRead
, which occurs whenterraform show
cannot read the state or plan file at the path given.At present, running
terraform show -json
in a directory with a config file, but in whichterraform init
has not been run, results in inconsistent behaviour across versions:ErrNoInit
and exit 1.main
(hashicorp/terraform@0d1a04e): Prints empty state ({"format_version":"1.0"}
), exit 0.See hashicorp/terraform#30415. The old behaviour is considered incorrect, and is therefore a Terraform CLI known issue prior to v1.2.0.