mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-23 15:40:07 -06:00
Rename occurrences in root folder to to OpenTF (#172)
* migrate 1.6.0 changelog to opentf * adapt comments (tho not a must) * adapt comments (tho not a must) * adapt comments (tho not a must) * adapt comments (tho not a must) * adapt help output for opentf * adapt autocomplete test * Fix capitalized names. Signed-off-by: Jakub Martin <kubam@spacelift.io> --------- Signed-off-by: Jakub Martin <kubam@spacelift.io> Co-authored-by: Jakub Martin <kubam@spacelift.io>
This commit is contained in:
parent
4d665a0091
commit
1edd0da630
12
CHANGELOG.md
12
CHANGELOG.md
@ -1,21 +1,21 @@
|
||||
## 1.6.0 (Unreleased)
|
||||
|
||||
NEW FEATURES:
|
||||
* `terraform test`: The previously experimental `terraform test` command has been moved out of experimental. This comes with a significant change in how Terraform tests are written and executed.
|
||||
* `opentf test`: The previously experimental `opentf test` command has been moved out of experimental. This comes with a significant change in how OpenTF tests are written and executed.
|
||||
|
||||
Terraform tests are now written within `.tftest.hcl` files, controlled by a series of `run` blocks. Each `run` block will execute a Terraform plan or apply command against the Terraform configuration under test and can execute conditions against the resultant plan and state.
|
||||
OpenTF tests are written within `.tftest.hcl` files, controlled by a series of `run` blocks. Each `run` block will execute an OpenTF plan or apply command against the OpenTF configuration under test and can execute conditions against the resultant plan and state.
|
||||
|
||||
ENHANCEMENTS:
|
||||
* config: Terraform can now track some additional detail about values that won't be known until the apply step, such as the range of possible lengths for a collection or whether an unknown value can possibly be null. When this information is available, Terraform can potentially generate known results for some operations on unknown values. This doesn't mean that Terraform can immediately track that detail in all cases, but the type system now contains the facility for that and so over time we will improve the level of detail generated by built-in functions, language operators, Terraform providers, etc. ([#33234](https://github.com/hashicorp/terraform/issues/33234))
|
||||
* config: OpenTF can now track some additional detail about values that won't be known until the apply step, such as the range of possible lengths for a collection or whether an unknown value can possibly be null. When this information is available, Terraform can potentially generate known results for some operations on unknown values. This doesn't mean that Terraform can immediately track that detail in all cases, but the type system now contains the facility for that and so over time we will improve the level of detail generated by built-in functions, language operators, Terraform providers, etc. ([#33234](https://github.com/hashicorp/terraform/issues/33234))
|
||||
* jsonplan: Added `errored` field to JSON plan output, indicating whether a plan errored. ([#33372](https://github.com/hashicorp/terraform/issues/33372))
|
||||
* cloud: Remote plans on Terraform Cloud/Enterprise can now be saved using the `-out` flag, referenced in the `show` command, and applied by specifying the plan file name. ([#33492](https://github.com/hashicorp/terraform/issues/33492))
|
||||
* cloud: Remote plans on cloud backends can now be saved using the `-out` flag, referenced in the `show` command, and applied by specifying the plan file name. ([#33492](https://github.com/hashicorp/terraform/issues/33492))
|
||||
* config: The `import` block `id` field now accepts an expression referencing other values such as resource attributes, as long as the value is a string known at plan time. ([#33618](https://github.com/hashicorp/terraform/issues/33618))
|
||||
|
||||
|
||||
BUG FIXES:
|
||||
* The upstream dependency that Terraform uses for service discovery of Terraform-native services such as Terraform Cloud/Enterprise state storage was previously not concurrency-safe, but Terraform was treating it as if it was in situations like when a configuration has multiple `terraform_remote_state` blocks all using the "remote" backend. Terraform is now using a newer version of that library which updates its internal caches in a concurrency-safe way. ([#33364](https://github.com/hashicorp/terraform/issues/33364))
|
||||
* The upstream dependency that OpenTF uses for service discovery of OpenTF-native services such as cloud backend state storage was previously not concurrency-safe, but OpenTF was treating it as if it was in situations like when a configuration has multiple `terraform_remote_state` blocks all using the "remote" backend. OpenTF is now using a newer version of that library which updates its internal caches in a concurrency-safe way. ([#33364](https://github.com/hashicorp/terraform/issues/33364))
|
||||
* Transitive dependencies were lost during apply when the referenced resource expanded into zero instances ([#33403](https://github.com/hashicorp/terraform/issues/33403))
|
||||
* Terraform will no longer override SSH settings in local git configuration when installing modules. ([#33592](https://github.com/hashicorp/terraform/issues/33592))
|
||||
* OpenTF will no longer override SSH settings in local git configuration when installing modules. ([#33592](https://github.com/hashicorp/terraform/issues/33592))
|
||||
|
||||
## Previous Releases
|
||||
|
||||
|
@ -26,10 +26,10 @@ import (
|
||||
|
||||
// runningInAutomationEnvName gives the name of an environment variable that
|
||||
// can be set to any non-empty value in order to suppress certain messages
|
||||
// that assume that Terraform is being run from a command prompt.
|
||||
// that assume that OpenTF is being run from a command prompt.
|
||||
const runningInAutomationEnvName = "TF_IN_AUTOMATION"
|
||||
|
||||
// Commands is the mapping of all the available Terraform commands.
|
||||
// Commands is the mapping of all the available OpenTF commands.
|
||||
var Commands map[string]cli.CommandFactory
|
||||
|
||||
// PrimaryCommands is an ordered sequence of the top-level commands (not
|
||||
|
2
help.go
2
help.go
@ -47,7 +47,7 @@ func helpFunc(commands map[string]cli.CommandFactory) string {
|
||||
// website/source/docs/cli/commands/index.html.markdown; if you
|
||||
// change this then consider updating that to match.
|
||||
helpText := fmt.Sprintf(`
|
||||
Usage: terraform [global options] <subcommand> [args]
|
||||
Usage: opentf [global options] <subcommand> [args]
|
||||
|
||||
The available commands for execution are listed below.
|
||||
The primary workflow commands are given first, followed by
|
||||
|
10
main.go
10
main.go
@ -71,7 +71,7 @@ func realMain() int {
|
||||
|
||||
err = openTelemetryInit()
|
||||
if err != nil {
|
||||
// openTelemetryInit can only fail if Terraform was run with an
|
||||
// openTelemetryInit can only fail if OpenTF was run with an
|
||||
// explicit environment variable to enable telemetry collection,
|
||||
// so in typical use we cannot get here.
|
||||
Ui.Error(fmt.Sprintf("Could not initialize telemetry: %s", err))
|
||||
@ -158,7 +158,7 @@ func realMain() int {
|
||||
}
|
||||
if diags.HasErrors() {
|
||||
Ui.Error("As a result of the above problems, OpenTF may not behave as intended.\n\n")
|
||||
// We continue to run anyway, since Terraform has reasonable defaults.
|
||||
// We continue to run anyway, since OpenTF has reasonable defaults.
|
||||
}
|
||||
}
|
||||
|
||||
@ -202,7 +202,7 @@ func realMain() int {
|
||||
providerDevOverrides := providerDevOverrides(config.ProviderInstallation)
|
||||
|
||||
// The user can declare that certain providers are being managed on
|
||||
// Terraform's behalf using this environment variable. This is used
|
||||
// OpenTF's behalf using this environment variable. This is used
|
||||
// primarily by the SDK's acceptance testing framework.
|
||||
unmanagedProviders, err := parseReattachProviders(os.Getenv("TF_REATTACH_PROVIDERS"))
|
||||
if err != nil {
|
||||
@ -224,7 +224,7 @@ func realMain() int {
|
||||
return 1
|
||||
}
|
||||
|
||||
// The arguments can begin with a -chdir option to ask Terraform to switch
|
||||
// The arguments can begin with a -chdir option to ask OpenTF to switch
|
||||
// to a different working directory for the rest of its work. If that
|
||||
// option is present then extractChdirOption returns a trimmed args with that option removed.
|
||||
overrideWd, args, err := extractChdirOption(args)
|
||||
@ -317,7 +317,7 @@ func realMain() int {
|
||||
if cmd := cliRunner.Subcommand(); cmd != "" && !autoComplete {
|
||||
// Due to the design of cli.CLI, this special error message only works
|
||||
// for typos of top-level commands. For a subcommand typo, like
|
||||
// "terraform state posh", cmd would be "state" here and thus would
|
||||
// "opentf state push", cmd would be "state" here and thus would
|
||||
// be considered to exist, and it would print out its own usage message.
|
||||
if _, exists := Commands[cmd]; !exists {
|
||||
suggestions := make([]string, 0, len(Commands))
|
||||
|
@ -273,11 +273,11 @@ func TestMain_autoComplete(t *testing.T) {
|
||||
return &testCommandCLI{}, nil
|
||||
}
|
||||
|
||||
os.Setenv("COMP_LINE", "terraform versio")
|
||||
os.Setenv("COMP_LINE", "opentf versio")
|
||||
defer os.Unsetenv("COMP_LINE")
|
||||
|
||||
// Run it!
|
||||
os.Args = []string{"terraform", "terraform", "versio"}
|
||||
os.Args = []string{"opentf", "opentf", "versio"}
|
||||
exit := realMain()
|
||||
if exit != 0 {
|
||||
t.Fatalf("unexpected exit status %d; want 0", exit)
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
|
||||
// providerSource constructs a provider source based on a combination of the
|
||||
// CLI configuration and some default search locations. This will be the
|
||||
// provider source used for provider installation in the "terraform init"
|
||||
// provider source used for provider installation in the "opentf init"
|
||||
// command, unless overridden by the special -plugin-dir option.
|
||||
func providerSource(configs []*cliconfig.ProviderInstallation, services *disco.Disco) (getproviders.Source, tfdiags.Diagnostics) {
|
||||
if len(configs) == 0 {
|
||||
|
@ -15,7 +15,7 @@ import (
|
||||
"github.com/placeholderplaceholderplaceholder/opentf/version"
|
||||
)
|
||||
|
||||
// If this environment variable is set to "otlp" when running Terraform CLI
|
||||
// If this environment variable is set to "otlp" when running OpenTF CLI
|
||||
// then we'll enable an experimental OTLP trace exporter.
|
||||
//
|
||||
// BEWARE! This is not a committed external interface.
|
||||
@ -35,11 +35,11 @@ func init() {
|
||||
|
||||
// openTelemetryInit initializes the optional OpenTelemetry exporter.
|
||||
//
|
||||
// By default we don't export telemetry information at all, since Terraform is
|
||||
// By default we don't export telemetry information at all, since OpenTF is
|
||||
// a CLI tool and so we don't assume we're running in an environment with
|
||||
// a telemetry collector available.
|
||||
//
|
||||
// However, for those running Terraform in automation we allow setting
|
||||
// However, for those running OpenTF in automation we allow setting
|
||||
// the standard OpenTelemetry environment variable OTEL_TRACES_EXPORTER=otlp
|
||||
// to enable an OTLP exporter, which is in turn configured by all of the
|
||||
// standard OTLP exporter environment variables:
|
||||
@ -49,7 +49,7 @@ func init() {
|
||||
// We don't currently support any other telemetry export protocols, because
|
||||
// OTLP has emerged as a de-facto standard and each other exporter we support
|
||||
// means another relatively-heavy external dependency. OTLP happens to use
|
||||
// protocol buffers and gRPC, which Terraform would depend on for other reasons
|
||||
// protocol buffers and gRPC, which OpenTF would depend on for other reasons
|
||||
// anyway.
|
||||
func openTelemetryInit() error {
|
||||
// We'll check the environment variable ourselves first, because the
|
||||
|
Loading…
Reference in New Issue
Block a user