From a127607a859b3074c2c36d50f7599e0758f04c99 Mon Sep 17 00:00:00 2001 From: Dmitry Kisler Date: Tue, 26 Sep 2023 19:09:27 +0200 Subject: [PATCH] Rename terraform to tofu in `GoString` method and docstrings (#576) Signed-off-by: Dmitry Kisler --- commands.go | 2 +- internal/backend/local/backend_plan_test.go | 10 +++--- internal/backend/remote/testing.go | 2 +- internal/builtin/providers/tf/provider.go | 6 ++-- internal/checks/doc.go | 2 +- internal/checks/state.go | 8 ++--- internal/checks/state_report.go | 8 ++--- internal/cloud/backend.go | 22 ++++++------ internal/cloud/backend_apply.go | 2 +- internal/cloud/backend_plan.go | 2 +- internal/cloud/backend_show.go | 2 +- internal/cloud/backend_show_test.go | 2 +- internal/cloud/e2e/helper_test.go | 2 +- .../e2e/migrate_state_tfc_to_tfc_test.go | 8 ++--- internal/cloud/migration.go | 2 +- internal/cloud/state.go | 2 +- internal/cloud/testing.go | 2 +- internal/command/command.go | 4 +-- internal/command/command_test.go | 2 +- internal/command/console_test.go | 4 +-- internal/command/fmt.go | 4 +-- internal/command/format/format.go | 6 ++-- internal/command/format/object_id.go | 2 +- internal/command/get_test.go | 2 +- internal/command/graph.go | 2 +- internal/command/import.go | 6 ++-- internal/command/init.go | 20 +++++------ internal/command/init_test.go | 2 +- internal/command/jsonchecks/checks.go | 6 ++-- internal/command/jsonconfig/config.go | 10 +++--- internal/command/jsonplan/plan.go | 2 +- internal/command/jsonstate/state.go | 10 +++--- internal/command/meta.go | 36 +++++++++---------- internal/command/meta_backend.go | 22 ++++++------ internal/command/meta_backend_migrate.go | 6 ++-- internal/command/meta_backend_test.go | 2 +- internal/command/meta_config.go | 4 +-- internal/command/meta_providers.go | 16 ++++----- internal/command/plan_test.go | 10 +++--- internal/command/providers_lock.go | 8 ++--- internal/command/providers_mirror.go | 2 +- internal/command/providers_schema_test.go | 2 +- internal/command/show.go | 2 +- internal/command/show_test.go | 8 ++--- internal/command/state_mv.go | 2 +- internal/command/test.go | 4 +-- .../testdata/login-oauth-server/main.go | 4 +-- .../login-oauth-server/oauthserver.go | 8 ++--- .../testdata/login-tfe-server/tfeserver.go | 6 ++-- internal/command/testing/test_provider.go | 2 +- internal/command/ui_input.go | 4 +-- internal/command/validate.go | 10 +++--- internal/command/version.go | 4 +-- internal/command/version_test.go | 6 ++-- internal/command/views/validate.go | 2 +- internal/command/views/view.go | 2 +- internal/command/workdir/dir.go | 14 ++++---- internal/command/workdir/doc.go | 6 ++-- internal/communicator/ssh/provisioner.go | 2 +- internal/configs/checks.go | 2 +- internal/configs/config.go | 10 +++--- internal/configs/configload/loader.go | 4 +-- internal/configs/configload/loader_load.go | 2 +- internal/configs/configschema/doc.go | 2 +- .../configs/configschema/internal_validate.go | 2 +- internal/configs/doc.go | 6 ++-- internal/configs/hcl2shim/values_equiv.go | 6 ++-- internal/configs/parser_config.go | 4 +-- internal/configs/parser_config_dir.go | 12 +++---- internal/configs/test_file.go | 22 ++++++------ internal/configs/version_constraint.go | 2 +- internal/depsfile/doc.go | 2 +- internal/e2e/e2e.go | 6 ++-- internal/experiments/experiment.go | 2 +- internal/getproviders/didyoumean.go | 2 +- internal/getproviders/hash.go | 8 ++--- .../getproviders/package_authentication.go | 12 +++---- internal/getproviders/types.go | 10 +++--- internal/httpclient/client.go | 2 +- internal/legacy/helper/acctest/acctest.go | 2 +- internal/legacy/helper/schema/core_schema.go | 6 ++-- internal/legacy/helper/schema/doc.go | 2 +- internal/legacy/helper/schema/provisioner.go | 8 ++--- internal/legacy/helper/schema/resource.go | 12 +++---- .../legacy/helper/schema/resource_importer.go | 12 +++---- internal/legacy/tofu/resource_provisioner.go | 8 ++--- internal/legacy/tofu/schemas.go | 2 +- internal/legacy/tofu/state.go | 34 +++++++++--------- internal/logging/logging.go | 2 +- internal/logging/panic.go | 4 +-- internal/modsdir/manifest.go | 4 +-- internal/moduledeps/doc.go | 4 +-- internal/moduletest/run.go | 6 ++-- internal/plans/planfile/tfplan.go | 2 +- internal/plugin/convert/schema.go | 2 +- internal/plugin/ui_input.go | 2 +- internal/plugin/ui_output.go | 2 +- internal/plugin6/convert/schema.go | 2 +- internal/providercache/installer.go | 16 ++++----- internal/providercache/installer_events.go | 4 +-- internal/providercache/installer_test.go | 2 +- internal/providers/doc.go | 2 +- internal/providers/provider.go | 14 ++++---- internal/provisioners/doc.go | 2 +- internal/provisioners/provisioner.go | 2 +- internal/refactoring/move_statement.go | 2 +- internal/refactoring/move_statement_test.go | 2 +- internal/refactoring/move_validate_test.go | 2 +- internal/registry/regsrc/module.go | 2 +- internal/registry/regsrc/module_test.go | 2 +- internal/registry/response/module_versions.go | 2 +- internal/repl/repl.go | 4 +-- internal/replacefile/doc.go | 2 +- internal/states/checks.go | 8 ++--- internal/states/doc.go | 2 +- internal/states/instance_object.go | 4 +-- internal/states/instance_object_src.go | 2 +- internal/states/remote/state.go | 2 +- internal/states/remote/state_test.go | 6 ++-- internal/states/state.go | 12 +++---- internal/states/state_string.go | 4 +-- internal/states/state_test.go | 4 +-- internal/states/statefile/file.go | 2 +- internal/states/statefile/read.go | 4 +-- internal/states/statefile/version0.go | 2 +- internal/states/statefile/version1.go | 18 +++++----- internal/states/statefile/version2.go | 18 +++++----- internal/states/statefile/version3_upgrade.go | 2 +- internal/states/statefile/version4.go | 6 ++-- internal/states/statefile/write.go | 6 ++-- internal/states/statemgr/doc.go | 4 +-- internal/states/statemgr/lineage.go | 4 +-- internal/states/statemgr/locker.go | 10 +++--- internal/states/statemgr/persistent.go | 4 +-- .../states/statemgr/testdata/lockstate.go | 2 +- internal/states/statemgr/transient.go | 2 +- internal/states/sync.go | 2 +- internal/terminal/impl_windows.go | 2 +- internal/terminal/streams.go | 12 +++---- internal/terminal/testing.go | 2 +- internal/tfdiags/contextual.go | 2 +- internal/tfdiags/sourceless.go | 2 +- internal/tofu/context.go | 22 ++++++------ internal/tofu/context_apply.go | 6 ++-- internal/tofu/context_apply2_test.go | 4 +-- internal/tofu/context_apply_checks_test.go | 2 +- internal/tofu/context_apply_test.go | 36 +++++++++---------- internal/tofu/context_eval.go | 2 +- internal/tofu/context_eval_test.go | 2 +- internal/tofu/context_import.go | 2 +- internal/tofu/context_plan.go | 30 ++++++++-------- internal/tofu/context_plan2_test.go | 12 +++---- internal/tofu/context_plan_test.go | 2 +- internal/tofu/context_plugins.go | 8 ++--- internal/tofu/context_refresh.go | 2 +- internal/tofu/context_test.go | 6 ++-- internal/tofu/eval_context.go | 2 +- internal/tofu/eval_context_builtin.go | 2 +- internal/tofu/eval_variable.go | 8 ++--- internal/tofu/eval_variable_test.go | 2 +- internal/tofu/evaluate.go | 6 ++-- internal/tofu/graph.go | 6 ++-- internal/tofu/graph_builder.go | 2 +- internal/tofu/graph_builder_apply.go | 2 +- internal/tofu/graph_builder_eval.go | 2 +- internal/tofu/graph_builder_plan.go | 2 +- internal/tofu/graph_dot.go | 2 +- internal/tofu/hook.go | 16 ++++----- internal/tofu/hook_stop.go | 2 +- internal/tofu/node_external_reference.go | 4 +-- .../tofu/node_resource_abstract_instance.go | 14 ++++---- internal/tofu/node_resource_apply_instance.go | 14 ++++---- .../tofu/node_resource_destroy_deposed.go | 4 +-- internal/tofu/node_resource_import.go | 2 +- internal/tofu/node_resource_plan.go | 4 +-- internal/tofu/node_resource_plan_instance.go | 4 +-- internal/tofu/node_resource_plan_orphan.go | 2 +- internal/tofu/node_resource_validate.go | 2 +- internal/tofu/node_root_variable.go | 2 +- internal/tofu/node_root_variable_test.go | 2 +- internal/tofu/schemas.go | 2 +- internal/tofu/transform_check_starter.go | 2 +- internal/tofu/transform_diff.go | 4 +-- internal/tofu/transform_external_reference.go | 2 +- internal/tofu/transform_orphan_count.go | 2 +- internal/tofu/transform_orphan_resource.go | 2 +- internal/tofu/transform_reference.go | 4 +-- .../tofu/transform_transitive_reduction.go | 2 +- internal/tofu/ui_input.go | 2 +- internal/tofu/upgrade_resource_state.go | 2 +- internal/tofu/variables.go | 18 +++++----- internal/tofu/version_required.go | 2 +- 192 files changed, 545 insertions(+), 547 deletions(-) diff --git a/commands.go b/commands.go index 350b08c19f..51c359ccdd 100644 --- a/commands.go +++ b/commands.go @@ -112,7 +112,7 @@ func initCommands( AllowExperimentalFeatures: ExperimentsAllowed(), } - // The command list is included in the terraform -help + // The command list is included in the tofu -help // output, which is in turn included in the docs at // website/docs/cli/commands/index.html.markdown; if you // add, remove or reclassify commands then consider updating diff --git a/internal/backend/local/backend_plan_test.go b/internal/backend/local/backend_plan_test.go index 4f931ba0e6..2747efeeda 100644 --- a/internal/backend/local/backend_plan_test.go +++ b/internal/backend/local/backend_plan_test.go @@ -121,16 +121,16 @@ func TestLocal_planNoConfig(t *testing.T) { func TestLocal_plan_context_error(t *testing.T) { b := TestLocal(t) - // This is an intentionally-invalid value to make terraform.NewContext fail + // This is an intentionally-invalid value to make tofu.NewContext fail // when b.Operation calls it. // NOTE: This test was originally using a provider initialization failure - // as its forced error condition, but terraform.NewContext is no longer + // as its forced error condition, but tofu.NewContext is no longer // responsible for checking that. Invalid parallelism is the last situation - // where terraform.NewContext can return error diagnostics, and arguably + // where tofu.NewContext can return error diagnostics, and arguably // we should be validating this argument at the UI layer anyway, so perhaps - // in future we'll make terraform.NewContext never return errors and then + // in future we'll make tofu.NewContext never return errors and then // this test will become redundant, because its purpose is specifically - // to test that we properly unlock the state if terraform.NewContext + // to test that we properly unlock the state if tofu.NewContext // returns an error. if b.ContextOpts == nil { b.ContextOpts = &tofu.ContextOpts{} diff --git a/internal/backend/remote/testing.go b/internal/backend/remote/testing.go index 249ceb7505..361162fc6e 100644 --- a/internal/backend/remote/testing.go +++ b/internal/backend/remote/testing.go @@ -44,7 +44,7 @@ var ( }) ) -// mockInput is a mock implementation of terraform.UIInput. +// mockInput is a mock implementation of tofu.UIInput. type mockInput struct { answers map[string]string } diff --git a/internal/builtin/providers/tf/provider.go b/internal/builtin/providers/tf/provider.go index a51d85c31e..a8b2d299a7 100644 --- a/internal/builtin/providers/tf/provider.go +++ b/internal/builtin/providers/tf/provider.go @@ -13,7 +13,7 @@ import ( // Provider is an implementation of providers.Interface type Provider struct{} -// NewProvider returns a new terraform provider +// NewProvider returns a new tofu provider func NewProvider() providers.Interface { return &Provider{} } @@ -32,7 +32,7 @@ func (p *Provider) GetProviderSchema() providers.GetProviderSchemaResponse { // ValidateProviderConfig is used to validate the configuration values. func (p *Provider) ValidateProviderConfig(req providers.ValidateProviderConfigRequest) providers.ValidateProviderConfigResponse { - // At this moment there is nothing to configure for the terraform provider, + // At this moment there is nothing to configure for the tofu provider, // so we will happily return without taking any action var res providers.ValidateProviderConfigResponse res.PreparedConfig = req.Config @@ -43,7 +43,7 @@ func (p *Provider) ValidateProviderConfig(req providers.ValidateProviderConfigRe func (p *Provider) ValidateDataResourceConfig(req providers.ValidateDataResourceConfigRequest) providers.ValidateDataResourceConfigResponse { // FIXME: move the backend configuration validate call that's currently // inside the read method into here so that we can catch provider configuration - // errors in terraform validate as well as during terraform plan. + // errors in tofu validate as well as during tofu plan. var res providers.ValidateDataResourceConfigResponse // This should not happen diff --git a/internal/checks/doc.go b/internal/checks/doc.go index c1f137852c..e87839aa89 100644 --- a/internal/checks/doc.go +++ b/internal/checks/doc.go @@ -3,6 +3,6 @@ // Package checks contains the models for representing various kinds of // declarative condition checks that can be defined in a Terraform module -// and then evaluated and reported by Terraform Core during plan and apply +// and then evaluated and reported by OpenTofu Core during plan and apply // operations. package checks diff --git a/internal/checks/state.go b/internal/checks/state.go index 52fd6b2ba4..b9e18368bc 100644 --- a/internal/checks/state.go +++ b/internal/checks/state.go @@ -43,7 +43,7 @@ type State struct { // the evaluation status for a particular addrs.ConfigCheckable address. // // Its initial state, at the beginning of a run, is that it doesn't even know -// how many checkable objects will be dynamically-declared yet. Terraform Core +// how many checkable objects will be dynamically-declared yet. OpenTofu Core // will notify the State object of the associated Checkables once // it has decided the appropriate expansion of that configuration object, // and then will gradually report the results of each check once the graph @@ -61,11 +61,11 @@ type configCheckableState struct { // objects represents the set of dynamic checkable objects associated // with this configuration construct. This is initially nil to represent // that we don't know the objects yet, and is replaced by a non-nil map - // once Terraform Core reports the expansion of this configuration + // once OpenTofu Core reports the expansion of this configuration // construct. // // The leaf Status values will initially be StatusUnknown - // and then gradually updated by Terraform Core as it visits the + // and then gradually updated by OpenTofu Core as it visits the // individual checkable objects and reports their status. objects addrs.Map[addrs.Checkable, map[addrs.CheckRuleType][]Status] } @@ -187,7 +187,7 @@ func (c *State) AggregateCheckStatus(addr addrs.ConfigCheckable) Status { // ObjectCheckStatus returns a summarization of all of the check results // for a particular checkable object into a single status. // -// The given address must refer to a checkable object that Terraform Core +// The given address must refer to a checkable object that OpenTofu Core // previously reported while doing a graph walk, or this method will panic. func (c *State) ObjectCheckStatus(addr addrs.Checkable) Status { c.mu.Lock() diff --git a/internal/checks/state_report.go b/internal/checks/state_report.go index 66a32c4494..e4bbfd1b87 100644 --- a/internal/checks/state_report.go +++ b/internal/checks/state_report.go @@ -9,10 +9,10 @@ import ( "github.com/opentofu/opentofu/internal/addrs" ) -// These are the "Report"-prefixed methods of Checks used by Terraform Core +// These are the "Report"-prefixed methods of Checks used by OpenTofu Core // to gradually signal the results of checks during a plan or apply operation. -// ReportCheckableObjects is the interface by which Terraform Core should +// ReportCheckableObjects is the interface by which OpenTofu Core should // tell the State object which specific checkable objects were declared // by the given configuration object. // @@ -33,7 +33,7 @@ func (c *State) ReportCheckableObjects(configAddr addrs.ConfigCheckable, objectA } // At this point we pre-populate all of the check results as StatusUnknown, - // so that even if we never hear from Terraform Core again we'll still + // so that even if we never hear from OpenTofu Core again we'll still // remember that these results were all pending. st.objects = addrs.MakeMap[addrs.Checkable, map[addrs.CheckRuleType][]Status]() for _, objectAddr := range objectAddrs { @@ -54,7 +54,7 @@ func (c *State) ReportCheckableObjects(configAddr addrs.ConfigCheckable, objectA } } -// ReportCheckResult is the interface by which Terraform Core should tell the +// ReportCheckResult is the interface by which OpenTofu Core should tell the // State object the result of a specific check for an object that was // previously registered with ReportCheckableObjects. // diff --git a/internal/cloud/backend.go b/internal/cloud/backend.go index 2efe151f52..014b19a7ed 100644 --- a/internal/cloud/backend.go +++ b/internal/cloud/backend.go @@ -46,7 +46,7 @@ const ( ) // Cloud is an implementation of EnhancedBackend in service of the cloud backend -// integration for Terraform CLI. This backend is not intended to be surfaced at the user level and +// integration for OpenTofu CLI. This backend is not intended to be surfaced at the user level and // is instead an implementation detail of cloud.Cloud. type Cloud struct { // CLI and Colorize control the CLI output. If CLI is nil then no CLI @@ -55,7 +55,7 @@ type Cloud struct { CLIColor *colorstring.Colorize // ContextOpts are the base context options to set when initializing a - // new Terraform context. Many of these will be overridden or merged by + // new OpenTofu context. Many of these will be overridden or merged by // Operation. See Operation for more details. ContextOpts *tofu.ContextOpts @@ -94,7 +94,7 @@ type Cloud struct { opLock sync.Mutex // ignoreVersionConflict, if true, will disable the requirement that the - // local Terraform version matches the remote workspace's configured + // local OpenTofu version matches the remote workspace's configured // version. This will also cause VerifyWorkspaceTerraformVersion to return // a warning diagnostic instead of an error. ignoreVersionConflict bool @@ -362,7 +362,7 @@ func (b *Cloud) Configure(obj cty.Value) tfdiags.Diagnostics { if parseErr != nil || currentAPIVersion.LessThan(desiredAPIVersion) { log.Printf("[TRACE] API version check failed; want: >= %s, got: %s", desiredAPIVersion.Original(), currentAPIVersion) if b.runningInAutomation { - // It should never be possible for this Terraform process to be mistakenly + // It should never be possible for this OpenTofu process to be mistakenly // used internally within an unsupported Terraform Enterprise install - but // just in case it happens, give an actionable error. diags = diags.Append( @@ -699,7 +699,7 @@ func (b *Cloud) StateMgr(name string) (statemgr.Full, error) { remoteTFVersion = workspace.TerraformVersion - // Attempt to set the new workspace to use this version of Terraform. This + // Attempt to set the new workspace to use this version of OpenTofu. This // can fail if there's no enabled tool_version whose name matches our // version string, but that's expected sometimes -- just warn and continue. versionOptions := tfe.WorkspaceUpdateOptions{ @@ -914,8 +914,8 @@ func (b *Cloud) cancel(cancelCtx context.Context, op *backend.Operation, r *tfe. } // IgnoreVersionConflict allows commands to disable the fall-back check that -// the local Terraform version matches the remote workspace's configured -// Terraform version. This should be called by commands where this check is +// the local OpenTofu version matches the remote workspace's configured +// OpenTofu version. This should be called by commands where this check is // unnecessary, such as those performing remote operations, or read-only // operations. It will also be called if the user uses a command-line flag to // override this check. @@ -923,8 +923,8 @@ func (b *Cloud) IgnoreVersionConflict() { b.ignoreVersionConflict = true } -// VerifyWorkspaceTerraformVersion compares the local Terraform version against -// the workspace's configured Terraform version. If they are compatible, this +// VerifyWorkspaceTerraformVersion compares the local OpenTofu version against +// the workspace's configured OpenTofu version. If they are compatible, this // means that there are no state compatibility concerns, so it returns no // diagnostics. // @@ -951,13 +951,13 @@ func (b *Cloud) VerifyWorkspaceTerraformVersion(workspaceName string) tfdiags.Di } // If the workspace has the pseudo-version "latest", all bets are off. We - // cannot reasonably determine what the intended Terraform version is, so + // cannot reasonably determine what the intended OpenTofu version is, so // we'll skip version verification. if workspace.TerraformVersion == "latest" { return nil } - // If the workspace has execution-mode set to local, the remote Terraform + // If the workspace has execution-mode set to local, the remote OpenTofu // version is effectively meaningless, so we'll skip version verification. if isLocalExecutionMode(workspace.ExecutionMode) { return nil diff --git a/internal/cloud/backend_apply.go b/internal/cloud/backend_apply.go index 96fcdd65f6..85ce764494 100644 --- a/internal/cloud/backend_apply.go +++ b/internal/cloud/backend_apply.go @@ -298,7 +298,7 @@ func unusableSavedPlanError(status tfe.RunStatus, url string) error { reason = "The given plan file refers to a plan that had errors and did not complete successfully. It cannot be applied." case tfe.RunPlannedAndFinished: // Note: planned and finished can also indicate a plan-only run, but - // terraform plan can't create a saved plan for a plan-only run, so we + // tofu plan can't create a saved plan for a plan-only run, so we // know it's no-changes in this case. summary = "Saved plan has no changes" reason = "The given plan file contains no changes, so it cannot be applied." diff --git a/internal/cloud/backend_plan.go b/internal/cloud/backend_plan.go index d13cb745ea..c1c1960fc6 100644 --- a/internal/cloud/backend_plan.go +++ b/internal/cloud/backend_plan.go @@ -116,7 +116,7 @@ func (b *Cloud) plan(stopCtx, cancelCtx context.Context, op *backend.Operation, b.CLI.Output(b.Colorize().Color(strings.TrimSpace(header) + "\n")) } - // Plan-only means they ran terraform plan without -out. + // Plan-only means they ran tofu plan without -out. provisional := op.PlanOutPath != "" planOnly := op.Type == backend.OperationTypePlan && !provisional diff --git a/internal/cloud/backend_show.go b/internal/cloud/backend_show.go index 40a1320912..d4242b44bb 100644 --- a/internal/cloud/backend_show.go +++ b/internal/cloud/backend_show.go @@ -16,7 +16,7 @@ import ( // ShowPlanForRun downloads the JSON plan output for the specified cloud run // (either the redacted or unredacted format, per the caller's request), and // returns it in a cloudplan.RemotePlanJSON wrapper struct (along with various -// metadata required by terraform show). It's intended for use by the terraform +// metadata required by tofu show). It's intended for use by the tofu // show command, in order to format and display a saved cloud plan. func (b *Cloud) ShowPlanForRun(ctx context.Context, runID, runHostname string, redacted bool) (*cloudplan.RemotePlanJSON, error) { var jsonBytes []byte diff --git a/internal/cloud/backend_show_test.go b/internal/cloud/backend_show_test.go index 6ca36ed1f5..7240d3ecc1 100644 --- a/internal/cloud/backend_show_test.go +++ b/internal/cloud/backend_show_test.go @@ -14,7 +14,7 @@ import ( ) // A brief discourse on the theory of testing for this feature. Doing -// `terraform show cloudplan.tfplan` relies on the correctness of the following +// `tofu show cloudplan.tfplan` relies on the correctness of the following // behaviors: // // 1. TFC API returns redacted or unredacted plan JSON on request, if permission diff --git a/internal/cloud/e2e/helper_test.go b/internal/cloud/e2e/helper_test.go index 7c60c16306..eda7ddb150 100644 --- a/internal/cloud/e2e/helper_test.go +++ b/internal/cloud/e2e/helper_test.go @@ -271,7 +271,7 @@ func skipWithoutRemoteTerraformVersion(t *testing.T) { findTfVersion: for { - // TODO: update go-tfe Read() to retrieve a terraform version by name. + // TODO: update go-tfe Read() to retrieve a tofu version by name. // Currently you can only retrieve by ID. tfVersionList, err := tfeClient.Admin.TerraformVersions.List(context.Background(), opts) if err != nil { diff --git a/internal/cloud/e2e/migrate_state_tfc_to_tfc_test.go b/internal/cloud/e2e/migrate_state_tfc_to_tfc_test.go index 9dc95a5ebd..b4fc9a53c8 100644 --- a/internal/cloud/e2e/migrate_state_tfc_to_tfc_test.go +++ b/internal/cloud/e2e/migrate_state_tfc_to_tfc_test.go @@ -26,8 +26,8 @@ func Test_migrate_tfc_to_tfc_single_workspace(t *testing.T) { wsName := "prod" // Creating the workspace here instead of it being created // dynamically in the Cloud StateMgr because we want to ensure that - // the terraform version selected for the workspace matches the - // terraform version of this current branch. + // the tofu version selected for the workspace matches the + // tofu version of this current branch. _ = createWorkspace(t, orgName, tfe.WorkspaceCreateOptions{ Name: tfe.String("prod"), TerraformVersion: tfe.String(tfversion.String()), @@ -167,7 +167,7 @@ func Test_migrate_tfc_to_tfc_single_workspace(t *testing.T) { { prep: func(t *testing.T, orgName, dir string) { tag := "app" - // This is only here to ensure that the updated terraform version is + // This is only here to ensure that the updated tofu version is // present in the workspace, and it does not default to a lower // version that does not support `cloud`. _ = createWorkspace(t, orgName, tfe.WorkspaceCreateOptions{ @@ -263,7 +263,7 @@ func Test_migrate_tfc_to_tfc_multiple_workspace(t *testing.T) { prep: func(t *testing.T, orgName, dir string) { name := "service" // Doing this here instead of relying on dynamic workspace creation - // because we want to set the terraform version here so that it is + // because we want to set the tofu version here so that it is // using the right version for post init operations. _ = createWorkspace(t, orgName, tfe.WorkspaceCreateOptions{ Name: tfe.String(name), diff --git a/internal/cloud/migration.go b/internal/cloud/migration.go index 7a01444fe8..2ed1b5f70b 100644 --- a/internal/cloud/migration.go +++ b/internal/cloud/migration.go @@ -59,7 +59,7 @@ func DetectConfigChangeType(wdState *legacy.BackendState, config *configs.Backen // "uninit" here means that the working directory is totally uninitialized, // even taking into account the possibility of implied local state that - // therefore doesn't typically require explicit "terraform init". + // therefore doesn't typically require explicit "tofu init". wdIsUninit := wdState == nil && !haveLocalStates switch { diff --git a/internal/cloud/state.go b/internal/cloud/state.go index e292dd0971..a753dcff12 100644 --- a/internal/cloud/state.go +++ b/internal/cloud/state.go @@ -597,7 +597,7 @@ func (s *State) readSnapshotIntervalHeader(status int, header http.Header) { } // tfeOutputToCtyValue decodes a combination of TFE output value and detailed-type to create a -// cty value that is suitable for use in terraform. +// cty value that is suitable for use in tofu. func tfeOutputToCtyValue(output tfe.StateVersionOutput) (cty.Value, error) { var result cty.Value bufType, err := json.Marshal(output.DetailedType) diff --git a/internal/cloud/testing.go b/internal/cloud/testing.go index e396248077..8cb9dbf28c 100644 --- a/internal/cloud/testing.go +++ b/internal/cloud/testing.go @@ -58,7 +58,7 @@ var ( } ) -// mockInput is a mock implementation of terraform.UIInput. +// mockInput is a mock implementation of tofu.UIInput. type mockInput struct { answers map[string]string } diff --git a/internal/command/command.go b/internal/command/command.go index 6e7b5ba08f..2ac44aa0f3 100644 --- a/internal/command/command.go +++ b/internal/command/command.go @@ -23,8 +23,8 @@ const PluginPathFile = "plugin_path" const pluginMachineName = runtime.GOOS + "_" + runtime.GOARCH // DefaultPluginVendorDir is the location in the config directory to look for -// user-added plugin binaries. Terraform only reads from this path if it -// exists, it is never created by terraform. +// user-added plugin binaries. OpenTofu only reads from this path if it +// exists, it is never created by tofu. const DefaultPluginVendorDir = "terraform.d/plugins/" + pluginMachineName // DefaultStateFilename is the default filename used for the state file. diff --git a/internal/command/command_test.go b/internal/command/command_test.go index 82d8c59488..d927830241 100644 --- a/internal/command/command_test.go +++ b/internal/command/command_test.go @@ -734,7 +734,7 @@ func testInputMap(t *testing.T, answers map[string]string) func() { // // If such a block isn't present, or if it isn't empty, then an error will // be returned about the backend configuration having changed and that -// "terraform init" must be run, since the test backend config cache created +// "tofu init" must be run, since the test backend config cache created // by this function contains the hash for an empty configuration. func testBackendState(t *testing.T, s *states.State, c int) (*legacy.State, *httptest.Server) { t.Helper() diff --git a/internal/command/console_test.go b/internal/command/console_test.go index a63db5ac45..c7a675215a 100644 --- a/internal/command/console_test.go +++ b/internal/command/console_test.go @@ -105,9 +105,9 @@ func TestConsole_tfvars(t *testing.T) { } func TestConsole_unsetRequiredVars(t *testing.T) { - // This test is verifying that it's possible to run "terraform console" + // This test is verifying that it's possible to run "tofu console" // without providing values for all required variables, without - // "terraform console" producing an interactive prompt for those variables + // "tofu console" producing an interactive prompt for those variables // or producing errors. Instead, it should allow evaluation in that // partial context but see the unset variables values as being unknown. // diff --git a/internal/command/fmt.go b/internal/command/fmt.go index 1d578ca6ae..a53d7bb62a 100644 --- a/internal/command/fmt.go +++ b/internal/command/fmt.go @@ -34,7 +34,7 @@ var ( } ) -// FmtCommand is a Command implementation that rewrites Terraform config +// FmtCommand is a Command implementation that rewrites OpenTofu config // files to a canonical format and style. type FmtCommand struct { Meta @@ -256,7 +256,7 @@ func (c *FmtCommand) processDir(path string, stdout io.Writer) tfdiags.Diagnosti } // We do not recurse into child directories by default because we - // want to mimic the file-reading behavior of "terraform plan", etc, + // want to mimic the file-reading behavior of "tofu plan", etc, // operating on one module at a time. continue } diff --git a/internal/command/format/format.go b/internal/command/format/format.go index a438ff7651..13f4737b4d 100644 --- a/internal/command/format/format.go +++ b/internal/command/format/format.go @@ -1,12 +1,12 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -// Package format contains helpers for formatting various Terraform +// Package format contains helpers for formatting various OpenTofu // structures for human-readabout output. // -// This package is used by the official Terraform CLI in formatting any +// This package is used by the official OpenTofu CLI in formatting any // output and is exported to encourage non-official frontends to mimic the -// output formatting as much as possible so that text formats of Terraform +// output formatting as much as possible so that text formats of OpenTofu // structures have a consistent look and feel. package format diff --git a/internal/command/format/object_id.go b/internal/command/format/object_id.go index 8fbcc389a9..e2895a162f 100644 --- a/internal/command/format/object_id.go +++ b/internal/command/format/object_id.go @@ -16,7 +16,7 @@ import ( // If such an attribute is found, its name and string value intended for // display are returned. Both returned strings are empty if no such attribute // exists, in which case the caller should assume that the resource instance -// address within the Terraform configuration is the best available identifier. +// address within the OpenTofu configuration is the best available identifier. // // This is only a best-effort sort of thing, relying on naming conventions in // our resource type schemas. The result is not guaranteed to be unique, but diff --git a/internal/command/get_test.go b/internal/command/get_test.go index e20cc90088..d8d1c6b67b 100644 --- a/internal/command/get_test.go +++ b/internal/command/get_test.go @@ -83,7 +83,7 @@ func TestGet_update(t *testing.T) { } func TestGet_cancel(t *testing.T) { - // This test runs `terraform get` as if SIGINT (or similar on other + // This test runs `tofu get` as if SIGINT (or similar on other // platforms) were sent to it, testing that it is interruptible. wd := tempWorkingDirFixture(t, "init-registry-module") diff --git a/internal/command/graph.go b/internal/command/graph.go index 40c4fb6eb9..5fef232eb4 100644 --- a/internal/command/graph.go +++ b/internal/command/graph.go @@ -135,7 +135,7 @@ func (c *GraphCommand) Run(args []string) int { case "apply": plan := lr.Plan - // Historically "terraform graph" would allow the nonsensical request to + // Historically "tofu graph" would allow the nonsensical request to // render an apply graph without a plan, so we continue to support that // here, though perhaps one day this should be an error. if lr.Plan == nil { diff --git a/internal/command/import.go b/internal/command/import.go index 53b417f84d..97ba0a4194 100644 --- a/internal/command/import.go +++ b/internal/command/import.go @@ -24,7 +24,7 @@ import ( ) // ImportCommand is a cli.Command implementation that imports resources -// into the Terraform state. +// into the OpenTofu state. type ImportCommand struct { Meta } @@ -112,7 +112,7 @@ func (c *ImportCommand) Run(args []string) int { // Verify that the given address points to something that exists in config. // This is to reduce the risk that a typo in the resource address will - // import something that Terraform will want to immediately destroy on + // import something that OpenTofu will want to immediately destroy on // the next plan, and generally acts as a reassurance of user intent. targetConfig := config.DescendentForInstance(addr.Module) if targetConfig == nil { @@ -206,7 +206,7 @@ func (c *ImportCommand) Run(args []string) int { } opReq.View = views.NewOperation(arguments.ViewHuman, c.RunningInAutomation, c.View) - // Check remote Terraform version is compatible + // Check remote OpenTofu version is compatible remoteVersionDiags := c.remoteVersionCheck(b, opReq.Workspace) diags = diags.Append(remoteVersionDiags) c.showDiagnostics(diags) diff --git a/internal/command/init.go b/internal/command/init.go index fa46be7e5a..7e41fc05b2 100644 --- a/internal/command/init.go +++ b/internal/command/init.go @@ -249,11 +249,11 @@ func (c *InitCommand) Run(args []string) int { // whole configuration tree. config, confDiags := c.loadConfigWithTests(path, testsDirectory) // configDiags will be handled after the version constraint check, since an - // incorrect version of terraform may be producing errors for configuration + // incorrect version of tofu may be producing errors for configuration // constructs added in later versions. // Before we go further, we'll check to make sure none of the modules in - // the configuration declare that they don't support this Terraform + // the configuration declare that they don't support this OpenTofu // version, so we can produce a version-related error message rather than // potentially-confusing downstream errors. versionDiags := tofu.CheckCoreVersionRequirements(config) @@ -515,9 +515,9 @@ func (c *InitCommand) getProviders(ctx context.Context, config *configs.Config, ctx, span := tracer.Start(ctx, "install providers") defer span.End() - // Dev overrides cause the result of "terraform init" to be irrelevant for + // Dev overrides cause the result of "tofu init" to be irrelevant for // any overridden providers, so we'll warn about it to avoid later - // confusion when Terraform ends up using a different provider than the + // confusion when OpenTofu ends up using a different provider than the // lock file called for. diags = diags.Append(c.providerDevOverrideInitWarnings()) @@ -560,7 +560,7 @@ func (c *InitCommand) getProviders(ctx context.Context, config *configs.Config, inst = c.providerInstaller() } else { // If the user passes at least one -plugin-dir then that circumvents - // the usual sources and forces Terraform to consult only the given + // the usual sources and forces OpenTofu to consult only the given // directories. Anything not available in one of those directories // is not available for installation. source := c.providerCustomLocalDirectorySource(pluginDirs) @@ -826,7 +826,7 @@ func (c *InitCommand) getProviders(ctx context.Context, config *configs.Config, // We're going to use this opportunity to track if we have any // "incomplete" installs of providers. An incomplete install is // when we are only going to write the local hashes into our lock - // file which means a `terraform init` command will fail in future + // file which means a `tofu init` command will fail in future // when used on machines of a different architecture. // // We want to print a warning about this. @@ -948,7 +948,7 @@ func (c *InitCommand) getProviders(ctx context.Context, config *configs.Config, if previousLocks.Empty() { // A change from empty to non-empty is special because it suggests - // we're running "terraform init" for the first time against a + // we're running "tofu init" for the first time against a // new configuration. In that case we'll take the opportunity to // say a little about what the dependency lock file is, for new // users or those who are upgrading from a previous Terraform @@ -1241,7 +1241,7 @@ again to reinitialize your working directory. ` // providerProtocolTooOld is a message sent to the CLI UI if the provider's -// supported protocol versions are too old for the user's version of terraform, +// supported protocol versions are too old for the user's version of tofu, // but a newer version of the provider is compatible. const providerProtocolTooOld = `Provider %q v%s is not compatible with OpenTofu %s. Provider version %s is the latest compatible version. Select it with the following version constraint: @@ -1254,8 +1254,8 @@ Consult the documentation for this provider for more information on compatibilit ` // providerProtocolTooNew is a message sent to the CLI UI if the provider's -// supported protocol versions are too new for the user's version of terraform, -// and the user could either upgrade terraform or choose an older version of the +// supported protocol versions are too new for the user's version of tofu, +// and the user could either upgrade tofu or choose an older version of the // provider. const providerProtocolTooNew = `Provider %q v%s is not compatible with OpenTofu %s. You need to downgrade to v%s or earlier. Select it with the following constraint: diff --git a/internal/command/init_test.go b/internal/command/init_test.go index 03a6451855..65636c5345 100644 --- a/internal/command/init_test.go +++ b/internal/command/init_test.go @@ -334,7 +334,7 @@ func TestInit_backendConfigFile(t *testing.T) { } }) - // the backend config file must not be a full terraform block + // the backend config file must not be a full tofu block t.Run("full-backend-config-file", func(t *testing.T) { ui := new(cli.MockUi) view, _ := testView(t) diff --git a/internal/command/jsonchecks/checks.go b/internal/command/jsonchecks/checks.go index f600074776..3b3f48dd8d 100644 --- a/internal/command/jsonchecks/checks.go +++ b/internal/command/jsonchecks/checks.go @@ -70,7 +70,7 @@ func MarshalCheckStates(results *states.CheckResults) []byte { // checkResultStatic is the container for the static, configuration-driven // idea of "checkable object" -- a resource block with conditions, for example -- // which ensures that we can always say _something_ about each checkable -// object in the configuration even if Terraform Core encountered an error +// object in the configuration even if OpenTofu Core encountered an error // before being able to determine the dynamic instances of the checkable object. type checkResultStatic struct { // Address is the address of the checkable object this result relates to. @@ -86,7 +86,7 @@ type checkResultStatic struct { } // checkResultDynamic describes the check result for a dynamic object, which -// results from Terraform Core evaluating the "expansion" (e.g. count or for_each) +// results from OpenTofu Core evaluating the "expansion" (e.g. count or for_each) // of the containing object or its own containing module(s). type checkResultDynamic struct { // Address augments the Address of the containing checkResultStatic with @@ -99,7 +99,7 @@ type checkResultDynamic struct { // Problems describes some optional details associated with a failure // status, describing what fails. // - // This does not include the errors for status "error", because Terraform + // This does not include the errors for status "error", because OpenTofu // Core emits those separately as normal diagnostics. However, if a // particular object has a mixture of conditions that failed and conditions // that were invalid then status can be "error" while simultaneously diff --git a/internal/command/jsonconfig/config.go b/internal/command/jsonconfig/config.go index 8a91d15ef4..ac4ffdf366 100644 --- a/internal/command/jsonconfig/config.go +++ b/internal/command/jsonconfig/config.go @@ -26,7 +26,7 @@ type config struct { // ProviderConfig describes all of the provider configurations throughout the // configuration tree, flattened into a single map for convenience since -// provider configurations are the one concept in Terraform that can span across +// provider configurations are the one concept in OpenTofu that can span across // module boundaries. type providerConfig struct { Name string `json:"name,omitempty"` @@ -119,7 +119,7 @@ type provisioner struct { Expressions map[string]interface{} `json:"expressions,omitempty"` } -// Marshal returns the json encoding of terraform configuration. +// Marshal returns the json encoding of tofu configuration. func Marshal(c *configs.Config, schemas *tofu.Schemas) ([]byte, error) { var output config @@ -333,7 +333,7 @@ func marshalModule(c *configs.Config, schemas *tofu.Schemas, addr string) (modul dependencies := make([]string, len(v.DependsOn)) for i, d := range v.DependsOn { ref, diags := addrs.ParseRef(d) - // we should not get an error here, because `terraform validate` + // we should not get an error here, because `tofu validate` // would have complained well before this point, but if we do we'll // silenty skip it. if !diags.HasErrors() { @@ -428,7 +428,7 @@ func marshalModuleCall(c *configs.Config, mc *configs.ModuleCall, schemas *tofu. dependencies := make([]string, len(mc.DependsOn)) for i, d := range mc.DependsOn { ref, diags := addrs.ParseRef(d) - // we should not get an error here, because `terraform validate` + // we should not get an error here, because `tofu validate` // would have complained well before this point, but if we do we'll // silenty skip it. if !diags.HasErrors() { @@ -501,7 +501,7 @@ func marshalResources(resources map[string]*configs.Resource, schemas *tofu.Sche dependencies := make([]string, len(v.DependsOn)) for i, d := range v.DependsOn { ref, diags := addrs.ParseRef(d) - // we should not get an error here, because `terraform validate` + // we should not get an error here, because `tofu validate` // would have complained well before this point, but if we do we'll // silenty skip it. if !diags.HasErrors() { diff --git a/internal/command/jsonplan/plan.go b/internal/command/jsonplan/plan.go index c5d7964e71..40e1437ee3 100644 --- a/internal/command/jsonplan/plan.go +++ b/internal/command/jsonplan/plan.go @@ -297,7 +297,7 @@ func MarshalForLog( return output, nil } -// Marshal returns the json encoding of a terraform plan. +// Marshal returns the json encoding of a tofu plan. func Marshal( config *configs.Config, p *plans.Plan, diff --git a/internal/command/jsonstate/state.go b/internal/command/jsonstate/state.go index 1e1fe50627..f8187491b9 100644 --- a/internal/command/jsonstate/state.go +++ b/internal/command/jsonstate/state.go @@ -29,7 +29,7 @@ const ( DataResourceMode = "data" ) -// State is the top-level representation of the json format of a terraform +// State is the top-level representation of the json format of a tofu // state. type State struct { FormatVersion string `json:"format_version,omitempty"` @@ -104,10 +104,10 @@ type Resource struct { // addresses relative to the containing module. DependsOn []string `json:"depends_on,omitempty"` - // Tainted is true if the resource is tainted in terraform state. + // Tainted is true if the resource is tainted in tofu state. Tainted bool `json:"tainted,omitempty"` - // Deposed is set if the resource is deposed in terraform state. + // Deposed is set if the resource is deposed in tofu state. DeposedKey string `json:"deposed_key,omitempty"` } @@ -189,7 +189,7 @@ func MarshalForLog(sf *statefile.File, schemas *tofu.Schemas) (*State, error) { return output, nil } -// Marshal returns the json encoding of a terraform state. +// Marshal returns the json encoding of a tofu state. func Marshal(sf *statefile.File, schemas *tofu.Schemas) ([]byte, error) { output, err := MarshalForLog(sf, schemas) if err != nil { @@ -292,7 +292,7 @@ func marshalRootModule(s *states.State, schemas *tofu.Schemas) (Module, error) { } // marshalModules is an ungainly recursive function to build a module structure -// out of terraform state. +// out of tofu state. func marshalModules( s *states.State, schemas *tofu.Schemas, diff --git a/internal/command/meta.go b/internal/command/meta.go index ae23a4bfc8..51f8e89d2c 100644 --- a/internal/command/meta.go +++ b/internal/command/meta.go @@ -50,7 +50,7 @@ type Meta struct { // WorkingDir is an object representing the "working directory" where we're // running commands. In the normal case this literally refers to the - // working directory of the Terraform process, though this can take on + // working directory of the OpenTofu process, though this can take on // a more symbolic meaning when the user has overridden default behavior // to specify a different working directory or to override the special // data directory where we'll persist settings that must survive between @@ -78,7 +78,7 @@ type Meta struct { Ui cli.Ui // Ui for output // Services provides access to remote endpoint information for - // "terraform-native' services running at a specific user-facing hostname. + // 'tofu-native' services running at a specific user-facing hostname. Services *disco.Disco // RunningInAutomation indicates that commands are being run by an @@ -89,7 +89,7 @@ type Meta struct { // commands, since the user consuming the output will not be // in a position to run such commands. // - // The intended use-case of this flag is when Terraform is running in + // The intended use-case of this flag is when OpenTofu is running in // some sort of workflow orchestration tool which is abstracting away // the specific commands being run. RunningInAutomation bool @@ -113,7 +113,7 @@ type Meta struct { // This is an accommodation for those who currently essentially ignore the // dependency lock file -- treating it only as transient working directory // state -- and therefore don't care if the plugin cache dir causes the - // checksums inside to only be sufficient for the computer where Terraform + // checksums inside to only be sufficient for the computer where OpenTofu // is currently running. // // We intend to remove this exception again (making the CLI configuration @@ -152,16 +152,16 @@ type Meta struct { ProviderDevOverrides map[addrs.Provider]getproviders.PackageLocalDir // UnmanagedProviders are a set of providers that exist as processes - // predating Terraform, which Terraform should use but not worry about the + // predating OpenTofu, which OpenTofu should use but not worry about the // lifecycle of. // // This is essentially a more extreme version of ProviderDevOverrides where - // Terraform doesn't even worry about how the provider server gets launched, - // just trusting that someone else did it before running Terraform. + // OpenTofu doesn't even worry about how the provider server gets launched, + // just trusting that someone else did it before running OpenTofu. UnmanagedProviders map[addrs.Provider]*plugin.ReattachConfig // AllowExperimentalFeatures controls whether a command that embeds this - // Meta is permitted to make use of experimental Terraform features. + // Meta is permitted to make use of experimental OpenTofu features. // // Set this field only during the initial creation of Meta. If you change // this field after calling methods of type Meta then the resulting @@ -262,7 +262,7 @@ type Meta struct { compactWarnings bool // Used with commands which write state to allow users to write remote - // state even if the remote and local Terraform versions don't match. + // state even if the remote and local OpenTofu versions don't match. ignoreRemoteVersion bool } @@ -328,7 +328,7 @@ func (m *Meta) DataDir() string { const ( // InputModeEnvVar is the environment variable that, if set to "false" or - // "0", causes terraform commands to behave as if the `-input=false` flag was + // "0", causes tofu commands to behave as if the `-input=false` flag was // specified. InputModeEnvVar = "TF_INPUT" ) @@ -442,7 +442,7 @@ func (m *Meta) InterruptibleContext(base context.Context) (context.Context, cont // // This method is just a substitute for passing a context directly to the // "Run" method of a command, which we can't do because that API is owned by -// mitchellh/cli rather than by Terraform. Use this only in situations +// mitchellh/cli rather than by OpenTofu. Use this only in situations // comparable to the context having been passed in as an argument to Run. // // If the caller (e.g. "package main") provided a context when it instantiated @@ -516,7 +516,7 @@ func (m *Meta) RunOperation(b backend.Enhanced, opReq *backend.Operation) (*back return op, nil } -// contextOpts returns the options to use to initialize a Terraform +// contextOpts returns the options to use to initialize a OpenTofu // context with the settings from this Meta. func (m *Meta) contextOpts() (*tofu.ContextOpts, error) { workspace, err := m.Workspace() @@ -563,8 +563,8 @@ func (m *Meta) defaultFlagSet(n string) *flag.FlagSet { } // ignoreRemoteVersionFlagSet add the ignore-remote version flag to suppress -// the error when the configured Terraform version on the remote workspace -// does not match the local Terraform version. +// the error when the configured OpenTofu version on the remote workspace +// does not match the local OpenTofu version. func (m *Meta) ignoreRemoteVersionFlagSet(n string) *flag.FlagSet { f := m.defaultFlagSet(n) @@ -737,11 +737,11 @@ func (m *Meta) showDiagnostics(vals ...interface{}) { } // WorkspaceNameEnvVar is the name of the environment variable that can be used -// to set the name of the Terraform workspace, overriding the workspace chosen -// by `terraform workspace select`. +// to set the name of the OpenTofu workspace, overriding the workspace chosen +// by `tofu workspace select`. // -// Note that this environment variable is ignored by `terraform workspace new` -// and `terraform workspace delete`. +// Note that this environment variable is ignored by `tofu workspace new` +// and `tofu workspace delete`. const WorkspaceNameEnvVar = "TF_WORKSPACE" var errInvalidWorkspaceNameEnvVar = fmt.Errorf("Invalid workspace name set using %s", WorkspaceNameEnvVar) diff --git a/internal/command/meta_backend.go b/internal/command/meta_backend.go index 0f48c2bba0..1fdc75e7e8 100644 --- a/internal/command/meta_backend.go +++ b/internal/command/meta_backend.go @@ -73,8 +73,8 @@ type BackendWithRemoteTerraformVersion interface { // Backend initializes and returns the backend for this CLI session. // -// The backend is used to perform the actual Terraform operations. This -// abstraction enables easily sliding in new Terraform behavior such as +// The backend is used to perform the actual OpenTofu operations. This +// abstraction enables easily sliding in new OpenTofu behavior such as // remote state storage, remote operations, etc. while allowing the CLI // to remain mostly identical. // @@ -88,7 +88,7 @@ type BackendWithRemoteTerraformVersion interface { // // A side-effect of this method is the population of m.backendState, recording // the final resolved backend configuration after dealing with overrides from -// the "terraform init" command line, etc. +// the "tofu init" command line, etc. func (m *Meta) Backend(opts *BackendOpts) (backend.Enhanced, tfdiags.Diagnostics) { var diags tfdiags.Diagnostics @@ -130,7 +130,7 @@ func (m *Meta) Backend(opts *BackendOpts) (backend.Enhanced, tfdiags.Diagnostics } suggestion := "To download the plugins required for this configuration, run:\n tofu init" if m.RunningInAutomation { - // Don't mention "terraform init" specifically if we're running in an automation wrapper + // Don't mention "tofu init" specifically if we're running in an automation wrapper suggestion = "You must install the required plugins before running OpenTofu operations." } diags = diags.Append(tfdiags.Sourceless( @@ -534,7 +534,7 @@ func (m *Meta) backendFromConfig(opts *BackendOpts) (backend.Backend, tfdiags.Di // ------------------------------------------------------------------------ // For historical reasons, current backend configuration for a working // directory is kept in a *state-like* file, using the legacy state - // structures in the Terraform package. It is not actually a Terraform + // structures in the OpenTofu package. It is not actually a OpenTofu // state, and so only the "backend" portion of it is actually used. // // The remainder of this code often confusingly refers to this as a "state", @@ -545,7 +545,7 @@ func (m *Meta) backendFromConfig(opts *BackendOpts) (backend.Backend, tfdiags.Di // Since the "real" state has since moved on to be represented by // states.State, we can recognize the special meaning of state that applies // to this function and its callees by their continued use of the - // otherwise-obsolete terraform.State. + // otherwise-obsolete tofu.State. // ------------------------------------------------------------------------ // Get the path to where we store a local cache of backend configuration @@ -772,7 +772,7 @@ func (m *Meta) determineInitReason(previousBackendType string, currentBackendTyp // backendFromState returns the initialized (not configured) backend directly // from the backend state. This should be used only when a user runs -// `terraform init -backend=false`. This function returns a local backend if +// `tofu init -backend=false`. This function returns a local backend if // there is no backend state or no backend configured. func (m *Meta) backendFromState(ctx context.Context) (backend.Backend, tfdiags.Diagnostics) { var diags tfdiags.Diagnostics @@ -811,7 +811,7 @@ func (m *Meta) backendFromState(ctx context.Context) (backend.Backend, tfdiags.D // The configuration saved in the working directory state file is used // in this case, since it will contain any additional values that - // were provided via -backend-config arguments on terraform init. + // were provided via -backend-config arguments on tofu init. schema := b.ConfigSchema() configVal, err := s.Backend.Config(schema) if err != nil { @@ -1268,7 +1268,7 @@ func (m *Meta) savedBackend(sMgr *clistate.LocalState) (backend.Backend, tfdiags // The configuration saved in the working directory state file is used // in this case, since it will contain any additional values that - // were provided via -backend-config arguments on terraform init. + // were provided via -backend-config arguments on tofu init. schema := b.ConfigSchema() configVal, err := s.Backend.Config(schema) if err != nil { @@ -1470,7 +1470,7 @@ func (m *Meta) ignoreRemoteVersionConflict(b backend.Backend) { } } -// Helper method to check the local Terraform version against the configured +// Helper method to check the local OpenTofu version against the configured // version in the remote workspace, returning diagnostics if they conflict. func (m *Meta) remoteVersionCheck(b backend.Backend, workspace string) tfdiags.Diagnostics { var diags tfdiags.Diagnostics @@ -1519,7 +1519,7 @@ func (m *Meta) assertSupportedCloudInitOptions(mode cloud.ConfigChangeMode) tfdi if m.migrateState { name := "-migrate-state" if m.forceInitCopy { - // -force copy implies -migrate-state in "terraform init", + // -force copy implies -migrate-state in "tofu init", // so m.migrateState is forced to true in this case even if // the user didn't actually specify it. We'll use the other // name here to avoid being confusing, then. diff --git a/internal/command/meta_backend_migrate.go b/internal/command/meta_backend_migrate.go index 57bc119337..8da3306f85 100644 --- a/internal/command/meta_backend_migrate.go +++ b/internal/command/meta_backend_migrate.go @@ -71,16 +71,16 @@ func (m *Meta) backendMigrateState(opts *backendMigrateOpts) error { opts.destinationWorkspace = backend.DefaultStateName opts.force = m.forceInitCopy - // Disregard remote Terraform version for the state source backend. If it's a + // Disregard remote OpenTofu version for the state source backend. If it's a // Terraform Cloud remote backend, we don't care about the remote version, // as we are migrating away and will not break a remote workspace. m.ignoreRemoteVersionConflict(opts.Source) - // Disregard remote Terraform version if instructed to do so via CLI flag. + // Disregard remote OpenTofu version if instructed to do so via CLI flag. if m.ignoreRemoteVersion { m.ignoreRemoteVersionConflict(opts.Destination) } else { - // Check the remote Terraform version for the state destination backend. If + // Check the remote OpenTofu version for the state destination backend. If // it's a Terraform Cloud remote backend, we want to ensure that we don't // break the workspace by uploading an incompatible state file. for _, workspace := range destinationWorkspaces { diff --git a/internal/command/meta_backend_test.go b/internal/command/meta_backend_test.go index 285c57107d..d8e8e4d69f 100644 --- a/internal/command/meta_backend_test.go +++ b/internal/command/meta_backend_test.go @@ -1933,7 +1933,7 @@ func TestBackendFromState(t *testing.T) { // Setup the meta m := testMetaBackend(t, nil) m.WorkingDir = wd - // terraform caches a small "state" file that stores the backend config. + // tofu caches a small "state" file that stores the backend config. // This test must override m.dataDir so it loads the "terraform.tfstate" file in the // test directory as the backend config cache. This fixture is really a // fixture for the data dir rather than the module dir, so we'll override diff --git a/internal/command/meta_config.go b/internal/command/meta_config.go index 03c7703901..22379a2b05 100644 --- a/internal/command/meta_config.go +++ b/internal/command/meta_config.go @@ -111,7 +111,7 @@ func (m *Meta) loadSingleModuleWithTests(dir string, testDir string) (*configs.M } // dirIsConfigPath checks if the given path is a directory that contains at -// least one Terraform configuration file (.tf or .tf.json), returning true +// least one OpenTofu configuration file (.tf or .tf.json), returning true // if so. // // In the unlikely event that the underlying config loader cannot be initalized, @@ -348,7 +348,7 @@ func (m *Meta) registerSynthConfigSource(filename string, src []byte) { // If the loader cannot be created for some reason then an error is returned // and no loader is created. Subsequent calls will presumably see the same // error. Loader initialization errors will tend to prevent any further use -// of most Terraform features, so callers should report any error and safely +// of most OpenTofu features, so callers should report any error and safely // terminate. func (m *Meta) initConfigLoader() (*configload.Loader, error) { if m.configLoader == nil { diff --git a/internal/command/meta_providers.go b/internal/command/meta_providers.go index 1df1651aa3..a5fee1d7e1 100644 --- a/internal/command/meta_providers.go +++ b/internal/command/meta_providers.go @@ -57,7 +57,7 @@ func (m *Meta) providerInstaller() *providercache.Installer { // The result of providerInstallerCustomSource differs from // providerInstaller only in how it determines package installation locations // during EnsureProviderVersions. A caller that doesn't call -// EnsureProviderVersions (anything other than "terraform init") can safely +// EnsureProviderVersions (anything other than "tofu init") can safely // just use the providerInstaller method unconditionally. func (m *Meta) providerInstallerCustomSource(source getproviders.Source) *providercache.Installer { targetDir := m.providerLocalCacheDir() @@ -83,7 +83,7 @@ func (m *Meta) providerInstallerCustomSource(source getproviders.Source) *provid // providerCustomLocalDirectorySource produces a provider source that consults // only the given local filesystem directories for plugins to install. // -// This is used to implement the -plugin-dir option for "terraform init", where +// This is used to implement the -plugin-dir option for "tofu init", where // the result of this method is used instead of what would've been returned // from m.providerInstallSource. // @@ -101,10 +101,10 @@ func (m *Meta) providerCustomLocalDirectorySource(dirs []string) getproviders.So // providerLocalCacheDir returns an object representing the // configuration-specific local cache directory. This is the -// only location consulted for provider plugin packages for Terraform +// only location consulted for provider plugin packages for OpenTofu // operations other than provider installation. // -// Only the provider installer (in "terraform init") is permitted to make +// Only the provider installer (in "tofu init") is permitted to make // modifications to this cache directory. All other commands must treat it // as read-only. // @@ -141,7 +141,7 @@ func (m *Meta) providerGlobalCacheDir() *providercache.Dir { // // This returns the standard provider install source that consults a number // of directories selected either automatically or via the CLI configuration. -// Users may choose to override this during a "terraform init" command by +// Users may choose to override this during a "tofu init" command by // specifying one or more -plugin-dir options, in which case the installation // process will construct its own source consulting only those directories // and use that instead. @@ -242,7 +242,7 @@ func (m *Meta) providerFactories() (map[addrs.Provider]providers.Factory, error) errs := make(map[addrs.Provider]error) // For the providers from the lock file, we expect them to be already - // available in the provider cache because "terraform init" should already + // available in the provider cache because "tofu init" should already // have put them there. providerLocks := locks.AllProviders() cacheDir := m.providerLocalCacheDir() @@ -260,10 +260,10 @@ func (m *Meta) providerFactories() (map[addrs.Provider]providers.Factory, error) // for manual testing of local development builds. // - The Terraform SDK test harness (and possibly other callers in future) // can ask that we use its own already-started provider servers, which we - // call "unmanaged" because Terraform isn't responsible for starting + // call "unmanaged" because OpenTofu isn't responsible for starting // and stopping them. This is intended for automated testing where a // calling harness is responsible both for starting the provider server - // and orchestrating one or more non-interactive Terraform runs that then + // and orchestrating one or more non-interactive OpenTofu runs that then // exercise it. // Unmanaged providers take precedence over overridden providers because // overrides are typically a "session-level" setting while unmanaged diff --git a/internal/command/plan_test.go b/internal/command/plan_test.go index 1ef7442154..4e60065a4c 100644 --- a/internal/command/plan_test.go +++ b/internal/command/plan_test.go @@ -527,8 +527,8 @@ func TestPlan_refreshTrue(t *testing.T) { } // A consumer relies on the fact that running -// terraform plan -refresh=false -refresh=true gives the same result as -// terraform plan -refresh=true. +// tofu plan -refresh=false -refresh=true gives the same result as +// tofu plan -refresh=true. // While the flag logic itself is handled by the stdlib flags package (and code // in main() that is tested elsewhere), we verify the overall plan command // behaviour here in case we accidentally break this with additional logic. @@ -890,7 +890,7 @@ func TestPlan_providerArgumentUnset(t *testing.T) { } } -// Test that terraform properly merges provider configuration that's split +// Test that tofu properly merges provider configuration that's split // between config files and interactive input variables. // https://github.com/hashicorp/terraform/issues/28956 func TestPlan_providerConfigMerge(t *testing.T) { @@ -1630,7 +1630,7 @@ func planFixtureSchema() *providers.GetProviderSchemaResponse { // planFixtureProvider returns a mock provider that is configured for basic // operation with the configuration in testdata/plan. This mock has // GetSchemaResponse and PlanResourceChangeFn populated, with the plan -// step just passing through the new object proposed by Terraform Core. +// step just passing through the new object proposed by OpenTofu Core. func planFixtureProvider() *tofu.MockProvider { p := testProvider() p.GetProviderSchemaResponse = planFixtureSchema() @@ -1671,7 +1671,7 @@ func planVarsFixtureSchema() *providers.GetProviderSchemaResponse { // planVarsFixtureProvider returns a mock provider that is configured for basic // operation with the configuration in testdata/plan-vars. This mock has // GetSchemaResponse and PlanResourceChangeFn populated, with the plan -// step just passing through the new object proposed by Terraform Core. +// step just passing through the new object proposed by OpenTofu Core. func planVarsFixtureProvider() *tofu.MockProvider { p := testProvider() p.GetProviderSchemaResponse = planVarsFixtureSchema() diff --git a/internal/command/providers_lock.go b/internal/command/providers_lock.go index 6ecad946bd..2b991da570 100644 --- a/internal/command/providers_lock.go +++ b/internal/command/providers_lock.go @@ -24,7 +24,7 @@ const ( ) // ProvidersLockCommand is a Command implementation that implements the -// "terraform providers lock" command, which creates or updates the current +// "tofu providers lock" command, which creates or updates the current // configuration's dependency lock file using information from upstream // registries, regardless of the provider installation configuration that // is configured for normal provider installation. @@ -94,7 +94,7 @@ func (c *ProvidersLockCommand) Run(args []string) int { // // This is so that folks who use a local mirror for everyday use can // use this command to populate their lock files from upstream so - // subsequent "terraform init" calls can then verify the local mirror + // subsequent "tofu init" calls can then verify the local mirror // against the upstream checksums. var source getproviders.Source switch { @@ -176,10 +176,10 @@ func (c *ProvidersLockCommand) Run(args []string) int { // Our general strategy here is to install the requested providers into // a separate temporary directory -- thus ensuring that the results won't - // ever be inadvertently executed by other Terraform commands -- and then + // ever be inadvertently executed by other OpenTofu commands -- and then // use the results of that installation to update the lock file for the // current working directory. Because we throwaway the packages we - // downloaded after completing our work, a subsequent "terraform init" will + // downloaded after completing our work, a subsequent "tofu init" will // then respect the CLI configuration's provider installation strategies // but will verify the packages against the hashes we found upstream. diff --git a/internal/command/providers_mirror.go b/internal/command/providers_mirror.go index c2136d6044..3ec521a7d1 100644 --- a/internal/command/providers_mirror.go +++ b/internal/command/providers_mirror.go @@ -19,7 +19,7 @@ import ( ) // ProvidersMirrorCommand is a Command implementation that implements the -// "terraform providers mirror" command, which populates a directory with +// "tofu providers mirror" command, which populates a directory with // local copies of provider plugins needed by the current configuration so // that the mirror can be used to work offline, or similar. type ProvidersMirrorCommand struct { diff --git a/internal/command/providers_schema_test.go b/internal/command/providers_schema_test.go index 988c2b02d6..07811cb880 100644 --- a/internal/command/providers_schema_test.go +++ b/internal/command/providers_schema_test.go @@ -75,7 +75,7 @@ func TestProvidersSchema_output(t *testing.T) { // flush the init output from the mock ui ui.OutputWriter.Reset() - // `terraform provider schemas` command + // `tofu provider schemas` command pc := &ProvidersSchemaCommand{Meta: m} if code := pc.Run([]string{"-json"}); code != 0 { t.Fatalf("wrong exit status %d; want 0\nstderr: %s", code, ui.ErrorWriter.String()) diff --git a/internal/command/show.go b/internal/command/show.go index 15341a35b3..77776c7a44 100644 --- a/internal/command/show.go +++ b/internal/command/show.go @@ -43,7 +43,7 @@ func (e *errUnusableDataMisc) Unwrap() error { } // ShowCommand is a Command implementation that reads and outputs the -// contents of a Terraform plan or state file. +// contents of a OpenTofu plan or state file. type ShowCommand struct { Meta viewType arguments.ViewType diff --git a/internal/command/show_test.go b/internal/command/show_test.go index 7bbaa3d170..d207b99dd5 100644 --- a/internal/command/show_test.go +++ b/internal/command/show_test.go @@ -360,8 +360,8 @@ func TestShow_planWithChanges(t *testing.T) { func TestShow_planWithForceReplaceChange(t *testing.T) { // The main goal of this test is to see that the "replace by request" // resource instance action reason can round-trip through a plan file and - // be reflected correctly in the "terraform show" output, the same way - // as it would appear in "terraform plan" output. + // be reflected correctly in the "tofu show" output, the same way + // as it would appear in "tofu plan" output. _, snap := testModuleWithSnapshot(t, "show") plannedVal := cty.ObjectVal(map[string]cty.Value{ @@ -1053,7 +1053,7 @@ func showFixtureSensitiveSchema() *providers.GetProviderSchemaResponse { // operation with the configuration in testdata/show. This mock has // GetSchemaResponse, PlanResourceChangeFn, and ApplyResourceChangeFn populated, // with the plan/apply steps just passing through the data determined by -// Terraform Core. +// OpenTofu Core. func showFixtureProvider() *tofu.MockProvider { p := testProvider() p.GetProviderSchemaResponse = showFixtureSchema() @@ -1116,7 +1116,7 @@ func showFixtureProvider() *tofu.MockProvider { // operation with the configuration in testdata/show. This mock has // GetSchemaResponse, PlanResourceChangeFn, and ApplyResourceChangeFn populated, // with the plan/apply steps just passing through the data determined by -// Terraform Core. It also has a sensitive attribute in the provider schema. +// OpenTofu Core. It also has a sensitive attribute in the provider schema. func showFixtureSensitiveProvider() *tofu.MockProvider { p := testProvider() p.GetProviderSchemaResponse = showFixtureSensitiveSchema() diff --git a/internal/command/state_mv.go b/internal/command/state_mv.go index c6fd929c01..1352d5142e 100644 --- a/internal/command/state_mv.go +++ b/internal/command/state_mv.go @@ -463,7 +463,7 @@ func (c *StateMvCommand) sourceObjectAddrs(state *states.State, matched addrs.Ta // If this refers to a resource without "count" or "for_each" set then // we'll assume the user intended it to be a resource instance // address instead, to allow for requests like this: - // terraform state mv aws_instance.foo aws_instance.bar[1] + // tofu state mv aws_instance.foo aws_instance.bar[1] // That wouldn't be allowed if aws_instance.foo had multiple instances // since we can't move multiple instances into one. if rs := state.Resource(addr); rs != nil { diff --git a/internal/command/test.go b/internal/command/test.go index 6d21fca676..4878c0e397 100644 --- a/internal/command/test.go +++ b/internal/command/test.go @@ -1092,7 +1092,7 @@ func prepareInputVariablesForAssertions(config *configs.Config, run *moduletest. } // We've gathered all the values we have, let's convert them into - // terraform.InputValues so they can be passed into the Terraform graph. + // tofu.InputValues so they can be passed into the Terraform graph. inputs := make(tofu.InputValues, len(variables)) var diags tfdiags.Diagnostics @@ -1103,7 +1103,7 @@ func prepareInputVariablesForAssertions(config *configs.Config, run *moduletest. } // Next, we're going to apply any default values from the configuration. - // We do this after the conversion into terraform.InputValues, as the + // We do this after the conversion into tofu.InputValues, as the // defaults have already been converted into cty.Value objects. for name, variable := range config.Module.Variables { diff --git a/internal/command/testdata/login-oauth-server/main.go b/internal/command/testdata/login-oauth-server/main.go index 01dfc256e1..82ef496a67 100644 --- a/internal/command/testdata/login-oauth-server/main.go +++ b/internal/command/testdata/login-oauth-server/main.go @@ -1,8 +1,8 @@ //go:build ignore // +build ignore -// This file is a helper for those doing _manual_ testing of "terraform login" -// and/or "terraform logout" and want to start up a test OAuth server in a +// This file is a helper for those doing _manual_ testing of "tofu login" +// and/or "tofu logout" and want to start up a test OAuth server in a // separate process for convenience: // // go run ./command/testdata/login-oauth-server/main.go :8080 diff --git a/internal/command/testdata/login-oauth-server/oauthserver.go b/internal/command/testdata/login-oauth-server/oauthserver.go index 5454a1d8f6..de0c80d739 100644 --- a/internal/command/testdata/login-oauth-server/oauthserver.go +++ b/internal/command/testdata/login-oauth-server/oauthserver.go @@ -1,5 +1,5 @@ // Package oauthserver is a very simplistic OAuth server used only for -// the testing of the "terraform login" and "terraform logout" commands. +// the testing of the "tofu login" and "tofu logout" commands. package oauthserver import ( @@ -16,9 +16,9 @@ import ( // Handler is an implementation of net/http.Handler that provides a stub // OAuth server implementation with the following endpoints: // -// /authz - authorization endpoint -// /token - token endpoint -// /revoke - token revocation (logout) endpoint +// /authz - authorization endpoint +// /token - token endpoint +// /revoke - token revocation (logout) endpoint // // The authorization endpoint returns HTML per normal OAuth conventions, but // it also includes an HTTP header X-Redirect-To giving the same URL that the diff --git a/internal/command/testdata/login-tfe-server/tfeserver.go b/internal/command/testdata/login-tfe-server/tfeserver.go index 111c0712cc..4555085def 100644 --- a/internal/command/testdata/login-tfe-server/tfeserver.go +++ b/internal/command/testdata/login-tfe-server/tfeserver.go @@ -1,5 +1,5 @@ // Package tfeserver is a test stub implementing a subset of the TFE API used -// only for the testing of the "terraform login" command. +// only for the testing of the "tofu login" command. package tfeserver import ( @@ -17,8 +17,8 @@ const ( // Handler is an implementation of net/http.Handler that provides a stub // TFE API server implementation with the following endpoints: // -// /ping - API existence endpoint -// /account/details - current user endpoint +// /ping - API existence endpoint +// /account/details - current user endpoint var Handler http.Handler type handler struct{} diff --git a/internal/command/testing/test_provider.go b/internal/command/testing/test_provider.go index 360b2686ac..b5db379cc2 100644 --- a/internal/command/testing/test_provider.go +++ b/internal/command/testing/test_provider.go @@ -51,7 +51,7 @@ var ( } ) -// TestProvider is a wrapper around terraform.MockProvider that defines dynamic +// TestProvider is a wrapper around tofu.MockProvider that defines dynamic // schemas, and keeps track of the resources and data sources that it contains. type TestProvider struct { Provider *tofu.MockProvider diff --git a/internal/command/ui_input.go b/internal/command/ui_input.go index 4116db203d..44b1b21af7 100644 --- a/internal/command/ui_input.go +++ b/internal/command/ui_input.go @@ -29,7 +29,7 @@ var defaultInputWriter io.Writer var testInputResponse []string var testInputResponseMap map[string]string -// UIInput is an implementation of terraform.UIInput that asks the CLI +// UIInput is an implementation of tofu.UIInput that asks the CLI // for input stdin. type UIInput struct { // Colorize will color the output. @@ -67,7 +67,7 @@ func (i *UIInput) Input(ctx context.Context, opts *tofu.InputOpts) (string, erro w = os.Stdout } - // Make sure we only ask for input once at a time. Terraform + // Make sure we only ask for input once at a time. OpenTofu // should enforce this, but it doesn't hurt to verify. i.l.Lock() defer i.l.Unlock() diff --git a/internal/command/validate.go b/internal/command/validate.go index 242bbc53a8..a32a570604 100644 --- a/internal/command/validate.go +++ b/internal/command/validate.go @@ -16,7 +16,7 @@ import ( "github.com/opentofu/opentofu/internal/tofu" ) -// ValidateCommand is a Command implementation that validates the terraform files +// ValidateCommand is a Command implementation that validates the tofu files type ValidateCommand struct { Meta } @@ -59,7 +59,7 @@ func (c *ValidateCommand) Run(rawArgs []string) int { // Validating with dev overrides in effect means that the result might // not be valid for a stable release, so we'll warn about that in case - // the user is trying to use "terraform validate" as a sort of pre-flight + // the user is trying to use "tofu validate" as a sort of pre-flight // check before submitting a change. diags = diags.Append(c.providerDevOverrideRuntimeWarnings()) @@ -105,8 +105,8 @@ func (c *ValidateCommand) validate(dir, testDir string, noTests bool) tfdiags.Di validatedModules := make(map[string]bool) - // We'll also do a quick validation of the Terraform test files. These live - // outside the Terraform graph so we have to do this separately. + // We'll also do a quick validation of the OpenTofu test files. These live + // outside the OpenTofu graph so we have to do this separately. for _, file := range cfg.Module.Tests { for _, run := range file.Runs { @@ -117,7 +117,7 @@ func (c *ValidateCommand) validate(dir, testDir string, noTests bool) tfdiags.Di // Basically, local testing modules are something the user can // reasonably go and fix. If it's a module being downloaded from // the registry, the expectation is that the author of the - // module should have ran `terraform validate` themselves. + // module should have ran `tofu validate` themselves. if _, ok := run.Module.Source.(addrs.ModuleSourceLocal); ok { if validated := validatedModules[run.Module.Source.String()]; !validated { diff --git a/internal/command/version.go b/internal/command/version.go index 51f6ef7a1c..59dd1f9441 100644 --- a/internal/command/version.go +++ b/internal/command/version.go @@ -68,11 +68,11 @@ func (c *VersionCommand) Run(args []string) int { // We'll also attempt to print out the selected plugin versions. We do // this based on the dependency lock file, and so the result might be - // empty or incomplete if the user hasn't successfully run "terraform init" + // empty or incomplete if the user hasn't successfully run "tofu init" // since the most recent change to dependencies. // // Generally-speaking this is a best-effort thing that will give us a good - // result in the usual case where the user successfully ran "terraform init" + // result in the usual case where the user successfully ran "tofu init" // and then hit a problem running _another_ command. var providerVersions []string var providerLocks map[addrs.Provider]*depsfile.ProviderLock diff --git a/internal/command/version_test.go b/internal/command/version_test.go index b320d62624..729e23db18 100644 --- a/internal/command/version_test.go +++ b/internal/command/version_test.go @@ -70,7 +70,7 @@ func TestVersion_flags(t *testing.T) { Ui: ui, } - // `terraform version` + // `tofu version` c := &VersionCommand{ Meta: m, Version: "4.5.6", @@ -98,7 +98,7 @@ func TestVersion_json(t *testing.T) { Ui: ui, } - // `terraform version -json` without prerelease + // `tofu version -json` without prerelease c := &VersionCommand{ Meta: meta, Version: "4.5.6", @@ -140,7 +140,7 @@ func TestVersion_json(t *testing.T) { nil, ) - // `terraform version -json` with prerelease and provider dependencies + // `tofu version -json` with prerelease and provider dependencies c = &VersionCommand{ Meta: meta, Version: "4.5.6", diff --git a/internal/command/views/validate.go b/internal/command/views/validate.go index 0e51a2427c..fe1bfa09a4 100644 --- a/internal/command/views/validate.go +++ b/internal/command/views/validate.go @@ -36,7 +36,7 @@ func NewValidate(vt arguments.ViewType, view *View) Validate { } // The ValidateHuman implementation renders diagnostics in a human-readable form, -// along with a success/failure message if Terraform is able to execute the +// along with a success/failure message if OpenTofu is able to execute the // validation walk. type ValidateHuman struct { view *View diff --git a/internal/command/views/view.go b/internal/command/views/view.go index 23ea9aacad..ad2be46717 100644 --- a/internal/command/views/view.go +++ b/internal/command/views/view.go @@ -20,7 +20,7 @@ type View struct { compactWarnings bool - // When this is true it's a hint that Terraform is being run indirectly + // When this is true it's a hint that OpenTofu is being run indirectly // via a wrapper script or other automation and so we may wish to replace // direct examples of commands to run with more conceptual directions. // However, we only do this on a best-effort basis, typically prioritizing diff --git a/internal/command/workdir/dir.go b/internal/command/workdir/dir.go index b4fc62c410..201f9480c8 100644 --- a/internal/command/workdir/dir.go +++ b/internal/command/workdir/dir.go @@ -9,7 +9,7 @@ import ( "path/filepath" ) -// Dir represents a single Terraform working directory. +// Dir represents a single OpenTofu working directory. // // "Working directory" is unfortunately a slight misnomer, because non-default // options can potentially stretch the definition such that multiple working @@ -36,13 +36,13 @@ import ( type Dir struct { // mainDir is the path to the directory that we present as the // "working directory" in the user model, which is typically the - // current working directory when running Terraform CLI, or the + // current working directory when running OpenTofu CLI, or the // directory explicitly chosen by the user using the -chdir=... // global option. mainDir string // originalDir is the path to the working directory that was - // selected when creating the Terraform CLI process, regardless of + // selected when creating the OpenTofu CLI process, regardless of // -chdir=... being set. This is only for very limited purposes // related to backward compatibility; most functionality should // use mainDir instead. @@ -84,7 +84,7 @@ func NewDir(mainPath string) *Dir { // OverrideOriginalWorkingDir records a different path as the // "original working directory" for the reciever. // -// Use this only to record the original working directory when Terraform is run +// Use this only to record the original working directory when OpenTofu is run // with the -chdir=... global option. In that case, the directory given in // -chdir=... is the "main path" to pass in to NewDir, while the original // working directory should be sent to this method. @@ -112,10 +112,10 @@ func (d *Dir) RootModuleDir() string { } // OriginalWorkingDir returns the true, operating-system-originated working -// directory that the current Terraform process was launched from. +// directory that the current OpenTofu process was launched from. // // This is usually the same as the main working directory, but differs in the -// special case where the user ran Terraform with the global -chdir=... +// special case where the user ran OpenTofu with the global -chdir=... // option. This is here only for a few backward compatibility affordances // from before we had the -chdir=... option, so should typically not be used // for anything new. @@ -140,7 +140,7 @@ func (d *Dir) DataDir() string { // // For directories that already exist ensureDataDir will preserve their // permissions, while it'll create any new directories to be owned by the user -// running Terraform, readable and writable by that user, and readable by +// running OpenTofu, readable and writable by that user, and readable by // all other users, or some approximation of that on non-Unix platforms which // have a different permissions model. func (d *Dir) ensureDataDir() error { diff --git a/internal/command/workdir/doc.go b/internal/command/workdir/doc.go index 9d08231b46..d9e736b17c 100644 --- a/internal/command/workdir/doc.go +++ b/internal/command/workdir/doc.go @@ -2,14 +2,14 @@ // SPDX-License-Identifier: MPL-2.0 // Package workdir models the various local artifacts and state we keep inside -// a Terraform "working directory". +// a OpenTofu "working directory". // // The working directory artifacts and settings are typically initialized or -// modified by "terraform init", after which they persist for use by other +// modified by "tofu init", after which they persist for use by other // commands in the same directory, but are not visible to commands run in // other working directories or on other computers. // -// Although "terraform init" is the main command which modifies a workdir, +// Although "tofu init" is the main command which modifies a workdir, // other commands do sometimes make more focused modifications for settings // which can typically change multiple times during a session, such as the // currently-selected workspace name. Any command which modifies the working diff --git a/internal/communicator/ssh/provisioner.go b/internal/communicator/ssh/provisioner.go index 8993b9e097..86f7d7b244 100644 --- a/internal/communicator/ssh/provisioner.go +++ b/internal/communicator/ssh/provisioner.go @@ -329,7 +329,7 @@ func buildSSHClientConfig(opts sshClientConfigOpts) (*ssh.ClientConfig, error) { hkCallback := ssh.InsecureIgnoreHostKey() if opts.hostKey != "" { - // The knownhosts package only takes paths to files, but terraform + // The knownhosts package only takes paths to files, but tofu // generally wants to handle config data in-memory. Rather than making // the known_hosts file an exception, write out the data to a temporary // file to create the HostKeyCallback. diff --git a/internal/configs/checks.go b/internal/configs/checks.go index 31aed21ec9..f682b147a9 100644 --- a/internal/configs/checks.go +++ b/internal/configs/checks.go @@ -149,7 +149,7 @@ var checkRuleBlockSchema = &hcl.BodySchema{ // // A check block contains 0-1 data blocks, and 0-n assert blocks. The check // block will load the data block, and execute the assert blocks as check rules -// during the plan and apply Terraform operations. +// during the plan and apply OpenTofu operations. type Check struct { Name string diff --git a/internal/configs/config.go b/internal/configs/config.go index 948284df0d..42a2411a41 100644 --- a/internal/configs/config.go +++ b/internal/configs/config.go @@ -195,7 +195,7 @@ func (c *Config) DescendentForInstance(path addrs.ModuleInstance) *Config { // directly via a remote source address or indirectly via a registry source // address. // -// Other behaviors in Terraform may treat package crossings as a special +// Other behaviors in OpenTofu may treat package crossings as a special // situation, because that indicates that the caller and callee can change // independently of one another and thus we should disallow using any features // where the caller assumes anything about the callee other than its input @@ -217,11 +217,11 @@ func (c *Config) EntersNewPackage() bool { // multiple inconsistencies then it will attempt to describe as many of them // as possible, rather than stopping at the first problem. // -// It's typically the responsibility of "terraform init" to change the locked +// It's typically the responsibility of "tofu init" to change the locked // dependencies to conform with the configuration, and so // VerifyDependencySelections is intended for other commands to check whether // it did so correctly and to catch if anything has changed in configuration -// since the last "terraform init" which requires re-initialization. However, +// since the last "tofu init" which requires re-initialization. However, // it's up to the caller to decide how to advise users recover from these // errors, because the advise can vary depending on what operation the user // is attempting. @@ -486,7 +486,7 @@ func (c *Config) addProviderRequirements(reqs getproviders.Requirements, recurse if i.ProviderConfigRef.Name != target.ProviderConfigRef.Name || i.ProviderConfigRef.Alias != target.ProviderConfigRef.Alias { // This means we have a provider specified in both the // import block and the resource block, and they disagree. - // This is bad as Terraform now has different instructions + // This is bad as OpenTofu now has different instructions // about which provider to use. // // The general guidance is that only the resource should be @@ -882,7 +882,7 @@ func (c *Config) TransformForTest(run *TestRun, file *TestFile) (func(), hcl.Dia // // We can have a set of providers defined within the config, we can also // have a set of providers defined within the test file. Then the run can - // also specify a set of overrides that tell Terraform exactly which + // also specify a set of overrides that tell OpenTofu exactly which // providers from the test file to apply into the config. // // The process here is as follows: diff --git a/internal/configs/configload/loader.go b/internal/configs/configload/loader.go index 37c39ea85a..b0c8e85144 100644 --- a/internal/configs/configload/loader.go +++ b/internal/configs/configload/loader.go @@ -34,7 +34,7 @@ type Config struct { // ModulesDir is a path to a directory where descendent modules are // (or should be) installed. (This is usually the // .terraform/modules directory, in the common case where this package - // is being loaded from the main Terraform CLI package.) + // is being loaded from the main OpenTofu CLI package.) ModulesDir string // Services is the service discovery client to use when locating remote @@ -114,7 +114,7 @@ func (l *Loader) Sources() map[string][]byte { } // IsConfigDir returns true if and only if the given directory contains at -// least one Terraform configuration file. This is a wrapper around calling +// least one OpenTofu configuration file. This is a wrapper around calling // the same method name on the loader's parser. func (l *Loader) IsConfigDir(path string) bool { return l.parser.IsConfigDir(path) diff --git a/internal/configs/configload/loader_load.go b/internal/configs/configload/loader_load.go index 2e9b25ee85..34bb12427c 100644 --- a/internal/configs/configload/loader_load.go +++ b/internal/configs/configload/loader_load.go @@ -55,7 +55,7 @@ func (l *Loader) moduleWalkerLoad(req *configs.ModuleRequest) (*configs.Module, // Since we're just loading here, we expect that all referenced modules // will be already installed and described in our manifest. However, we // do verify that the manifest and the configuration are in agreement - // so that we can prompt the user to run "terraform init" if not. + // so that we can prompt the user to run "tofu init" if not. key := l.modules.manifest.ModuleKey(req.Path) record, exists := l.modules.manifest[key] diff --git a/internal/configs/configschema/doc.go b/internal/configs/configschema/doc.go index d96be9c7f0..ce9c2890a3 100644 --- a/internal/configs/configschema/doc.go +++ b/internal/configs/configschema/doc.go @@ -6,7 +6,7 @@ // // For example, this is used to describe the expected contents of a resource // configuration block, which is defined by the corresponding provider plugin -// and thus not compiled into Terraform core. +// and thus not compiled into OpenTofu core. // // A configschema primarily describes the shape of configuration, but it is // also suitable for use with other structures derived from the configuration, diff --git a/internal/configs/configschema/internal_validate.go b/internal/configs/configschema/internal_validate.go index d2a4190107..1446ab2e2c 100644 --- a/internal/configs/configschema/internal_validate.go +++ b/internal/configs/configschema/internal_validate.go @@ -19,7 +19,7 @@ var validName = regexp.MustCompile(`^[a-z0-9_]+$`) // schema. // // This can be used within unit tests to detect when a given schema is invalid, -// and is run when terraform loads provider schemas during NewContext. +// and is run when tofu loads provider schemas during NewContext. func (b *Block) InternalValidate() error { if b == nil { return fmt.Errorf("top-level block schema is nil") diff --git a/internal/configs/doc.go b/internal/configs/doc.go index 3dadfb05f6..8c507516f9 100644 --- a/internal/configs/doc.go +++ b/internal/configs/doc.go @@ -1,18 +1,18 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -// Package configs contains types that represent Terraform configurations and +// Package configs contains types that represent OpenTofu configurations and // the different elements thereof. // // The functionality in this package can be used for some static analyses of -// Terraform configurations, but this package generally exposes representations +// OpenTofu configurations, but this package generally exposes representations // of the configuration source code rather than the result of evaluating these // objects. The sibling package "lang" deals with evaluation of structures // and expressions in the configuration. // // Due to its close relationship with HCL, this package makes frequent use // of types from the HCL API, including raw HCL diagnostic messages. Such -// diagnostics can be converted into Terraform-flavored diagnostics, if needed, +// diagnostics can be converted into OpenTofu-flavored diagnostics, if needed, // using functions in the sibling package tfdiags. // // The Parser type is the main entry-point into this package. The LoadConfigDir diff --git a/internal/configs/hcl2shim/values_equiv.go b/internal/configs/hcl2shim/values_equiv.go index cf5b26936a..60b149b14b 100644 --- a/internal/configs/hcl2shim/values_equiv.go +++ b/internal/configs/hcl2shim/values_equiv.go @@ -19,10 +19,10 @@ import ( // // This must be used _only_ for comparing values for equivalence within the // SDK planning code. It is only meaningful to compare the "prior state" -// provided by Terraform Core with the "planned new state" produced by the +// provided by OpenTofu Core with the "planned new state" produced by the // legacy SDK code via shims. In particular it is not valid to use this // function with their the config value or the "proposed new state" value -// because they contain only the subset of data that Terraform Core itself is +// because they contain only the subset of data that OpenTofu Core itself is // able to determine. func ValuesSDKEquivalent(a, b cty.Value) bool { if a == cty.NilVal || b == cty.NilVal { @@ -183,7 +183,7 @@ func valuesSDKEquivalentMappings(a, b cty.Value) bool { // valuesSDKEquivalentNumbers decides equivalence for two number values based // on the fact that the SDK uses int and float64 representations while -// cty (and thus Terraform Core) uses big.Float, and so we expect to lose +// cty (and thus OpenTofu Core) uses big.Float, and so we expect to lose // precision in the round-trip. // // This does _not_ attempt to allow for an epsilon difference that may be diff --git a/internal/configs/parser_config.go b/internal/configs/parser_config.go index 967197e003..1ddf04d376 100644 --- a/internal/configs/parser_config.go +++ b/internal/configs/parser_config.go @@ -32,7 +32,7 @@ func (p *Parser) LoadConfigFileOverride(path string) (*File, hcl.Diagnostics) { return p.loadConfigFile(path, true) } -// LoadTestFile reads the file at the given path and parses it as a Terraform +// LoadTestFile reads the file at the given path and parses it as a OpenTofu // test file. // // It references the same LoadHCLFile as LoadConfigFile, so inherits the same @@ -211,7 +211,7 @@ func (p *Parser) loadConfigFile(path string, override bool) (*File, hcl.Diagnost // // This is intended to maximize the chance that we'll be able to read the // requirements (syntax errors notwithstanding) even if the config file contains -// constructs that might've been added in future Terraform versions +// constructs that might've been added in future OpenTofu versions // // This is a "best effort" sort of method which will return constraints it is // able to find, but may return no constraints at all if the given body is diff --git a/internal/configs/parser_config_dir.go b/internal/configs/parser_config_dir.go index b5a03d5831..1f32decc1f 100644 --- a/internal/configs/parser_config_dir.go +++ b/internal/configs/parser_config_dir.go @@ -95,7 +95,7 @@ func (p Parser) ConfigDirFilesWithTests(dir string, testDirectory string) (prima } // IsConfigDir determines whether the given path refers to a directory that -// exists and contains at least one Terraform config file (with a .tf or +// exists and contains at least one OpenTofu config file (with a .tf or // .tf.json extension.). Note, we explicitely exclude checking for tests here // as tests must live alongside actual .tf config files. func (p *Parser) IsConfigDir(path string) bool { @@ -124,10 +124,10 @@ func (p *Parser) loadFiles(paths []string, override bool) ([]*File, hcl.Diagnost return files, diags } -// dirFiles finds Terraform configuration files within dir, splitting them into +// dirFiles finds OpenTofu configuration files within dir, splitting them into // primary and override files based on the filename. // -// If testsDir is not empty, dirFiles will also retrieve Terraform testing files +// If testsDir is not empty, dirFiles will also retrieve OpenTofu testing files // both directly within dir and within testsDir as a subdirectory of dir. In // this way, testsDir acts both as a direction to retrieve test files within the // main direction and as the location for additional test files. @@ -196,7 +196,7 @@ func (p *Parser) dirFiles(dir string, testsDir string) (primary, override, tests for _, info := range infos { if info.IsDir() { - // We only care about terraform configuration files. + // We only care about tofu configuration files. continue } @@ -253,7 +253,7 @@ func (p *Parser) loadTestFiles(basePath string, paths []string) (map[string]*Tes return tfs, diags } -// fileExt returns the Terraform configuration extension of the given +// fileExt returns the OpenTofu configuration extension of the given // path, or a blank string if it is not a recognized extension. func fileExt(path string) string { if strings.HasSuffix(path, ".tf") { @@ -277,7 +277,7 @@ func IsIgnoredFile(name string) bool { strings.HasPrefix(name, "#") && strings.HasSuffix(name, "#") // emacs } -// IsEmptyDir returns true if the given filesystem path contains no Terraform +// IsEmptyDir returns true if the given filesystem path contains no OpenTofu // configuration files. // // Unlike the methods of the Parser type, this function always consults the diff --git a/internal/configs/test_file.go b/internal/configs/test_file.go index 059d3ae867..020e87d363 100644 --- a/internal/configs/test_file.go +++ b/internal/configs/test_file.go @@ -11,20 +11,20 @@ import ( "github.com/opentofu/opentofu/internal/tfdiags" ) -// TestCommand represents the Terraform a given run block will execute, plan +// TestCommand represents the OpenTofu a given run block will execute, plan // or apply. Defaults to apply. type TestCommand rune -// TestMode represents the plan mode that Terraform will use for a given run +// TestMode represents the plan mode that OpenTofu will use for a given run // block, normal or refresh-only. Defaults to normal. type TestMode rune const ( - // ApplyTestCommand causes the run block to execute a Terraform apply + // ApplyTestCommand causes the run block to execute a OpenTofu apply // operation. ApplyTestCommand TestCommand = 0 - // PlanTestCommand causes the run block to execute a Terraform plan + // PlanTestCommand causes the run block to execute a OpenTofu plan // operation. PlanTestCommand TestCommand = 'P' @@ -36,7 +36,7 @@ const ( RefreshOnlyTestMode TestMode = 'R' ) -// TestFile represents a single test file within a `terraform test` execution. +// TestFile represents a single test file within a `tofu test` execution. // // A test file is made up of a sequential list of run blocks, each designating // a command to execute and a series of validations to check after the command. @@ -61,12 +61,12 @@ type TestFile struct { // TestRun represents a single run block within a test file. // -// Each run block represents a single Terraform command to be executed and a set +// Each run block represents a single OpenTofu command to be executed and a set // of validations to run after the command. type TestRun struct { Name string - // Command is the Terraform command to execute. + // Command is the OpenTofu command to execute. // // One of ['apply', 'plan']. Command TestCommand @@ -108,7 +108,7 @@ type TestRun struct { // against. // // In typical cases, this will be null and the config under test is the - // configuration within the directory the terraform test command is + // configuration within the directory the tofu test command is // executing within. However, when Module is set the config under test is // whichever config is defined by Module. This field is then set during the // configuration load process and should be used when the test is executed. @@ -175,13 +175,13 @@ type TestRunOptions struct { // Mode is the planning mode to run in. One of ['normal', 'refresh-only']. Mode TestMode - // Refresh is analogous to the -refresh=false Terraform plan option. + // Refresh is analogous to the -refresh=false OpenTofu plan option. Refresh bool - // Replace is analogous to the -refresh=ADDRESS Terraform plan option. + // Replace is analogous to the -refresh=ADDRESS OpenTofu plan option. Replace []hcl.Traversal - // Target is analogous to the -target=ADDRESS Terraform plan option. + // Target is analogous to the -target=ADDRESS OpenTofu plan option. Target []hcl.Traversal DeclRange hcl.Range diff --git a/internal/configs/version_constraint.go b/internal/configs/version_constraint.go index 5ae9b6864a..8ee3a5eea7 100644 --- a/internal/configs/version_constraint.go +++ b/internal/configs/version_constraint.go @@ -13,7 +13,7 @@ import ( ) // VersionConstraint represents a version constraint on some resource -// (e.g. Terraform Core, a provider, a module, ...) that carries with it +// (e.g. OpenTofu Core, a provider, a module, ...) that carries with it // a source range so that a helpful diagnostic can be printed in the event // that a particular constraint does not match. type VersionConstraint struct { diff --git a/internal/depsfile/doc.go b/internal/depsfile/doc.go index 8fbfaba78c..517d61cc35 100644 --- a/internal/depsfile/doc.go +++ b/internal/depsfile/doc.go @@ -4,7 +4,7 @@ // Package depsfile contains the logic for reading and writing OpenTofu's // dependency lock and development override configuration files. // -// These files are separate from the main Terraform configuration files (.tf) +// These files are separate from the main OpenTofu configuration files (.tf) // for a number of reasons. The first is to help establish a distinction // where .tf files configure a particular module while these configure // a whole configuration tree. Another, more practical consideration is that diff --git a/internal/e2e/e2e.go b/internal/e2e/e2e.go index d46aa1ba84..0969ed649f 100644 --- a/internal/e2e/e2e.go +++ b/internal/e2e/e2e.go @@ -112,7 +112,7 @@ func (b *binary) AddEnv(entry string) { b.env = append(b.env, entry) } -// Cmd returns an exec.Cmd pre-configured to run the generated Terraform +// Cmd returns an exec.Cmd pre-configured to run the generated OpenTofu // binary with the given arguments in the temporary working directory. // // The returned object can be mutated by the caller to customize how the @@ -127,10 +127,10 @@ func (b *binary) Cmd(args ...string) *exec.Cmd { return cmd } -// Run executes the generated Terraform binary with the given arguments +// Run executes the generated OpenTofu binary with the given arguments // and returns the bytes that it wrote to both stdout and stderr. // -// This is a simple way to run Terraform for non-interactive commands +// This is a simple way to run OpenTofu for non-interactive commands // that don't need any special environment variables. For more complex // situations, use Cmd and customize the command before running it. func (b *binary) Run(args ...string) (stdout, stderr string, err error) { diff --git a/internal/experiments/experiment.go b/internal/experiments/experiment.go index 0769f5b4b7..0140bc7429 100644 --- a/internal/experiments/experiment.go +++ b/internal/experiments/experiment.go @@ -75,7 +75,7 @@ func (e Experiment) IsConcluded() bool { } // currentExperiments are those which are available to activate in the current -// version of Terraform. +// version of OpenTofu. // // Members of this set are registered in the init function above. var currentExperiments = make(Set) diff --git a/internal/getproviders/didyoumean.go b/internal/getproviders/didyoumean.go index f856b690c3..f86f7e0eb3 100644 --- a/internal/getproviders/didyoumean.go +++ b/internal/getproviders/didyoumean.go @@ -174,7 +174,7 @@ func findLegacyProviderLookupSource(host svchost.Hostname, source Source) *Regis // This method exists only to allow compatibility with unqualified names // in older configurations. New configurations should be written so as not to // depend on it, and this fallback mechanism will likely be removed altogether -// in a future Terraform version. +// in a future OpenTofu version. func (s *RegistrySource) lookupLegacyProviderNamespace(ctx context.Context, hostname svchost.Hostname, typeName string) (string, string, error) { client, err := s.registryClient(hostname) if err != nil { diff --git a/internal/getproviders/hash.go b/internal/getproviders/hash.go index a8e7bd6c31..1f532f4828 100644 --- a/internal/getproviders/hash.go +++ b/internal/getproviders/hash.go @@ -36,7 +36,7 @@ const NilHash = Hash("") // ParseHash parses the string representation of a Hash into a Hash value. // -// A particular version of Terraform only supports a fixed set of hash schemes, +// A particular version of OpenTofu only supports a fixed set of hash schemes, // but this function intentionally allows unrecognized schemes so that we can // silently ignore other schemes that may be introduced in the future. For // that reason, the Scheme method of the returned Hash may return a value that @@ -116,7 +116,7 @@ func (h Hash) GoString() string { return fmt.Sprintf("getproviders.HashSchemeZip.New(%q)", h.Value()) default: // This fallback is for when we encounter lock files or API responses - // with hash schemes that the current version of Terraform isn't + // with hash schemes that the current version of OpenTofu isn't // familiar with. They were presumably introduced in a later version. return fmt.Sprintf("getproviders.HashScheme(%q).New(%q)", scheme, h.Value()) } @@ -261,7 +261,7 @@ func PackageMatchesAnyHash(loc PackageLocation, allowed []Hash) (bool, error) { } // PreferredHashes examines all of the given hash strings and returns the one -// that the current version of Terraform considers to provide the strongest +// that the current version of OpenTofu considers to provide the strongest // verification. // // Returns an empty string if none of the given hashes are of a supported @@ -356,7 +356,7 @@ func PackageHashV1(loc PackageLocation) (Hash, error) { // changes by being used in a wide array of go.sum files already. // // In particular, it also supports computing an equivalent hash from - // an unpacked zip file, which is not important for Terraform workflow + // an unpacked zip file, which is not important for OpenTofu workflow // today but is likely to become so in future if we adopt a top-level // lockfile mechanism that is intended to be checked in to version control, // rather than just a transient lock for a particular local cache directory. diff --git a/internal/getproviders/package_authentication.go b/internal/getproviders/package_authentication.go index f23f32a13d..183d122f0c 100644 --- a/internal/getproviders/package_authentication.go +++ b/internal/getproviders/package_authentication.go @@ -134,7 +134,7 @@ type PackageAuthenticationHashes interface { // hashes with different schemes, which means that all of them are equally // acceptable. Implementors may also return hashes that use schemes the // current version of the authenticator would not allow but that could be - // accepted by other versions of Terraform, e.g. if a particular hash + // accepted by other versions of OpenTofu, e.g. if a particular hash // scheme has been deprecated. // // Authenticators that don't use hashes as their authentication procedure @@ -202,11 +202,11 @@ type packageHashAuthentication struct { // NewPackageHashAuthentication returns a PackageAuthentication implementation // that checks whether the contents of the package match whatever subset of the -// given hashes are considered acceptable by the current version of Terraform. +// given hashes are considered acceptable by the current version of OpenTofu. // // This uses the hash algorithms implemented by functions PackageHash and // MatchesHash. The PreferredHashes function will select which of the given -// hashes are considered by Terraform to be the strongest verification, and +// hashes are considered by OpenTofu to be the strongest verification, and // authentication succeeds as long as one of those matches. func NewPackageHashAuthentication(platform Platform, validHashes []Hash) PackageAuthentication { requiredHashes := PreferredHashes(validHashes) @@ -221,7 +221,7 @@ func (a packageHashAuthentication) AuthenticatePackage(localLocation PackageLoca if len(a.RequiredHashes) == 0 { // Indicates that none of the hashes given to // NewPackageHashAuthentication were considered to be usable by this - // version of Terraform. + // version of OpenTofu. return nil, fmt.Errorf("this version of OpenTofu does not support any of the checksum formats given for this provider") } @@ -247,9 +247,9 @@ func (a packageHashAuthentication) AuthenticatePackage(localLocation PackageLoca } func (a packageHashAuthentication) AcceptableHashes() []Hash { - // In this case we include even hashes the current version of Terraform + // In this case we include even hashes the current version of OpenTofu // doesn't prefer, because this result is used for building a lock file - // and so it's helpful to include older hash formats that other Terraform + // and so it's helpful to include older hash formats that other OpenTofu // versions might need in order to do authentication successfully. return a.AllHashes } diff --git a/internal/getproviders/types.go b/internal/getproviders/types.go index d3276c1031..10bbee247a 100644 --- a/internal/getproviders/types.go +++ b/internal/getproviders/types.go @@ -174,7 +174,7 @@ var CurrentPlatform = Platform{ // Package findproviders does no signature verification or protocol version // compatibility checking of its own. A caller receving a PackageMeta must // verify that it has a correct signature and supports a protocol version -// accepted by the current version of Terraform before trying to use the +// accepted by the current version of OpenTofu before trying to use the // described package. type PackageMeta struct { Provider addrs.Provider @@ -255,7 +255,7 @@ func (m PackageMeta) PackedFilePath(baseDir string) string { // intent that in most cases it will be used as an additional cross-check in // addition to a platform-specific hash check made during installation. However, // there are some situations (such as verifying an already-installed package -// that's on local disk) where Terraform would check only against the results +// that's on local disk) where OpenTofu would check only against the results // of this function, meaning that it would in principle accept another // platform's package as a substitute for the correct platform. That's a // pragmatic compromise to allow lock files derived from the result of this @@ -291,7 +291,7 @@ type PackageLocation interface { // PackageLocalArchive is the location of a provider distribution archive file // in the local filesystem. Its value is a local filesystem path using the // syntax understood by Go's standard path/filepath package on the operating -// system where Terraform is running. +// system where OpenTofu is running. type PackageLocalArchive string func (p PackageLocalArchive) packageLocation() {} @@ -300,7 +300,7 @@ func (p PackageLocalArchive) String() string { return string(p) } // PackageLocalDir is the location of a directory containing an unpacked // provider distribution archive in the local filesystem. Its value is a local // filesystem path using the syntax understood by Go's standard path/filepath -// package on the operating system where Terraform is running. +// package on the operating system where OpenTofu is running. type PackageLocalDir string func (p PackageLocalDir) packageLocation() {} @@ -387,7 +387,7 @@ func (l PackageMetaList) FilterProviderPlatformExactVersion(provider addrs.Provi func VersionConstraintsString(spec VersionConstraints) string { // (we have our own function for this because the upstream versions // library prefers to use npm/cargo-style constraint syntax, but - // Terraform prefers Ruby-like. Maybe we can upstream a "RubyLikeString") + // OpenTofu prefers Ruby-like. Maybe we can upstream a "RubyLikeString") // function to do this later, but having this in here avoids blocking on // that and this is the sort of thing that is unlikely to need ongoing // maintenance because the version constraint syntax is unlikely to change.) diff --git a/internal/httpclient/client.go b/internal/httpclient/client.go index 1a3305b63a..67a844c7d4 100644 --- a/internal/httpclient/client.go +++ b/internal/httpclient/client.go @@ -11,7 +11,7 @@ import ( ) // New returns the DefaultPooledClient from the cleanhttp -// package that will also send a Terraform User-Agent string. +// package that will also send a OpenTofu User-Agent string. func New() *http.Client { cli := cleanhttp.DefaultPooledClient() cli.Transport = &userAgentRoundTripper{ diff --git a/internal/legacy/helper/acctest/acctest.go b/internal/legacy/helper/acctest/acctest.go index 06b0229b15..93f82d2fc3 100644 --- a/internal/legacy/helper/acctest/acctest.go +++ b/internal/legacy/helper/acctest/acctest.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -// Package acctest contains for Terraform Acceptance Tests +// Package acctest contains for OpenTofu Acceptance Tests package acctest diff --git a/internal/legacy/helper/schema/core_schema.go b/internal/legacy/helper/schema/core_schema.go index f5b1e80975..99c0afafd4 100644 --- a/internal/legacy/helper/schema/core_schema.go +++ b/internal/legacy/helper/schema/core_schema.go @@ -12,10 +12,10 @@ import ( // The functions and methods in this file are concerned with the conversion // of this package's schema model into the slightly-lower-level schema model -// used by Terraform core for configuration parsing. +// used by OpenTofu core for configuration parsing. // CoreConfigSchema lowers the receiver to the schema model expected by -// Terraform core. +// OpenTofu core. // // This lower-level model has fewer features than the schema in this package, // describing only the basic structure of configuration and state values we @@ -91,7 +91,7 @@ func (m schemaMap) CoreConfigSchema() *configschema.Block { func (s *Schema) coreConfigSchemaAttribute() *configschema.Attribute { // The Schema.DefaultFunc capability adds some extra weirdness here since // it can be combined with "Required: true" to create a situation where - // required-ness is conditional. Terraform Core doesn't share this concept, + // required-ness is conditional. OpenTofu Core doesn't share this concept, // so we must sniff for this possibility here and conditionally turn // off the "Required" flag if it looks like the DefaultFunc is going // to provide a value. diff --git a/internal/legacy/helper/schema/doc.go b/internal/legacy/helper/schema/doc.go index 230e30e827..aa2653cabb 100644 --- a/internal/legacy/helper/schema/doc.go +++ b/internal/legacy/helper/schema/doc.go @@ -2,7 +2,7 @@ // SPDX-License-Identifier: MPL-2.0 // Package schema is a legacy package that used to represent the SDK, which is now its own -// library external to Terraform Core https://github.com/hashicorp/terraform-plugin-sdk +// library external to OpenTofu Core https://github.com/hashicorp/terraform-plugin-sdk // Some of it is still used by Terraform's remote state backends, but this entire // package should be removed in the future. package schema diff --git a/internal/legacy/helper/schema/provisioner.go b/internal/legacy/helper/schema/provisioner.go index a7366285c9..9ddf978d64 100644 --- a/internal/legacy/helper/schema/provisioner.go +++ b/internal/legacy/helper/schema/provisioner.go @@ -14,11 +14,11 @@ import ( "github.com/opentofu/opentofu/internal/legacy/tofu" ) -// Provisioner represents a resource provisioner in Terraform and properly +// Provisioner represents a resource provisioner in OpenTofu and properly // implements all of the ResourceProvisioner API. // // This higher level structure makes it much easier to implement a new or -// custom provisioner for Terraform. +// custom provisioner for OpenTofu. // // The function callbacks for this structure are all passed a context object. // This context object has a number of pre-defined values that can be accessed @@ -66,7 +66,7 @@ var ( // Guaranteed to never be nil. ProvConfigDataKey = contextKey("provider config data") - // This returns a terraform.UIOutput. Guaranteed to never be nil. + // This returns a tofu.UIOutput. Guaranteed to never be nil. ProvOutputKey = contextKey("provider output") // This returns the raw InstanceState passed to Apply. Guaranteed to @@ -138,7 +138,7 @@ func (p *Provisioner) Apply( { // We first need to turn the connection information into a - // terraform.ResourceConfig so that we can use that type to more + // tofu.ResourceConfig so that we can use that type to more // easily build a ResourceData structure. We do this by simply treating // the conn info as configuration input. raw := make(map[string]interface{}) diff --git a/internal/legacy/helper/schema/resource.go b/internal/legacy/helper/schema/resource.go index d3b38bc12d..cb175a54c5 100644 --- a/internal/legacy/helper/schema/resource.go +++ b/internal/legacy/helper/schema/resource.go @@ -32,14 +32,14 @@ var ReservedResourceFields = []string{ "provisioner", } -// Resource represents a thing in Terraform that has a set of configurable +// Resource represents a thing in OpenTofu that has a set of configurable // attributes and a lifecycle (create, read, update, delete). // // The Resource schema is an abstraction that allows provider writers to // worry only about CRUD operations while off-loading validation, diff // generation, etc. to this higher level library. // -// In spite of the name, this struct is not used only for terraform resources, +// In spite of the name, this struct is not used only for tofu resources, // but also for data sources. In the case of data sources, the Create, // Update and Delete functions must not be provided. type Resource struct { @@ -86,7 +86,7 @@ type Resource struct { // StateUpgraders contains the functions responsible for upgrading an // existing state with an old schema version to a newer schema. It is - // called specifically by Terraform when the stored schema version is less + // called specifically by OpenTofu when the stored schema version is less // than the current SchemaVersion of the Resource. // // StateUpgraders map specific schema versions to a StateUpgrader @@ -127,14 +127,14 @@ type Resource struct { Exists ExistsFunc // CustomizeDiff is a custom function for working with the diff that - // Terraform has created for this resource - it can be used to customize the + // OpenTofu has created for this resource - it can be used to customize the // diff that has been created, diff values not controlled by configuration, // or even veto the diff altogether and abort the plan. It is passed a // *ResourceDiff, a structure similar to ResourceData but lacking most write // functions like Set, while introducing new functions that work with the // diff such as SetNew, SetNewComputed, and ForceNew. // - // The phases Terraform runs this in, and the state available via functions + // The phases OpenTofu runs this in, and the state available via functions // like Get and GetChange, are as follows: // // * New resource: One run with no state @@ -273,7 +273,7 @@ func (r *Resource) Apply( data.timeouts = &rt if s == nil { - // The Terraform API dictates that this should never happen, but + // The OpenTofu API dictates that this should never happen, but // it doesn't hurt to be safe in this case. s = new(tofu.InstanceState) } diff --git a/internal/legacy/helper/schema/resource_importer.go b/internal/legacy/helper/schema/resource_importer.go index a2b84c61db..530ea7c642 100644 --- a/internal/legacy/helper/schema/resource_importer.go +++ b/internal/legacy/helper/schema/resource_importer.go @@ -3,25 +3,25 @@ package schema -// ResourceImporter defines how a resource is imported in Terraform. This +// ResourceImporter defines how a resource is imported in OpenTofu. This // can be set onto a Resource struct to make it Importable. Not all resources // have to be importable; if a Resource doesn't have a ResourceImporter then // it won't be importable. // -// "Importing" in Terraform is the process of taking an already-created -// resource and bringing it under Terraform management. This can include -// updating Terraform state, generating Terraform configuration, etc. +// "Importing" in OpenTofu is the process of taking an already-created +// resource and bringing it under OpenTofu management. This can include +// updating OpenTofu state, generating OpenTofu configuration, etc. type ResourceImporter struct { // The functions below must all be implemented for importing to work. // State is called to convert an ID to one or more InstanceState to - // insert into the Terraform state. If this isn't specified, then + // insert into the OpenTofu state. If this isn't specified, then // the ID is passed straight through. State StateFunc } // StateFunc is the function called to import a resource into the -// Terraform state. It is given a ResourceData with only ID set. This +// OpenTofu state. It is given a ResourceData with only ID set. This // ID is going to be an arbitrary value given by the user and may not map // directly to the ID format that the resource expects, so that should // be validated. diff --git a/internal/legacy/tofu/resource_provisioner.go b/internal/legacy/tofu/resource_provisioner.go index b61ccf9a45..318724dd0d 100644 --- a/internal/legacy/tofu/resource_provisioner.go +++ b/internal/legacy/tofu/resource_provisioner.go @@ -10,7 +10,7 @@ import ( // ResourceProvisioner is an interface that must be implemented by any // resource provisioner: the thing that initializes resources in -// a Terraform configuration. +// a OpenTofu configuration. type ResourceProvisioner interface { // GetConfigSchema returns the schema for the provisioner type's main // configuration block. This is called prior to Validate to enable some @@ -38,15 +38,15 @@ type ResourceProvisioner interface { // Stop is called when the provisioner should halt any in-flight actions. // - // This can be used to make a nicer Ctrl-C experience for Terraform. + // This can be used to make a nicer Ctrl-C experience for OpenTofu. // Even if this isn't implemented to do anything (just returns nil), - // Terraform will still cleanly stop after the currently executing + // OpenTofu will still cleanly stop after the currently executing // graph node is complete. However, this API can be used to make more // efficient halts. // // Stop doesn't have to and shouldn't block waiting for in-flight actions // to complete. It should take any action it wants and return immediately - // acknowledging it has received the stop request. Terraform core will + // acknowledging it has received the stop request. OpenTofu core will // automatically not make any further API calls to the provider soon // after Stop is called (technically exactly once the currently executing // graph nodes are complete). diff --git a/internal/legacy/tofu/schemas.go b/internal/legacy/tofu/schemas.go index 2128434dc6..ea3f1e9c74 100644 --- a/internal/legacy/tofu/schemas.go +++ b/internal/legacy/tofu/schemas.go @@ -15,7 +15,7 @@ import ( "github.com/opentofu/opentofu/internal/tfdiags" ) -// Schemas is a container for various kinds of schema that Terraform needs +// Schemas is a container for various kinds of schema that OpenTofu needs // during processing. type Schemas struct { Providers map[addrs.Provider]*ProviderSchema diff --git a/internal/legacy/tofu/state.go b/internal/legacy/tofu/state.go index a2f3246995..243c4cb58e 100644 --- a/internal/legacy/tofu/state.go +++ b/internal/legacy/tofu/state.go @@ -48,7 +48,7 @@ var rootModulePath = []string{"root"} // have a redundant "root" label at the start of it) into an // addrs.ModuleInstance representing the same module. // -// For legacy reasons, different parts of Terraform disagree about whether the +// For legacy reasons, different parts of OpenTofu disagree about whether the // root module has the path []string{} or []string{"root"}, and so this // function accepts both and trims off the "root". An implication of this is // that it's not possible to actually have a module call in the root module @@ -78,14 +78,14 @@ func normalizeModulePath(p []string) addrs.ModuleInstance { return ret } -// State keeps track of a snapshot state-of-the-world that Terraform +// State keeps track of a snapshot state-of-the-world that OpenTofu // can use to keep track of what real world resources it is actually // managing. type State struct { // Version is the state file protocol version. Version int `json:"version"` - // TFVersion is the version of Terraform that wrote this state. + // TFVersion is the version of OpenTofu that wrote this state. TFVersion string `json:"terraform_version,omitempty"` // Serial is incremented on any operation that modifies @@ -188,7 +188,7 @@ func (s *State) addModule(path addrs.ModuleInstance) *ModuleState { legacyPath[0] = "root" for i, step := range path { if step.InstanceKey != addrs.NoKey { - // FIXME: Once the rest of Terraform is ready to use count and + // FIXME: Once the rest of OpenTofu is ready to use count and // for_each, remove all of this and just write the addrs.ModuleInstance // value itself into the ModuleState. panic("state cannot represent modules with count or for_each keys") @@ -283,8 +283,8 @@ func (s *State) IsRemote() bool { // Validate validates the integrity of this state file. // -// Certain properties of the statefile are expected by Terraform in order -// to behave properly. The core of Terraform will assume that once it +// Certain properties of the statefile are expected by OpenTofu in order +// to behave properly. The core of OpenTofu will assume that once it // receives a State structure that it has been validated. This validation // check should be called to ensure that. // @@ -547,7 +547,7 @@ const ( // // This is a simple check using the state's serial, and is thus only as // reliable as the serial itself. In the normal case, only one state -// exists for a given combination of lineage/serial, but Terraform +// exists for a given combination of lineage/serial, but OpenTofu // does not guarantee this and so the result of this method should be // used with care. // @@ -617,7 +617,7 @@ func (s *State) DeepCopy() *State { return copy.(*State) } -// FromFutureTerraform checks if this state was written by a Terraform +// FromFutureTerraform checks if this state was written by a OpenTofu // version from the future. func (s *State) FromFutureTerraform() bool { s.Lock() @@ -986,12 +986,12 @@ type ModuleState struct { // existing to remain intact. For example: an module may depend // on a VPC ID given by an aws_vpc resource. // - // Terraform uses this information to build valid destruction + // OpenTofu uses this information to build valid destruction // orders and to warn the user if they're destroying a module that // another resource depends on. // // Things can be put into this list that may not be managed by - // Terraform. If Terraform doesn't find a matching ID in the + // OpenTofu. If OpenTofu doesn't find a matching ID in the // overall state, then it assumes it isn't managed and doesn't // worry about it. Dependencies []string `json:"depends_on"` @@ -1428,7 +1428,7 @@ func ParseResourceStateKey(k string) (*ResourceStateKey, error) { // Extra is just extra data that a provider can return that we store // for later, but is not exposed in any way to the user. type ResourceState struct { - // This is filled in and managed by Terraform, and is the resource + // This is filled in and managed by OpenTofu, and is the resource // type itself such as "mycloud_instance". If a resource provider sets // this value, it won't be persisted. Type string `json:"type"` @@ -1438,12 +1438,12 @@ type ResourceState struct { // depend on a subnet (which itself might depend on a VPC, and so // on). // - // Terraform uses this information to build valid destruction + // OpenTofu uses this information to build valid destruction // orders and to warn the user if they're destroying a resource that // another resource depends on. // // Things can be put into this list that may not be managed by - // Terraform. If Terraform doesn't find a matching ID in the + // OpenTofu. If OpenTofu doesn't find a matching ID in the // overall state, then it assumes it isn't managed and doesn't // worry about it. Dependencies []string `json:"depends_on"` @@ -1615,22 +1615,22 @@ func (s *ResourceState) String() string { // InstanceState is used to track the unique state information belonging // to a given instance. type InstanceState struct { - // A unique ID for this resource. This is opaque to Terraform + // A unique ID for this resource. This is opaque to OpenTofu // and is only meant as a lookup mechanism for the providers. ID string `json:"id"` // Attributes are basic information about the resource. Any keys here - // are accessible in variable format within Terraform configurations: + // are accessible in variable format within OpenTofu configurations: // ${resourcetype.name.attribute}. Attributes map[string]string `json:"attributes"` // Ephemeral is used to store any state associated with this instance - // that is necessary for the Terraform run to complete, but is not + // that is necessary for the OpenTofu run to complete, but is not // persisted to a state file. Ephemeral EphemeralState `json:"-"` // Meta is a simple K/V map that is persisted to the State but otherwise - // ignored by Terraform core. It's meant to be used for accounting by + // ignored by OpenTofu core. It's meant to be used for accounting by // external client code. The value here must only contain Go primitives // and collections. Meta map[string]interface{} `json:"meta"` diff --git a/internal/logging/logging.go b/internal/logging/logging.go index 92c33048dd..85a92a1f88 100644 --- a/internal/logging/logging.go +++ b/internal/logging/logging.go @@ -34,7 +34,7 @@ const ( ) var ( - // ValidLevels are the log level names that Terraform recognizes. + // ValidLevels are the log level names that OpenTofu recognizes. ValidLevels = []string{"TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF"} // logger is the global hclog logger diff --git a/internal/logging/panic.go b/internal/logging/panic.go index b6ee7c158a..02fb2cda93 100644 --- a/internal/logging/panic.go +++ b/internal/logging/panic.go @@ -33,14 +33,14 @@ shown below, and any additional information which may help replicate the issue. // recovered by PanicHandler starts printing. var panicMutex sync.Mutex -// PanicHandler is called to recover from an internal panic in Terraform, and +// PanicHandler is called to recover from an internal panic in OpenTofu, and // augments the standard stack trace with a more user friendly error message. // PanicHandler must be called as a defered function, and must be the first // defer called at the start of a new goroutine. func PanicHandler() { // Have all managed goroutines checkin here, and prevent them from exiting // if there's a panic in progress. While this can't lock the entire runtime - // to block progress, we can prevent some cases where Terraform may return + // to block progress, we can prevent some cases where OpenTofu may return // early before the panic has been printed out. panicMutex.Lock() defer panicMutex.Unlock() diff --git a/internal/modsdir/manifest.go b/internal/modsdir/manifest.go index ec431bca98..fc69d8a782 100644 --- a/internal/modsdir/manifest.go +++ b/internal/modsdir/manifest.go @@ -98,7 +98,7 @@ func ReadManifestSnapshot(r io.Reader) (Manifest, error) { // Historically we didn't normalize the module source addresses when // writing them into the manifest, and so we'll make a best effort // to normalize them back in on read so that we can just gracefully - // upgrade on the next "terraform init". + // upgrade on the next "tofu init". if record.SourceAddr != "" { if addr, err := addrs.ParseModuleSource(record.SourceAddr); err == nil { // This is a best effort sort of thing. If the source @@ -116,7 +116,7 @@ func ReadManifestSnapshot(r io.Reader) (Manifest, error) { if _, exists := new[record.Key]; exists { // This should never happen in any valid file, so we'll catch it // and report it to avoid confusing/undefined behavior if the - // snapshot file was edited incorrectly outside of Terraform. + // snapshot file was edited incorrectly outside of OpenTofu. return nil, fmt.Errorf("snapshot file contains two records for path %s", record.Key) } new[record.Key] = record diff --git a/internal/moduledeps/doc.go b/internal/moduledeps/doc.go index c1a0748a73..e8dfcdd4ea 100644 --- a/internal/moduledeps/doc.go +++ b/internal/moduledeps/doc.go @@ -5,6 +5,6 @@ // providers required for all of the modules in a module tree. // // It does not itself contain the functionality for populating such -// data structures; that's in Terraform core, since this package intentionally -// does not depend on terraform core to avoid package dependency cycles. +// data structures; that's in OpenTofu core, since this package intentionally +// does not depend on OpenTofu core to avoid package dependency cycles. package moduledeps diff --git a/internal/moduletest/run.go b/internal/moduletest/run.go index df2cde4f6a..33530a0930 100644 --- a/internal/moduletest/run.go +++ b/internal/moduletest/run.go @@ -112,17 +112,17 @@ func (run *Run) GetReferences() ([]*addrs.Reference, tfdiags.Diagnostics) { // test will fail later. // 3. Adds diagnostics for any expected failures that were not satisfied. // -// Point 2 is a bit complicated so worth expanding on. In normal Terraform +// Point 2 is a bit complicated so worth expanding on. In normal OpenTofu // execution, any error that originates within a check block (either from an // assertion or a scoped data source) is wrapped up as a Warning to be -// identified to the user but not to fail the actual Terraform operation. During +// identified to the user but not to fail the actual OpenTofu operation. During // test execution, we want to upgrade (or rollback) these warnings into errors // again so the test will fail. We do that as part of this function as we are // already processing the diagnostics from check blocks in here anyway. // // The way the function works out which diagnostics are relevant to expected // failures is by using the tfdiags Extra functionality to detect which -// diagnostics were generated by custom conditions. Terraform adds the +// diagnostics were generated by custom conditions. OpenTofu adds the // addrs.CheckRule that generated each diagnostic to the diagnostic itself so we // can tell which diagnostics can be expected. func (run *Run) ValidateExpectedFailures(originals tfdiags.Diagnostics) tfdiags.Diagnostics { diff --git a/internal/plans/planfile/tfplan.go b/internal/plans/planfile/tfplan.go index 0675c638bb..ef332e33a9 100644 --- a/internal/plans/planfile/tfplan.go +++ b/internal/plans/planfile/tfplan.go @@ -269,7 +269,7 @@ func resourceChangeFromTfplan(rawChange *planproto.ResourceInstanceChange) (*pla if rawChange.Addr == "" { // If "Addr" isn't populated then seems likely that this is a plan - // file created by an earlier version of Terraform, which had the + // file created by an earlier version of OpenTofu, which had the // same information spread over various other fields: // ModulePath, Mode, Name, Type, and InstanceKey. return nil, fmt.Errorf("no instance address for resource instance change; perhaps this plan was created by a different version of OpenTofu or a different version of Terraform?") diff --git a/internal/plugin/convert/schema.go b/internal/plugin/convert/schema.go index 9f9c2cc57a..13d778857d 100644 --- a/internal/plugin/convert/schema.go +++ b/internal/plugin/convert/schema.go @@ -97,7 +97,7 @@ func ProtoToProviderSchema(s *proto.Schema) providers.Schema { } // ProtoToConfigSchema takes the GetSchcema_Block from a grpc response and converts it -// to a terraform *configschema.Block. +// to a tofu *configschema.Block. func ProtoToConfigSchema(b *proto.Schema_Block) *configschema.Block { block := &configschema.Block{ Attributes: make(map[string]*configschema.Attribute), diff --git a/internal/plugin/ui_input.go b/internal/plugin/ui_input.go index 499fd82345..fc565c5ba9 100644 --- a/internal/plugin/ui_input.go +++ b/internal/plugin/ui_input.go @@ -11,7 +11,7 @@ import ( "github.com/opentofu/opentofu/internal/tofu" ) -// UIInput is an implementation of terraform.UIInput that communicates +// UIInput is an implementation of tofu.UIInput that communicates // over RPC. type UIInput struct { Client *rpc.Client diff --git a/internal/plugin/ui_output.go b/internal/plugin/ui_output.go index ef7b1463df..5a4e90d99b 100644 --- a/internal/plugin/ui_output.go +++ b/internal/plugin/ui_output.go @@ -9,7 +9,7 @@ import ( "github.com/opentofu/opentofu/internal/tofu" ) -// UIOutput is an implementatin of terraform.UIOutput that communicates +// UIOutput is an implementatin of tofu.UIOutput that communicates // over RPC. type UIOutput struct { Client *rpc.Client diff --git a/internal/plugin6/convert/schema.go b/internal/plugin6/convert/schema.go index 8634363fb7..ab6e669324 100644 --- a/internal/plugin6/convert/schema.go +++ b/internal/plugin6/convert/schema.go @@ -103,7 +103,7 @@ func ProtoToProviderSchema(s *proto.Schema) providers.Schema { } // ProtoToConfigSchema takes the GetSchcema_Block from a grpc response and converts it -// to a terraform *configschema.Block. +// to a tofu *configschema.Block. func ProtoToConfigSchema(b *proto.Schema_Block) *configschema.Block { block := &configschema.Block{ Attributes: make(map[string]*configschema.Attribute), diff --git a/internal/providercache/installer.go b/internal/providercache/installer.go index 7ecd29be36..3fb615267b 100644 --- a/internal/providercache/installer.go +++ b/internal/providercache/installer.go @@ -48,12 +48,12 @@ type Installer struct { // builtInProviderTypes is an optional set of types that should be // considered valid to appear in the special terraform.io/builtin/... - // namespace, which we use for providers that are built in to Terraform + // namespace, which we use for providers that are built in to OpenTofu // and thus do not need any separate installation step. builtInProviderTypes []string // unmanagedProviderTypes is a set of provider addresses that should be - // considered implemented, but that Terraform does not manage the + // considered implemented, but that OpenTofu does not manage the // lifecycle for, and therefore does not need to worry about the // installation of. unmanagedProviderTypes map[addrs.Provider]struct{} @@ -121,7 +121,7 @@ func (i *Installer) SetGlobalCacheDir(cacheDir *Dir) { // If this is set then if we install a provider for the first time from the // cache then the dependency lock file will include only the checksum from // the package in the global cache, which means the lock file won't be portable -// to Terraform running on another operating system or CPU architecture. +// to OpenTofu running on another operating system or CPU architecture. func (i *Installer) SetGlobalCacheDirMayBreakDependencyLockFile(mayBreak bool) { i.globalCacheDirMayBreakDependencyLockFile = mayBreak } @@ -135,7 +135,7 @@ func (i *Installer) HasGlobalCacheDir() bool { // SetBuiltInProviderTypes tells the receiver to consider the type names in the // given slice to be valid as providers in the special special // terraform.io/builtin/... namespace that we use for providers that are -// built in to Terraform and thus do not need a separate installation step. +// built in to OpenTofu and thus do not need a separate installation step. // // If a caller requests installation of a provider in that namespace, the // installer will treat it as a no-op if its name exists in this list, but @@ -151,10 +151,10 @@ func (i *Installer) SetBuiltInProviderTypes(types []string) { } // SetUnmanagedProviderTypes tells the receiver to consider the providers -// indicated by the passed addrs.Providers as unmanaged. Terraform does not +// indicated by the passed addrs.Providers as unmanaged. OpenTofu does not // need to control the lifecycle of these providers, and they are assumed to be -// running already when Terraform is started. Because these are essentially -// processes, not binaries, Terraform will not do any work to ensure presence +// running already when OpenTofu is started. Because these are essentially +// processes, not binaries, OpenTofu will not do any work to ensure presence // or versioning of these binaries. func (i *Installer) SetUnmanagedProviderTypes(types map[addrs.Provider]struct{}) { i.unmanagedProviderTypes = types @@ -224,7 +224,7 @@ func (i *Installer) EnsureProviderVersions(ctx context.Context, locks *depsfile. } else { // A built-in provider is not permitted to have an explicit // version constraint, because we can only use the version - // that is built in to the current Terraform release. + // that is built in to the current OpenTofu release. err = fmt.Errorf("built-in providers do not support explicit version constraints") } } else { diff --git a/internal/providercache/installer_events.go b/internal/providercache/installer_events.go index 567fd3a75e..41e575487d 100644 --- a/internal/providercache/installer_events.go +++ b/internal/providercache/installer_events.go @@ -44,13 +44,13 @@ type InstallerEvents struct { ProviderAlreadyInstalled func(provider addrs.Provider, selectedVersion getproviders.Version) // The BuiltInProvider... family of events describe the outcome for any - // requested providers that are built in to Terraform. Only one of these + // requested providers that are built in to OpenTofu. Only one of these // methods will be called for each such provider, and no other method // will be called for them except that they are included in the // aggregate PendingProviders map. // // The "Available" event reports that the requested builtin provider is - // available in this release of Terraform. The "Failure" event reports + // available in this release of OpenTofu. The "Failure" event reports // either that the provider is unavailable or that the request for it // is invalid somehow. BuiltInProviderAvailable func(provider addrs.Provider) diff --git a/internal/providercache/installer_test.go b/internal/providercache/installer_test.go index 2fe5b267f0..3594e1e71d 100644 --- a/internal/providercache/installer_test.go +++ b/internal/providercache/installer_test.go @@ -1487,7 +1487,7 @@ func TestEnsureProviderVersions(t *testing.T) { Check: func(t *testing.T, dir *Dir, locks *depsfile.Locks) { // Built-in providers are neither included in the cache // directory nor mentioned in the lock file, because they - // are compiled directly into the Terraform executable. + // are compiled directly into the OpenTofu executable. if allCached := dir.AllAvailablePackages(); len(allCached) != 0 { t.Errorf("wrong number of cache directory entries; want none\n%s", spew.Sdump(allCached)) } diff --git a/internal/providers/doc.go b/internal/providers/doc.go index 4068da2e3b..f840ffadd3 100644 --- a/internal/providers/doc.go +++ b/internal/providers/doc.go @@ -2,5 +2,5 @@ // SPDX-License-Identifier: MPL-2.0 // Package providers contains the interface and primary types required to -// implement a Terraform resource provider. +// implement a OpenTofu resource provider. package providers diff --git a/internal/providers/provider.go b/internal/providers/provider.go index e76263816d..c815f6c2ec 100644 --- a/internal/providers/provider.go +++ b/internal/providers/provider.go @@ -44,7 +44,7 @@ type Interface interface { // // Stop should not block waiting for in-flight actions to complete. It // should take any action it wants and return immediately acknowledging it - // has received the stop request. Terraform will not make any further API + // has received the stop request. OpenTofu will not make any further API // calls to the provider after Stop is called. // // The error returned, if non-nil, is assumed to mean that signaling the @@ -192,8 +192,8 @@ type UpgradeResourceStateResponse struct { } type ConfigureProviderRequest struct { - // Terraform version is the version string from the running instance of - // terraform. Providers can use TerraformVersion to verify compatibility, + // OpenTofu version is the version string from the running instance of + // tofu. Providers can use TerraformVersion to verify compatibility, // and to store for informational purposes. TerraformVersion string @@ -275,7 +275,7 @@ type PlanResourceChangeResponse struct { // resource replacement. RequiresReplace []cty.Path - // PlannedPrivate is an opaque blob that is not interpreted by terraform + // PlannedPrivate is an opaque blob that is not interpreted by tofu // core. This will be saved and relayed back to the provider during // ApplyResourceChange. PlannedPrivate []byte @@ -284,7 +284,7 @@ type PlanResourceChangeResponse struct { Diagnostics tfdiags.Diagnostics // LegacyTypeSystem is set only if the provider is using the legacy SDK - // whose type system cannot be precisely mapped into the Terraform type + // whose type system cannot be precisely mapped into the OpenTofu type // system. We use this to bypass certain consistency checks that would // otherwise fail due to this imprecise mapping. No other provider or SDK // implementation is permitted to set this. @@ -332,7 +332,7 @@ type ApplyResourceChangeResponse struct { Diagnostics tfdiags.Diagnostics // LegacyTypeSystem is set only if the provider is using the legacy SDK - // whose type system cannot be precisely mapped into the Terraform type + // whose type system cannot be precisely mapped into the OpenTofu type // system. We use this to bypass certain consistency checks that would // otherwise fail due to this imprecise mapping. No other provider or SDK // implementation is permitted to set this. @@ -359,7 +359,7 @@ type ImportResourceStateResponse struct { Diagnostics tfdiags.Diagnostics } -// ImportedResource represents an object being imported into Terraform with the +// ImportedResource represents an object being imported into OpenTofu with the // help of a provider. An ImportedObject is a RemoteObject that has been read // by the provider's import handler but hasn't yet been committed to state. type ImportedResource struct { diff --git a/internal/provisioners/doc.go b/internal/provisioners/doc.go index 5f6c18b62b..94dca371f4 100644 --- a/internal/provisioners/doc.go +++ b/internal/provisioners/doc.go @@ -2,5 +2,5 @@ // SPDX-License-Identifier: MPL-2.0 // Package provisioners contains the interface and primary types to implement a -// Terraform resource provisioner. +// OpenTofu resource provisioner. package provisioners diff --git a/internal/provisioners/provisioner.go b/internal/provisioners/provisioner.go index 44ef55f1f3..59cbee344d 100644 --- a/internal/provisioners/provisioner.go +++ b/internal/provisioners/provisioner.go @@ -28,7 +28,7 @@ type Interface interface { // // Stop should not block waiting for in-flight actions to complete. It // should take any action it wants and return immediately acknowledging it - // has received the stop request. Terraform will not make any further API + // has received the stop request. OpenTofu will not make any further API // calls to the provisioner after Stop is called. // // The error returned, if non-nil, is assumed to mean that signaling the diff --git a/internal/refactoring/move_statement.go b/internal/refactoring/move_statement.go index 23e34376d0..56a5a06b67 100644 --- a/internal/refactoring/move_statement.go +++ b/internal/refactoring/move_statement.go @@ -174,7 +174,7 @@ func haveMoveStatementForResource(addr addrs.AbsResource, stmts []MoveStatement) // This is not a particularly optimal way to answer this question, // particularly since our caller calls this function in a loop already, // but we expect the total number of explicit statements to be small - // in any reasonable Terraform configuration and so a more complicated + // in any reasonable OpenTofu configuration and so a more complicated // approach wouldn't be justified here. for _, stmt := range stmts { diff --git a/internal/refactoring/move_statement_test.go b/internal/refactoring/move_statement_test.go index 7efe0f1757..98374df248 100644 --- a/internal/refactoring/move_statement_test.go +++ b/internal/refactoring/move_statement_test.go @@ -88,7 +88,7 @@ func TestImpliedMoveStatements(t *testing.T) { // this state would be to remove "count = 1" and then have the // provider fail to destroy the zero-key instance even though we // already created the no-key instance. Users can also get here - // by using "terraform state mv" in weird ways. + // by using "tofu state mv" in weird ways. s.SetResourceInstanceCurrent( resourceAddr("ambiguous").Instance(addrs.NoKey), instObjState(), diff --git a/internal/refactoring/move_validate_test.go b/internal/refactoring/move_validate_test.go index faafbd7888..aa40929755 100644 --- a/internal/refactoring/move_validate_test.go +++ b/internal/refactoring/move_validate_test.go @@ -530,7 +530,7 @@ A chain of move statements must end with an address that doesn't appear in any o // loadRefactoringFixture reads a configuration from the given directory and // does some naive static processing on any count and for_each expressions // inside, in order to get a realistic-looking instances.Set for what it -// declares without having to run a full Terraform plan. +// declares without having to run a full OpenTofu plan. func loadRefactoringFixture(t *testing.T, dir string) (*configs.Config, instances.Set) { t.Helper() diff --git a/internal/registry/regsrc/module.go b/internal/registry/regsrc/module.go index 2899f2bcfe..1e683c7fa9 100644 --- a/internal/registry/regsrc/module.go +++ b/internal/registry/regsrc/module.go @@ -48,7 +48,7 @@ var ( ProviderRe = regexp.MustCompile("^" + providerSubRe + "$") // these hostnames are not allowed as registry sources, because they are - // already special case module sources in terraform. + // already special case module sources in tofu. disallowed = map[string]bool{ "github.com": true, "bitbucket.org": true, diff --git a/internal/registry/regsrc/module_test.go b/internal/registry/regsrc/module_test.go index 07fd79e643..9e628b6cca 100644 --- a/internal/registry/regsrc/module_test.go +++ b/internal/registry/regsrc/module_test.go @@ -73,7 +73,7 @@ func TestModule(t *testing.T) { ////modules/Foo and //modules/foo describe different paths, but // it's less confusing in general just to not support that. Any user // with a module with submodules in both cases is already asking for - // portability issues, and terraform can ensure it does + // portability issues, and tofu can ensure it does // case-insensitive search for the dir in those cases. wantDisplay: "испытание.com:1234/hashicorp/consul/aws//foo", wantNorm: "xn--80akhbyknj4f.com:1234/hashicorp/consul/aws//foo", diff --git a/internal/registry/response/module_versions.go b/internal/registry/response/module_versions.go index 9350635c46..9763cd2c00 100644 --- a/internal/registry/response/module_versions.go +++ b/internal/registry/response/module_versions.go @@ -4,7 +4,7 @@ package response // ModuleVersions is the response format that contains all metadata about module -// versions needed for terraform CLI to resolve version constraints. See RFC +// versions needed for tofu CLI to resolve version constraints. See RFC // TF-042 for details on this format. type ModuleVersions struct { Modules []*ModuleProviderVersions `json:"modules"` diff --git a/internal/repl/repl.go b/internal/repl/repl.go index d4853e1d11..039b5d7c54 100644 --- a/internal/repl/repl.go +++ b/internal/repl/repl.go @@ -2,6 +2,6 @@ // SPDX-License-Identifier: MPL-2.0 // Package repl provides the structs and functions necessary to run -// REPL for Terraform. The REPL allows experimentation of Terraform -// interpolations without having to run a Terraform configuration. +// REPL for OpenTofu. The REPL allows experimentation of OpenTofu +// interpolations without having to run a OpenTofu configuration. package repl diff --git a/internal/replacefile/doc.go b/internal/replacefile/doc.go index eeb3413387..b8818520f3 100644 --- a/internal/replacefile/doc.go +++ b/internal/replacefile/doc.go @@ -10,6 +10,6 @@ // // This package uses conditional compilation to select a different // implementation for Windows vs. all other platforms. It may therefore -// require further fiddling in future if Terraform is ported to another +// require further fiddling in future if OpenTofu is ported to another // OS that is neither Unix-like nor Windows. package replacefile diff --git a/internal/states/checks.go b/internal/states/checks.go index ef050c4dbc..6f5076e9e1 100644 --- a/internal/states/checks.go +++ b/internal/states/checks.go @@ -9,7 +9,7 @@ import ( ) // CheckResults represents a summary snapshot of the status of a set of checks -// declared in configuration, updated after each Terraform Core run that +// declared in configuration, updated after each OpenTofu Core run that // changes the state or remote system in a way that might impact the check // results. // @@ -42,12 +42,12 @@ type CheckResultAggregate struct { // Status is the aggregate status across all objects. // // Sometimes an error or check failure during planning will prevent - // Terraform Core from even determining the individual checkable objects + // OpenTofu Core from even determining the individual checkable objects // associated with a downstream configuration object, and that situation is // described here by this Status being checks.StatusUnknown and there being // no elements in the ObjectResults field. // - // That's different than Terraform Core explicitly reporting that there are + // That's different than OpenTofu Core explicitly reporting that there are // no instances of the config object (e.g. a resource with count = 0), // which leads to the aggregate status being checks.StatusPass while // ObjectResults is still empty. @@ -80,7 +80,7 @@ type CheckResultObject struct { // NewCheckResults constructs a new states.CheckResults object that is a // snapshot of the check statuses recorded in the given checks.State object. // -// This should be called only after a Terraform Core run has completed and +// This should be called only after a OpenTofu Core run has completed and // recorded any results from running the checks in the given object. func NewCheckResults(source *checks.State) *CheckResults { ret := &CheckResults{ diff --git a/internal/states/doc.go b/internal/states/doc.go index 98f0f991a5..b82ce87fa7 100644 --- a/internal/states/doc.go +++ b/internal/states/doc.go @@ -1,6 +1,6 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -// Package states contains the types that are used to represent Terraform +// Package states contains the types that are used to represent OpenTofu // states. package states diff --git a/internal/states/instance_object.go b/internal/states/instance_object.go index d4192a0599..4e27149498 100644 --- a/internal/states/instance_object.go +++ b/internal/states/instance_object.go @@ -21,11 +21,11 @@ import ( // Instead, create a new object and replace the existing one. type ResourceInstanceObject struct { // Value is the object-typed value representing the remote object within - // Terraform. + // OpenTofu. Value cty.Value // Private is an opaque value set by the provider when this object was - // last created or updated. Terraform Core does not use this value in + // last created or updated. OpenTofu Core does not use this value in // any way and it is not exposed anywhere in the user interface, so // a provider can use it for retaining any necessary private state. Private []byte diff --git a/internal/states/instance_object_src.go b/internal/states/instance_object_src.go index b0f317776c..8a637fef4e 100644 --- a/internal/states/instance_object_src.go +++ b/internal/states/instance_object_src.go @@ -24,7 +24,7 @@ type ResourceInstanceObjectSrc struct { // AttrsJSON is a JSON-encoded representation of the object attributes, // encoding the value (of the object type implied by the associated resource - // type schema) that represents this remote object in Terraform Language + // type schema) that represents this remote object in OpenTofu Language // expressions, and is compared with configuration when producing a diff. // // This is retained in JSON format here because it may require preprocessing diff --git a/internal/states/remote/state.go b/internal/states/remote/state.go index 57b4ff6749..f23f50d8ca 100644 --- a/internal/states/remote/state.go +++ b/internal/states/remote/state.go @@ -42,7 +42,7 @@ type State struct { disableLocks bool // If this is set then the state manager will decline to store intermediate - // state snapshots created while a Terraform Core apply operation is in + // state snapshots created while a OpenTofu Core apply operation is in // progress. Otherwise (by default) it will accept persistent snapshots // using the default rules defined in the local backend. DisableIntermediateSnapshots bool diff --git a/internal/states/remote/state_test.go b/internal/states/remote/state_test.go index d6593e6cba..3bb55a06f2 100644 --- a/internal/states/remote/state_test.go +++ b/internal/states/remote/state_test.go @@ -329,7 +329,7 @@ func TestStatePersist(t *testing.T) { Client: &mockClient{}, } - // In normal use (during a Terraform operation) we always refresh and read + // In normal use (during a OpenTofu operation) we always refresh and read // before any writes would happen, so we'll mimic that here for realism. // NB This causes a GET to be logged so the first item in the test cases // must account for this @@ -513,7 +513,7 @@ func TestWriteStateForMigration(t *testing.T) { }, } - // In normal use (during a Terraform operation) we always refresh and read + // In normal use (during a OpenTofu operation) we always refresh and read // before any writes would happen, so we'll mimic that here for realism. // NB This causes a GET to be logged so the first item in the test cases // must account for this @@ -669,7 +669,7 @@ func TestWriteStateForMigrationWithForcePushClient(t *testing.T) { }, } - // In normal use (during a Terraform operation) we always refresh and read + // In normal use (during a OpenTofu operation) we always refresh and read // before any writes would happen, so we'll mimic that here for realism. // NB This causes a GET to be logged so the first item in the test cases // must account for this diff --git a/internal/states/state.go b/internal/states/state.go index 232df6cb0a..840fd8a0b5 100644 --- a/internal/states/state.go +++ b/internal/states/state.go @@ -13,7 +13,7 @@ import ( "github.com/opentofu/opentofu/internal/getproviders" ) -// State is the top-level type of a Terraform state. +// State is the top-level type of OpenTofu state. // // A state should be mutated only via its accessor methods, to ensure that // invariants are preserved. @@ -38,7 +38,7 @@ type State struct { // from the previous run at all, which is subtly different than the // previous run having affirmatively recorded that there are no checks // to run. For example, if this object was created from a state snapshot - // created by a version of Terraform that didn't yet support checks + // created by a version of OpenTofu that didn't yet support checks // then this field will be nil. CheckResults *CheckResults } @@ -173,7 +173,7 @@ func (s *State) EnsureModule(addr addrs.ModuleInstance) *Module { // // A true result would suggest that just discarding this state without first // destroying these objects could leave "dangling" objects in remote systems, -// no longer tracked by any Terraform state. +// no longer tracked by any OpenTofu state. func (s *State) HasManagedResourceInstanceObjects() bool { if s == nil { return false @@ -220,7 +220,7 @@ func (s *State) Resources(addr addrs.ConfigResource) []*Resource { // are tracked in this state. // // This result is the set of objects that would be effectively "forgotten" -// (like "terraform state rm") if this state were totally discarded, such as +// (like "tofu state rm") if this state were totally discarded, such as // by deleting a workspace. This function is intended only for reporting // context in error messages, such as when we reject deleting a "non-empty" // workspace as detected by s.HasManagedResourceInstanceObjects. @@ -369,11 +369,11 @@ func (s *State) ProviderRequirements() getproviders.Requirements { // PruneResourceHusks is a specialized method that will remove any Resource // objects that do not contain any instances, even if they have an EachMode. // -// This should generally be used only after a "terraform destroy" operation, +// This should generally be used only after a "tofu destroy" operation, // to finalize the cleanup of the state. It is not correct to use this after // other operations because if a resource has "count = 0" or "for_each" over // an empty collection then we want to retain it in the state so that references -// to it, particularly in "strange" contexts like "terraform console", can be +// to it, particularly in "strange" contexts like "tofu console", can be // properly resolved. // // This method MUST NOT be called concurrently with other readers and writers diff --git a/internal/states/state_string.go b/internal/states/state_string.go index 6c51dde30b..0158706649 100644 --- a/internal/states/state_string.go +++ b/internal/states/state_string.go @@ -16,7 +16,7 @@ import ( // String returns a rather-odd string representation of the entire state. // -// This is intended to match the behavior of the older terraform.State.String +// This is intended to match the behavior of the older tofu.State.String // method that is used in lots of existing tests. It should not be used in // new tests: instead, use "cmp" to directly compare the state data structures // and print out a diff if they do not match. @@ -47,7 +47,7 @@ func (s *State) String() string { } // We need to build out a string that resembles the not-quite-standard - // format that terraform.State.String used to use, where there's a + // format that tofu.State.String used to use, where there's a // "module." prefix but then just a chain of all of the module names // without any further "module." portions. buf.WriteString("module") diff --git a/internal/states/state_test.go b/internal/states/state_test.go index d8288c70ac..e9494b32d0 100644 --- a/internal/states/state_test.go +++ b/internal/states/state_test.go @@ -370,11 +370,11 @@ func TestStateHasResourceInstanceObjects(t *testing.T) { }, "one empty resource husk in root module": { func(ss *SyncState) { - // Current Terraform doesn't actually create resource husks + // Current OpenTofu doesn't actually create resource husks // as part of its everyday work, so this is a "should never // happen" case but we'll test to make sure we're robust to // it anyway, because this was a historical bug blocking - // "terraform workspace delete" and similar. + // "tofu workspace delete" and similar. ss.SetResourceInstanceCurrent( mustAbsResourceAddr("test.foo").Instance(addrs.NoKey), &ResourceInstanceObjectSrc{ diff --git a/internal/states/statefile/file.go b/internal/states/statefile/file.go index 0bd7cdfb94..c9abdac423 100644 --- a/internal/states/statefile/file.go +++ b/internal/states/statefile/file.go @@ -14,7 +14,7 @@ import ( // itself along with various metadata used to track changing state files for // the same configuration over time. type File struct { - // TerraformVersion is the version of Terraform that wrote this state file. + // TerraformVersion is the version of OpenTofu that wrote this state file. TerraformVersion *version.Version // Serial is incremented on any operation that modifies diff --git a/internal/states/statefile/read.go b/internal/states/statefile/read.go index b801271ff5..c82e250e88 100644 --- a/internal/states/statefile/read.go +++ b/internal/states/statefile/read.go @@ -93,7 +93,7 @@ func readState(src []byte) (*File, error) { diags = diags.Append(tfdiags.Sourceless( tfdiags.Error, unsupportedFormat, - // This is a user-facing usage of Terraform but refers to a very old historical version of Terraform + // This is a user-facing usage of OpenTofu but refers to a very old historical version of OpenTofu // which has no corresponding OpenTofu version, and is unlikely to get one. // If we ever get OpenTofu 0.6.16 and 0.7.x, we should update this message to mention OpenTofu instead. "The state is stored in a legacy binary format that is not supported since Terraform v0.7. To continue, first upgrade the state using Terraform 0.6.16 or earlier.", @@ -196,7 +196,7 @@ func sniffJSONStateVersion(src []byte) (uint64, tfdiags.Diagnostics) { return *sniff.Version, diags } -// sniffJSONStateTerraformVersion attempts to sniff the Terraform version +// sniffJSONStateTerraformVersion attempts to sniff the OpenTofu version // specification from the given state file source code. The result is either // a version string or an empty string if no version number could be extracted. // diff --git a/internal/states/statefile/version0.go b/internal/states/statefile/version0.go index 2cdd0d2887..165f1ecf12 100644 --- a/internal/states/statefile/version0.go +++ b/internal/states/statefile/version0.go @@ -6,7 +6,7 @@ package statefile // looksLikeVersion0 sniffs for the signature indicating a version 0 state // file. // -// Version 0 was the number retroactively assigned to Terraform's initial +// Version 0 was the number retroactively assigned to OpenTofu's initial // (unversioned) binary state file format, which was later superseded by the // version 1 format in JSON. // diff --git a/internal/states/statefile/version1.go b/internal/states/statefile/version1.go index 927bb61e28..c5c0988578 100644 --- a/internal/states/statefile/version1.go +++ b/internal/states/statefile/version1.go @@ -91,19 +91,19 @@ type moduleStateV1 struct { // existing to remain intact. For example: an module may depend // on a VPC ID given by an aws_vpc resource. // - // Terraform uses this information to build valid destruction + // OpenTofu uses this information to build valid destruction // orders and to warn the user if they're destroying a module that // another resource depends on. // // Things can be put into this list that may not be managed by - // Terraform. If Terraform doesn't find a matching ID in the + // OpenTofu. If OpenTofu doesn't find a matching ID in the // overall state, then it assumes it isn't managed and doesn't // worry about it. Dependencies []string `json:"depends_on,omitempty"` } type resourceStateV1 struct { - // This is filled in and managed by Terraform, and is the resource + // This is filled in and managed by OpenTofu, and is the resource // type itself such as "mycloud_instance". If a resource provider sets // this value, it won't be persisted. Type string `json:"type"` @@ -113,12 +113,12 @@ type resourceStateV1 struct { // depend on a subnet (which itself might depend on a VPC, and so // on). // - // Terraform uses this information to build valid destruction + // OpenTofu uses this information to build valid destruction // orders and to warn the user if they're destroying a resource that // another resource depends on. // // Things can be put into this list that may not be managed by - // Terraform. If Terraform doesn't find a matching ID in the + // OpenTofu. If OpenTofu doesn't find a matching ID in the // overall state, then it assumes it isn't managed and doesn't // worry about it. Dependencies []string `json:"depends_on,omitempty"` @@ -142,7 +142,7 @@ type resourceStateV1 struct { // Deposed instance is cleaned up. If there were problems creating the // replacement, the instance remains in the Deposed list so it can be // destroyed in a future run. Functionally, Deposed instances are very - // similar to Tainted instances in that Terraform is only tracking them in + // similar to Tainted instances in that OpenTofu is only tracking them in // order to remember to destroy them. Deposed []*instanceStateV1 `json:"deposed,omitempty"` @@ -154,17 +154,17 @@ type resourceStateV1 struct { } type instanceStateV1 struct { - // A unique ID for this resource. This is opaque to Terraform + // A unique ID for this resource. This is opaque to OpenTofu // and is only meant as a lookup mechanism for the providers. ID string `json:"id"` // Attributes are basic information about the resource. Any keys here - // are accessible in variable format within Terraform configurations: + // are accessible in variable format within OpenTofu configurations: // ${resourcetype.name.attribute}. Attributes map[string]string `json:"attributes,omitempty"` // Meta is a simple K/V map that is persisted to the State but otherwise - // ignored by Terraform core. It's meant to be used for accounting by + // ignored by OpenTofu core. It's meant to be used for accounting by // external client code. Meta map[string]string `json:"meta,omitempty"` } diff --git a/internal/states/statefile/version2.go b/internal/states/statefile/version2.go index 58ee17491c..1889a85449 100644 --- a/internal/states/statefile/version2.go +++ b/internal/states/statefile/version2.go @@ -49,7 +49,7 @@ type stateV2 struct { // Version is the state file protocol version. Version int `json:"version"` - // TFVersion is the version of Terraform that wrote this state. + // TFVersion is the version of OpenTofu that wrote this state. TFVersion string `json:"terraform_version,omitempty"` // Serial is incremented on any operation that modifies @@ -123,19 +123,19 @@ type moduleStateV2 struct { // existing to remain intact. For example: an module may depend // on a VPC ID given by an aws_vpc resource. // - // Terraform uses this information to build valid destruction + // OpenTofu uses this information to build valid destruction // orders and to warn the user if they're destroying a module that // another resource depends on. // // Things can be put into this list that may not be managed by - // Terraform. If Terraform doesn't find a matching ID in the + // OpenTofu. If OpenTofu doesn't find a matching ID in the // overall state, then it assumes it isn't managed and doesn't // worry about it. Dependencies []string `json:"depends_on"` } type resourceStateV2 struct { - // This is filled in and managed by Terraform, and is the resource + // This is filled in and managed by OpenTofu, and is the resource // type itself such as "mycloud_instance". If a resource provider sets // this value, it won't be persisted. Type string `json:"type"` @@ -145,12 +145,12 @@ type resourceStateV2 struct { // depend on a subnet (which itself might depend on a VPC, and so // on). // - // Terraform uses this information to build valid destruction + // OpenTofu uses this information to build valid destruction // orders and to warn the user if they're destroying a resource that // another resource depends on. // // Things can be put into this list that may not be managed by - // Terraform. If Terraform doesn't find a matching ID in the + // OpenTofu. If OpenTofu doesn't find a matching ID in the // overall state, then it assumes it isn't managed and doesn't // worry about it. Dependencies []string `json:"depends_on"` @@ -181,17 +181,17 @@ type resourceStateV2 struct { } type instanceStateV2 struct { - // A unique ID for this resource. This is opaque to Terraform + // A unique ID for this resource. This is opaque to OpenTofu // and is only meant as a lookup mechanism for the providers. ID string `json:"id"` // Attributes are basic information about the resource. Any keys here - // are accessible in variable format within Terraform configurations: + // are accessible in variable format within OpenTofu configurations: // ${resourcetype.name.attribute}. Attributes map[string]string `json:"attributes"` // Meta is a simple K/V map that is persisted to the State but otherwise - // ignored by Terraform core. It's meant to be used for accounting by + // ignored by OpenTofu core. It's meant to be used for accounting by // external client code. The value here must only contain Go primitives // and collections. Meta map[string]interface{} `json:"meta"` diff --git a/internal/states/statefile/version3_upgrade.go b/internal/states/statefile/version3_upgrade.go index 28940d22bf..c5b3680ad3 100644 --- a/internal/states/statefile/version3_upgrade.go +++ b/internal/states/statefile/version3_upgrade.go @@ -50,7 +50,7 @@ func upgradeStateV3ToV4(old *stateV3) (*stateV4, error) { } // Convert legacy-style module address into our newer address type. - // Since these old formats are only generated by versions of Terraform + // Since these old formats are only generated by versions of OpenTofu // that don't support count and for_each on modules, we can just assume // all of the modules are unkeyed. moduleAddr := make(addrs.ModuleInstance, len(msOld.Path)-1) diff --git a/internal/states/statefile/version4.go b/internal/states/statefile/version4.go index a7b619bc72..5fe704f75d 100644 --- a/internal/states/statefile/version4.go +++ b/internal/states/statefile/version4.go @@ -298,7 +298,7 @@ func prepareStateV4(sV4 *stateV4) (*File, tfdiags.Diagnostics) { // Saved check results from the previous run, if any. // We differentiate absense from an empty array here so that we can - // recognize if the previous run was with a version of Terraform that + // recognize if the previous run was with a version of OpenTofu that // didn't support checks yet, or if there just weren't any checkable // objects to record, in case that's important for certain messaging. if sV4.CheckResults != nil { @@ -618,7 +618,7 @@ func decodeCheckStatusV4(in string) checks.Status { return checks.StatusError default: // We'll treat anything else as unknown just as a concession to - // forward-compatible parsing, in case a later version of Terraform + // forward-compatible parsing, in case a later version of OpenTofu // introduces a new status. return checks.StatusUnknown } @@ -651,7 +651,7 @@ func decodeCheckableObjectKindV4(in string) addrs.CheckableKind { return addrs.CheckableInputVariable default: // We'll treat anything else as invalid just as a concession to - // forward-compatible parsing, in case a later version of Terraform + // forward-compatible parsing, in case a later version of OpenTofu // introduces a new status. return addrs.CheckableKindInvalid } diff --git a/internal/states/statefile/write.go b/internal/states/statefile/write.go index f83427e356..38d96bfe00 100644 --- a/internal/states/statefile/write.go +++ b/internal/states/statefile/write.go @@ -12,7 +12,7 @@ import ( // Write writes the given state to the given writer in the current state // serialization format. func Write(s *File, w io.Writer) error { - // Always record the current terraform version in the state. + // Always record the current tofu version in the state. s.TerraformVersion = tfversion.SemVer diags := writeStateV4(s, w) @@ -20,8 +20,8 @@ func Write(s *File, w io.Writer) error { } // WriteForTest writes the given state to the given writer in the current state -// serialization format without recording the current terraform version. This is -// intended for use in tests that need to override the current terraform +// serialization format without recording the current tofu version. This is +// intended for use in tests that need to override the current tofu // version. func WriteForTest(s *File, w io.Writer) error { diags := writeStateV4(s, w) diff --git a/internal/states/statemgr/doc.go b/internal/states/statemgr/doc.go index b134e4080b..a5b036844e 100644 --- a/internal/states/statemgr/doc.go +++ b/internal/states/statemgr/doc.go @@ -10,8 +10,8 @@ // parts of state for storage. // // State managers are responsible for ensuring that stored state can be updated -// safely across multiple, possibly-concurrent Terraform runs (with reasonable -// constraints and limitations). The rest of Terraform considers state to be +// safely across multiple, possibly-concurrent OpenTofu runs (with reasonable +// constraints and limitations). The rest of OpenTofu considers state to be // a mutable data structure, with state managers preserving that illusion // by creating snapshots of the state and updating them over time. // diff --git a/internal/states/statemgr/lineage.go b/internal/states/statemgr/lineage.go index 4dccabc762..e95e7f446f 100644 --- a/internal/states/statemgr/lineage.go +++ b/internal/states/statemgr/lineage.go @@ -6,13 +6,13 @@ package statemgr import ( "fmt" - uuid "github.com/hashicorp/go-uuid" + "github.com/hashicorp/go-uuid" ) // NewLineage generates a new lineage identifier string. A lineage identifier // is an opaque string that is intended to be unique in space and time, chosen // when state is recorded at a location for the first time and then preserved -// afterwards to allow Terraform to recognize when one state snapshot is a +// afterwards to allow OpenTofu to recognize when one state snapshot is a // predecessor or successor of another. func NewLineage() string { lineage, err := uuid.GenerateUUID() diff --git a/internal/states/statemgr/locker.go b/internal/states/statemgr/locker.go index 867dfc0711..11f9fe4467 100644 --- a/internal/states/statemgr/locker.go +++ b/internal/states/statemgr/locker.go @@ -28,10 +28,10 @@ var rngSource = rand.New(rand.NewSource(time.Now().UnixNano())) // Implementing Locker alongside Persistent relaxes some of the usual // implementation constraints for implementations of Refresher and Persister, // under the assumption that the locking mechanism effectively prevents -// multiple Terraform processes from reading and writing state concurrently. +// multiple OpenTofu processes from reading and writing state concurrently. // In particular, a type that implements both Locker and Persistent is only // required to that the Persistent implementation is concurrency-safe within -// a single Terraform process. +// a single OpenTofu process. // // A Locker implementation must ensure that another processes with a // similarly-configured state manager cannot successfully obtain a lock while @@ -121,7 +121,7 @@ type LockInfo struct { // returned by the call to Lock. ID string - // Terraform operation, provided by the caller. + // OpenTofu operation, provided by the caller. Operation string // Extra information to store with the lock, provided by the caller. @@ -130,7 +130,7 @@ type LockInfo struct { // user@hostname when available Who string - // Terraform version + // OpenTofu version Version string // Time that the lock was taken. @@ -145,7 +145,7 @@ type LockInfo struct { func NewLockInfo() *LockInfo { // this doesn't need to be cryptographically secure, just unique. // Using math/rand alleviates the need to check handle the read error. - // Use a uuid format to match other IDs used throughout Terraform. + // Use a uuid format to match other IDs used throughout OpenTofu. buf := make([]byte, 16) rngSource.Read(buf) diff --git a/internal/states/statemgr/persistent.go b/internal/states/statemgr/persistent.go index f2ffe8f736..536c8a8587 100644 --- a/internal/states/statemgr/persistent.go +++ b/internal/states/statemgr/persistent.go @@ -14,7 +14,7 @@ import ( // that deal with persistent snapshots. // // Persistent snapshots are ones that are retained in storage that will -// outlive a particular Terraform process, and are shared with other Terraform +// outlive a particular OpenTofu process, and are shared with other OpenTofu // processes that have a similarly-configured state manager. // // A manager may also choose to retain historical persistent snapshots, but @@ -118,7 +118,7 @@ type SnapshotMeta struct { Lineage string Serial uint64 - // TerraformVersion is the number of the version of Terraform that created + // TerraformVersion is the number of the version of OpenTofu that created // the snapshot. TerraformVersion *version.Version } diff --git a/internal/states/statemgr/testdata/lockstate.go b/internal/states/statemgr/testdata/lockstate.go index ff3c2479e0..87df956e47 100644 --- a/internal/states/statemgr/testdata/lockstate.go +++ b/internal/states/statemgr/testdata/lockstate.go @@ -8,7 +8,7 @@ import ( "github.com/opentofu/opentofu/internal/states/statemgr" ) -// Attempt to open and lock a terraform state file. +// Attempt to open and lock a tofu state file. // Lock failure exits with 0 and writes "lock failed" to stderr. func main() { if len(os.Args) != 2 { diff --git a/internal/states/statemgr/transient.go b/internal/states/statemgr/transient.go index 9e77430eb6..8cb0d545f0 100644 --- a/internal/states/statemgr/transient.go +++ b/internal/states/statemgr/transient.go @@ -10,7 +10,7 @@ import "github.com/opentofu/opentofu/internal/states" // // Transient snapshots are ones that are generally retained only locally and // to not create any historical version record when updated. Transient -// snapshots are not expected to outlive a particular Terraform process, +// snapshots are not expected to outlive a particular OpenTofu process, // and are not shared with any other process. // // A state manager type that is primarily concerned with persistent storage diff --git a/internal/states/sync.go b/internal/states/sync.go index 5784f437c9..f8f0703e0e 100644 --- a/internal/states/sync.go +++ b/internal/states/sync.go @@ -13,7 +13,7 @@ import ( ) // SyncState is a wrapper around State that provides concurrency-safe access to -// various common operations that occur during a Terraform graph walk, or other +// various common operations that occur during a OpenTofu graph walk, or other // similar concurrent contexts. // // When a SyncState wrapper is in use, no concurrent direct access to the diff --git a/internal/terminal/impl_windows.go b/internal/terminal/impl_windows.go index 0d381d6279..b68147e6df 100644 --- a/internal/terminal/impl_windows.go +++ b/internal/terminal/impl_windows.go @@ -66,7 +66,7 @@ func configureOutputHandle(f *os.File) (*OutputStream, error) { } else if isatty.IsCygwinTerminal(fd) { // Cygwin terminals -- and other VT100 "fakers" for older versions of // Windows -- are not really terminals in the usual sense, but rather - // are pipes between the child process (Terraform) and the terminal + // are pipes between the child process (OpenTofu) and the terminal // emulator. isatty.IsCygwinTerminal uses some heuristics to // distinguish those pipes from other pipes we might see if the user // were, for example, using the | operator on the command line. diff --git a/internal/terminal/streams.go b/internal/terminal/streams.go index af2bdc9703..9ef55f0dd4 100644 --- a/internal/terminal/streams.go +++ b/internal/terminal/streams.go @@ -3,9 +3,9 @@ // Package terminal encapsulates some platform-specific logic for detecting // if we're running in a terminal and, if so, properly configuring that -// terminal to meet the assumptions that the rest of Terraform makes. +// terminal to meet the assumptions that the rest of OpenTofu makes. // -// Specifically, Terraform requires a Terminal which supports virtual terminal +// Specifically, OpenTofu requires a Terminal which supports virtual terminal // sequences and which accepts UTF-8-encoded text. // // This is an abstraction only over the platform-specific detection of and @@ -32,7 +32,7 @@ import ( // terminal-requiring operatons. // // Note that it's possible for only a subset of the streams to be connected -// to a terminal. For example, this happens if the user runs Terraform with +// to a terminal. For example, this happens if the user runs OpenTofu with // I/O redirection where Stdout might refer to a regular disk file while Stderr // refers to a terminal, or various other similar combinations. type Streams struct { @@ -41,12 +41,12 @@ type Streams struct { Stdin *InputStream } -// Init tries to initialize a terminal, if Terraform is running in one, and +// Init tries to initialize a terminal, if OpenTofu is running in one, and // returns an object describing what it was able to set up. // // An error for this function indicates that the current execution context -// can't meet Terraform's assumptions. For example, on Windows Init will return -// an error if Terraform is running in a Windows Console that refuses to +// can't meet OpenTofu's assumptions. For example, on Windows Init will return +// an error if OpenTofu is running in a Windows Console that refuses to // activate UTF-8 mode, which can happen if we're running on an unsupported old // version of Windows. // diff --git a/internal/terminal/testing.go b/internal/terminal/testing.go index 11b907fd0b..c2a4f9eeb5 100644 --- a/internal/terminal/testing.go +++ b/internal/terminal/testing.go @@ -17,7 +17,7 @@ import ( // // This particular function is for the simple case of a function that only // produces output: the returned input stream is connected to the system's -// "null device", as if a user had run Terraform with I/O redirection like +// "null device", as if a user had run OpenTofu with I/O redirection like //