Documentation
¶
Overview ¶
The version package provides a location to set the release versions for all packages to consume, without creating import cycles.
This package should not import any other terraform packages.
Index ¶
Constants ¶
const Header = "Terraform-Version"
Header is the header name used to send the current terraform version in http requests.
const VersionToImpersonateForProviders = "1.13.0"
This ONLY represents what features OpenTofu currently intends to support from providers which may change their behavior given a particular TerraformVersion. It explicitly does NOT represent any sort of compatibility promise or guarantee. This value should ONLY ever be used by the provider.ConfigureProvider call, any other usage is WRONG and a PROGRAMMING ERROR. This value should be carefully updated as we add OpenTofu support for new protocol features.
Variables ¶
var Fork string
Fork is the choudoufu release version (the release tag, e.g. "v0.2.0"). Like dev above, it is expected to be set using linker flags when building release binaries. It stays empty for development builds, which report only the upstream base version.
var Prerelease string
A pre-release marker for the version, populated using a combination of the raw version and the dev flag.
var SemVer *version.Version
SemVer is an instance of version.Version representing the main version without any prerelease information.
var Version string
The main version number that is being run at the moment, populated from the raw version.
Functions ¶
func InterestingDependencies ¶
InterestingDependencies returns the compiled-in module version info for a small number of dependencies that OpenTofu uses broadly and which we tend to upgrade relatively often as part of improvements to OpenTofu.
The set of dependencies this reports might change over time if our opinions change about what's "interesting". This is here only to create a small number of extra annotations in a debug log to help us more easily cross-reference bug reports with dependency changelogs.
func IsOfficialBuild ¶ added in v0.21.0
func IsOfficialBuild() bool
IsOfficialBuild returns true if the current executable was built with an argument like the following, which is set by the OpenTofu project's main release process:
-X 'github.com/intentius/choudoufu/version.officialBuild=1'
We use this ONLY to generate warnings where we're intending to stop producing official builds for a certain configuration in a future release series and so want to warn about it. We generate such warnings only when this is set because we want third-parties to be able to create and support their own builds for platforms that are not officially supported, and it would be very annoying if those builds generated irrelevant warnings about what is supported in the official set of release packages.
func WithFakedOfficialBuild ¶ added in v0.21.0
func WithFakedOfficialBuild(official bool, f func())
WithFakedOfficialBuild runs the given function with the global "official build" flag temporarily forced to the given value, so that IsOfficialBuild will return that value for the duration of that function's runtime.
This is intended for unit testing only. Because it affects global state, it must not be used in parallel tests.
Types ¶
This section is empty.