command/version: Report the current platform #26975
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Along with all of the other information we previously reported in the
terraform version
output, we'll now include the name of the current platform as our provider installation mechanisms represent it.This is addressing a long-standing minor annoyance where we sometimes can't tell from an incomplete bug report which platform Terraform was running on, and incomplete bug reporters do tend to at least include the requested
terraform version
output even if they don't also include the requested full trace log.However, what motivated doing this now is that anyone building a provider registry or mirror needs to have some awareness of these platform identifiers which have been, until v0.13, mostly an implementation detail. This additional information is a small thing we can do to help registry builders (or folks publishing providers for more esoteric platforms) find out what the platform identifier ought to be for each of the platforms they aim to support, even if some of them are platforms which the Go compiler allows but which HashiCorp doesn't officially support.
The new information is on a line of its own in the output as a pragmatic way to avoid breaking anyone who might be using something like
$(terraform version | head -n1)
to print a brief Terraform version identifier into some logs. That's not an interface we officially support for machine consumption, but it's easy to avoid breaking it here and so we won't do so. (If you do want an interface for machine consumption, useterraform version -json
instead.)While I was working on this I also noticed that we forgot to update the
version
package to report the current development as being0.15.0
, so there's another commit in this PR to update that.