Rename multiple packages to OpenTofu (depsfile, genconfig, getmodules) (#499)

This commit is contained in:
Yaron Yarimi 2023-09-20 17:05:24 +03:00 committed by GitHub
parent 922f61d847
commit 90f7e5275f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 108 additions and 108 deletions

View File

@ -311,7 +311,7 @@ func TestParseModuleSource(t *testing.T) {
// just a general "this string doesn't match any of our source
// address patterns" situation, not _necessarily_ about relative
// local paths.
wantErr: `OpenTF cannot detect a supported external module source type for boop/bloop`,
wantErr: `OpenTofu cannot detect a supported external module source type for boop/bloop`,
},
"go-getter will accept all sorts of garbage": {

View File

@ -1,7 +1,7 @@
# __generated__ by OpenTF
# __generated__ by OpenTofu
# Please review these resources and move them into your main configuration files.
# __generated__ by OpenTF from "bar"
# __generated__ by OpenTofu from "bar"
resource "terraform_data" "foo" {
input = null
triggers_replace = null

View File

@ -1,7 +1,7 @@
# __generated__ by OpenTF
# __generated__ by OpenTofu
# Please review these resources and move them into your main configuration files.
# __generated__ by OpenTF from "bar"
# __generated__ by OpenTofu from "bar"
resource "terraform_data" "foo" {
input = null
triggers_replace = null

View File

@ -2038,7 +2038,7 @@ func TestInit_checkRequiredVersionFirst(t *testing.T) {
t.Fatalf("got exit status %d; want 1\nstderr:\n%s\n\nstdout:\n%s", code, ui.ErrorWriter.String(), ui.OutputWriter.String())
}
errStr := ui.ErrorWriter.String()
if !strings.Contains(errStr, `Unsupported OpenTF Core version`) {
if !strings.Contains(errStr, `Unsupported OpenTofu Core version`) {
t.Fatalf("output should point to unmet version constraint, but is:\n\n%s", errStr)
}
})
@ -2062,7 +2062,7 @@ func TestInit_checkRequiredVersionFirst(t *testing.T) {
t.Fatalf("got exit status %d; want 1\nstderr:\n%s\n\nstdout:\n%s", code, ui.ErrorWriter.String(), ui.OutputWriter.String())
}
errStr := ui.ErrorWriter.String()
if !strings.Contains(errStr, `Unsupported OpenTF Core version`) {
if !strings.Contains(errStr, `Unsupported OpenTofu Core version`) {
t.Fatalf("output should point to unmet version constraint, but is:\n\n%s", errStr)
}
})
@ -2108,7 +2108,7 @@ func TestInit_providerLockFile(t *testing.T) {
// The hash in here is for the fake package that newMockProviderSource produces
// (so it'll change if newMockProviderSource starts producing different contents)
wantLockFile := strings.TrimSpace(`
# This file is maintained automatically by "opentf init".
# This file is maintained automatically by "tofu init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/test" {
@ -2135,7 +2135,7 @@ func TestInit_providerLockFileReadonly(t *testing.T) {
// The hash in here is for the fake package that newMockProviderSource produces
// (so it'll change if newMockProviderSource starts producing different contents)
inputLockFile := strings.TrimSpace(`
# This file is maintained automatically by "opentf init".
# This file is maintained automatically by "tofu init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/test" {
@ -2148,7 +2148,7 @@ provider "registry.terraform.io/hashicorp/test" {
`)
badLockFile := strings.TrimSpace(`
# This file is maintained automatically by "opentf init".
# This file is maintained automatically by "tofu init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/test" {
@ -2161,7 +2161,7 @@ provider "registry.terraform.io/hashicorp/test" {
`)
updatedLockFile := strings.TrimSpace(`
# This file is maintained automatically by "opentf init".
# This file is maintained automatically by "tofu init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/test" {
@ -2175,7 +2175,7 @@ provider "registry.terraform.io/hashicorp/test" {
`)
emptyUpdatedLockFile := strings.TrimSpace(`
# This file is maintained automatically by "opentf init".
# This file is maintained automatically by "tofu init".
# Manual edits may be lost in future updates.
`)

View File

@ -41,7 +41,7 @@ func TestProvidersLock(t *testing.T) {
// This test depends on the -fs-mirror argument, so we always know what results to expect
t.Run("basic", func(t *testing.T) {
testDirectory := "providers-lock/basic"
expected := `# This file is maintained automatically by "opentf init".
expected := `# This file is maintained automatically by "tofu init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/test" {
@ -57,7 +57,7 @@ provider "registry.terraform.io/hashicorp/test" {
// This test depends on the -fs-mirror argument, so we always know what results to expect
t.Run("append", func(t *testing.T) {
testDirectory := "providers-lock/append"
expected := `# This file is maintained automatically by "opentf init".
expected := `# This file is maintained automatically by "tofu init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/test" {

View File

@ -1,7 +1,7 @@
# __generated__ by OpenTF
# __generated__ by OpenTofu
# Please review these resources and move them into your main configuration files.
# __generated__ by OpenTF from "bar"
# __generated__ by OpenTofu from "bar"
resource "test_instance" "foo" {
ami = null
}

View File

@ -76,14 +76,14 @@ func shimTraversalInString(expr hcl.Expression, wantKeyword bool) (hcl.Expressio
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagWarning,
Summary: "Quoted keywords are deprecated",
Detail: "In this context, keywords are expected literally rather than in quotes. OpenTF 0.11 and earlier required quotes, but quoted keywords are now deprecated and will be removed in a future version of OpenTF. Remove the quotes surrounding this keyword to silence this warning.",
Detail: "In this context, keywords are expected literally rather than in quotes. OpenTofu 0.11 and earlier required quotes, but quoted keywords are now deprecated and will be removed in a future version of OpenTofu. Remove the quotes surrounding this keyword to silence this warning.",
Subject: &srcRange,
})
} else {
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagWarning,
Summary: "Quoted references are deprecated",
Detail: "In this context, references are expected literally rather than in quotes. OpenTF 0.11 and earlier required quotes, but quoted references are now deprecated and will be removed in a future version of OpenTF. Remove the quotes surrounding this reference to silence this warning.",
Detail: "In this context, references are expected literally rather than in quotes. OpenTofu 0.11 and earlier required quotes, but quoted references are now deprecated and will be removed in a future version of OpenTofu. Remove the quotes surrounding this reference to silence this warning.",
Subject: &srcRange,
})
}

View File

@ -186,7 +186,7 @@ func loadModule(root *Config, req *ModuleRequest, walker ModuleWalker) (*Config,
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagWarning,
Summary: "Backend configuration ignored",
Detail: "Any selected backend applies to the entire configuration, so OpenTF expects provider configurations only in the root module.\n\nThis is a warning rather than an error because it's sometimes convenient to temporarily call a root module as a child module for testing purposes, but this backend configuration block will have no effect.",
Detail: "Any selected backend applies to the entire configuration, so OpenTofu expects provider configurations only in the root module.\n\nThis is a warning rather than an error because it's sometimes convenient to temporarily call a root module as a child module for testing purposes, but this backend configuration block will have no effect.",
Subject: mod.Backend.DeclRange.Ptr(),
})
}

View File

@ -65,7 +65,7 @@ func (l *Loader) moduleWalkerLoad(req *configs.ModuleRequest) (*configs.Module,
{
Severity: hcl.DiagError,
Summary: "Module not installed",
Detail: "This module is not yet installed. Run \"opentf init\" to install all modules required by this configuration.",
Detail: "This module is not yet installed. Run \"tofu init\" to install all modules required by this configuration.",
Subject: &req.CallRange,
},
}
@ -81,7 +81,7 @@ func (l *Loader) moduleWalkerLoad(req *configs.ModuleRequest) (*configs.Module,
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Module source has changed",
Detail: "The source address was changed since this module was installed. Run \"opentf init\" to install all modules required by this configuration.",
Detail: "The source address was changed since this module was installed. Run \"tofu init\" to install all modules required by this configuration.",
Subject: &req.SourceAddrRange,
})
}
@ -89,7 +89,7 @@ func (l *Loader) moduleWalkerLoad(req *configs.ModuleRequest) (*configs.Module,
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Module version requirements have changed",
Detail: "The version requirements have changed since this module was installed and the installed version is no longer acceptable. Run \"opentf init\" to install all modules required by this configuration.",
Detail: "The version requirements have changed since this module was installed and the installed version is no longer acceptable. Run \"tofu init\" to install all modules required by this configuration.",
Subject: &req.SourceAddrRange,
})
}
@ -98,7 +98,7 @@ func (l *Loader) moduleWalkerLoad(req *configs.ModuleRequest) (*configs.Module,
Severity: hcl.DiagError,
Summary: "Module version requirements have changed",
Detail: fmt.Sprintf(
"The version requirements have changed since this module was installed and the installed version (%s) is no longer acceptable. Run \"opentf init\" to install all modules required by this configuration.",
"The version requirements have changed since this module was installed and the installed version (%s) is no longer acceptable. Run \"tofu init\" to install all modules required by this configuration.",
record.Version,
),
Subject: &req.SourceAddrRange,
@ -116,7 +116,7 @@ func (l *Loader) moduleWalkerLoad(req *configs.ModuleRequest) (*configs.Module,
{
Severity: hcl.DiagError,
Summary: "Module not installed",
Detail: fmt.Sprintf("This module's local cache directory %s could not be read. Run \"opentf init\" to install all modules required by this configuration.", record.Dir),
Detail: fmt.Sprintf("This module's local cache directory %s could not be read. Run \"tofu init\" to install all modules required by this configuration.", record.Dir),
Subject: &req.CallRange,
},
}

View File

@ -59,7 +59,7 @@ func sniffActiveExperiments(body hcl.Body, allowed bool) (experiments.Set, hcl.D
Severity: hcl.DiagError,
Summary: "Invalid language edition",
Detail: fmt.Sprintf(
"The language argument expects a bare language edition keyword. OpenTF %s supports only language edition %s, which is the default.",
"The language argument expects a bare language edition keyword. OpenTofu %s supports only language edition %s, which is the default.",
currentVersion, firstEdition,
),
Subject: attr.Expr.Range().Ptr(),
@ -73,7 +73,7 @@ func sniffActiveExperiments(body hcl.Body, allowed bool) (experiments.Set, hcl.D
Severity: hcl.DiagError,
Summary: "Unsupported language edition",
Detail: fmt.Sprintf(
"OpenTF v%s only supports language edition %s. This module requires a %s version of OpenTF CLI.",
"OpenTofu v%s only supports language edition %s. This module requires a %s version of OpenTofu CLI.",
currentVersion, firstEdition, rel,
),
Subject: attr.Expr.Range().Ptr(),
@ -115,7 +115,7 @@ func sniffActiveExperiments(body hcl.Body, allowed bool) (experiments.Set, hcl.D
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Module uses experimental features",
Detail: "Experimental features are intended only for gathering early feedback on new language designs, and so are available only in alpha releases of OpenTF.",
Detail: "Experimental features are intended only for gathering early feedback on new language designs, and so are available only in alpha releases of OpenTofu.",
Subject: attr.NameRange.Ptr(),
})
}
@ -184,7 +184,7 @@ func decodeExperimentsAttr(attr *hcl.Attribute) (experiments.Set, hcl.Diagnostic
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagWarning,
Summary: fmt.Sprintf("Experimental feature %q is active", exp.Keyword()),
Detail: "Experimental features are available only in alpha releases of OpenTF and are subject to breaking changes or total removal in later versions, based on feedback. We recommend against using experimental features in production.\n\nIf you have feedback on the design of this feature, please open a GitHub issue to discuss it.",
Detail: "Experimental features are available only in alpha releases of OpenTofu and are subject to breaking changes or total removal in later versions, based on feedback. We recommend against using experimental features in production.\n\nIf you have feedback on the design of this feature, please open a GitHub issue to discuss it.",
Subject: expr.Range().Ptr(),
})
}

View File

@ -34,7 +34,7 @@ func TestExperimentsConfig(t *testing.T) {
want := &hcl.Diagnostic{
Severity: hcl.DiagWarning,
Summary: `Experimental feature "current" is active`,
Detail: "Experimental features are available only in alpha releases of OpenTF and are subject to breaking changes or total removal in later versions, based on feedback. We recommend against using experimental features in production.\n\nIf you have feedback on the design of this feature, please open a GitHub issue to discuss it.",
Detail: "Experimental features are available only in alpha releases of OpenTofu and are subject to breaking changes or total removal in later versions, based on feedback. We recommend against using experimental features in production.\n\nIf you have feedback on the design of this feature, please open a GitHub issue to discuss it.",
Subject: &hcl.Range{
Filename: "testdata/experiments/current/current_experiment.tf",
Start: hcl.Pos{Line: 2, Column: 18, Byte: 29},
@ -128,7 +128,7 @@ func TestExperimentsConfig(t *testing.T) {
want := &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: `Module uses experimental features`,
Detail: `Experimental features are intended only for gathering early feedback on new language designs, and so are available only in alpha releases of OpenTF.`,
Detail: `Experimental features are intended only for gathering early feedback on new language designs, and so are available only in alpha releases of OpenTofu.`,
Subject: &hcl.Range{
Filename: "testdata/experiments/current/current_experiment.tf",
Start: hcl.Pos{Line: 2, Column: 3, Byte: 14},

View File

@ -735,9 +735,9 @@ func (m *Module) CheckCoreVersionRequirements(path addrs.Module, sourceAddr addr
case len(path) == 0:
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Unsupported OpenTF Core version",
Summary: "Unsupported OpenTofu Core version",
Detail: fmt.Sprintf(
"This configuration does not support OpenTF version %s. To proceed, either choose another supported OpenTF version or update this version constraint. Version constraints are normally set for good reason, so updating the constraint may lead to other errors or unexpected behavior.",
"This configuration does not support OpenTofu version %s. To proceed, either choose another supported OpenTofu version or update this version constraint. Version constraints are normally set for good reason, so updating the constraint may lead to other errors or unexpected behavior.",
tfversion.String(),
),
Subject: constraint.DeclRange.Ptr(),
@ -745,9 +745,9 @@ func (m *Module) CheckCoreVersionRequirements(path addrs.Module, sourceAddr addr
default:
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Unsupported OpenTF Core version",
Summary: "Unsupported OpenTofu Core version",
Detail: fmt.Sprintf(
"Module %s (from %s) does not support OpenTF version %s. To proceed, either choose another supported OpenTF version or update this version constraint. Version constraints are normally set for good reason, so updating the constraint may lead to other errors or unexpected behavior.",
"Module %s (from %s) does not support OpenTofu version %s. To proceed, either choose another supported OpenTofu version or update this version constraint. Version constraints are normally set for good reason, so updating the constraint may lead to other errors or unexpected behavior.",
path, sourceAddr, tfversion.String(),
),
Subject: constraint.DeclRange.Ptr(),

View File

@ -105,7 +105,7 @@ func decodeModuleBlock(block *hcl.Block, override bool) (*ModuleCall, hcl.Diagno
Severity: hcl.DiagError,
Summary: "Invalid module source address",
Detail: fmt.Sprintf(
"OpenTF failed to determine your intended installation method for remote module package %q.\n\nIf you intended this as a path relative to the current module, use \"./%s\" instead. The \"./\" prefix indicates that the address is a relative filesystem path.",
"OpenTofu failed to determine your intended installation method for remote module package %q.\n\nIf you intended this as a path relative to the current module, use \"./%s\" instead. The \"./\" prefix indicates that the address is a relative filesystem path.",
err.Addr, err.Addr,
),
Subject: mc.SourceAddrRange.Ptr(),
@ -118,7 +118,7 @@ func decodeModuleBlock(block *hcl.Block, override bool) (*ModuleCall, hcl.Diagno
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Invalid registry module source address",
Detail: fmt.Sprintf("Failed to parse module registry address: %s.\n\nOpenTF assumed that you intended a module registry source address because you also set the argument \"version\", which applies only to registry modules.", err),
Detail: fmt.Sprintf("Failed to parse module registry address: %s.\n\nOpenTofu assumed that you intended a module registry source address because you also set the argument \"version\", which applies only to registry modules.", err),
Subject: mc.SourceAddrRange.Ptr(),
})
} else {
@ -191,7 +191,7 @@ func decodeModuleBlock(block *hcl.Block, override bool) (*ModuleCall, hcl.Diagno
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Reserved block type name in module block",
Detail: fmt.Sprintf("The block type name %q is reserved for use by OpenTF in a future version.", block.Type),
Detail: fmt.Sprintf("The block type name %q is reserved for use by OpenTofu in a future version.", block.Type),
Subject: &block.TypeRange,
})
}

View File

@ -211,7 +211,7 @@ func decodeVariableType(expr hcl.Expression) (cty.Type, *typeexpr.Defaults, Vari
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Invalid quoted type constraints",
Detail: "OpenTF 0.11 and earlier required type constraints to be given in quotes, but that form is now deprecated and will be removed in a future version of OpenTF. Remove the quotes around \"string\".",
Detail: "OpenTofu 0.11 and earlier required type constraints to be given in quotes, but that form is now deprecated and will be removed in a future version of OpenTofu. Remove the quotes around \"string\".",
Subject: expr.Range().Ptr(),
})
return cty.DynamicPseudoType, nil, VariableParseLiteral, diags
@ -219,7 +219,7 @@ func decodeVariableType(expr hcl.Expression) (cty.Type, *typeexpr.Defaults, Vari
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Invalid quoted type constraints",
Detail: "OpenTF 0.11 and earlier required type constraints to be given in quotes, but that form is now deprecated and will be removed in a future version of OpenTF. Remove the quotes around \"list\" and write list(string) instead to explicitly indicate that the list elements are strings.",
Detail: "OpenTofu 0.11 and earlier required type constraints to be given in quotes, but that form is now deprecated and will be removed in a future version of OpenTofu. Remove the quotes around \"list\" and write list(string) instead to explicitly indicate that the list elements are strings.",
Subject: expr.Range().Ptr(),
})
return cty.DynamicPseudoType, nil, VariableParseHCL, diags
@ -227,7 +227,7 @@ func decodeVariableType(expr hcl.Expression) (cty.Type, *typeexpr.Defaults, Vari
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Invalid quoted type constraints",
Detail: "OpenTF 0.11 and earlier required type constraints to be given in quotes, but that form is now deprecated and will be removed in a future version of OpenTF. Remove the quotes around \"map\" and write map(string) instead to explicitly indicate that the map elements are strings.",
Detail: "OpenTofu 0.11 and earlier required type constraints to be given in quotes, but that form is now deprecated and will be removed in a future version of OpenTofu. Remove the quotes around \"map\" and write map(string) instead to explicitly indicate that the map elements are strings.",
Subject: expr.Range().Ptr(),
})
return cty.DynamicPseudoType, nil, VariableParseHCL, diags

View File

@ -242,7 +242,7 @@ func (p *Parser) loadTestFiles(basePath string, paths []string) (map[string]*Tes
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagWarning,
Summary: "Failed to calculate relative path",
Detail: fmt.Sprintf("OpenTF could not calculate the relative path for test file %s and it has been skipped: %s", path, err),
Detail: fmt.Sprintf("OpenTofu could not calculate the relative path for test file %s and it has been skipped: %s", path, err),
})
continue
}

View File

@ -80,7 +80,7 @@ func decodeProviderBlock(block *hcl.Block) (*Provider, hcl.Diagnostics) {
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagWarning,
Summary: "Version constraints inside provider configuration blocks are deprecated",
Detail: "OpenTF 0.13 and earlier allowed provider version constraints inside the provider configuration block, but that is now deprecated and will be removed in a future version of OpenTF. To silence this warning, move the provider version constraint into the required_providers block.",
Detail: "OpenTofu 0.13 and earlier allowed provider version constraints inside the provider configuration block, but that is now deprecated and will be removed in a future version of OpenTofu. To silence this warning, move the provider version constraint into the required_providers block.",
Subject: attr.Expr.Range().Ptr(),
})
var versionDiags hcl.Diagnostics
@ -94,7 +94,7 @@ func decodeProviderBlock(block *hcl.Block) (*Provider, hcl.Diagnostics) {
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Reserved argument name in provider block",
Detail: fmt.Sprintf("The provider argument name %q is reserved for use by OpenTF in a future version.", name),
Detail: fmt.Sprintf("The provider argument name %q is reserved for use by OpenTofu in a future version.", name),
Subject: &attr.NameRange,
})
}
@ -129,7 +129,7 @@ func decodeProviderBlock(block *hcl.Block) (*Provider, hcl.Diagnostics) {
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Reserved block type name in provider block",
Detail: fmt.Sprintf("The block type name %q is reserved for use by OpenTF in a future version.", block.Type),
Detail: fmt.Sprintf("The block type name %q is reserved for use by OpenTofu in a future version.", block.Type),
Subject: &block.TypeRange,
})
}

View File

@ -24,14 +24,14 @@ func TestProviderReservedNames(t *testing.T) {
_, diags := parser.LoadConfigFile("config.tf")
assertExactDiagnostics(t, diags, []string{
//TODO: This deprecation warning will be removed in opentf v0.15.
`config.tf:4,13-20: Version constraints inside provider configuration blocks are deprecated; OpenTF 0.13 and earlier allowed provider version constraints inside the provider configuration block, but that is now deprecated and will be removed in a future version of OpenTF. To silence this warning, move the provider version constraint into the required_providers block.`,
`config.tf:10,3-8: Reserved argument name in provider block; The provider argument name "count" is reserved for use by OpenTF in a future version.`,
`config.tf:11,3-13: Reserved argument name in provider block; The provider argument name "depends_on" is reserved for use by OpenTF in a future version.`,
`config.tf:12,3-11: Reserved argument name in provider block; The provider argument name "for_each" is reserved for use by OpenTF in a future version.`,
`config.tf:14,3-12: Reserved block type name in provider block; The block type name "lifecycle" is reserved for use by OpenTF in a future version.`,
`config.tf:15,3-9: Reserved block type name in provider block; The block type name "locals" is reserved for use by OpenTF in a future version.`,
`config.tf:13,3-9: Reserved argument name in provider block; The provider argument name "source" is reserved for use by OpenTF in a future version.`,
//TODO: This deprecation warning will be removed in OpenTofu v0.15.
`config.tf:4,13-20: Version constraints inside provider configuration blocks are deprecated; OpenTofu 0.13 and earlier allowed provider version constraints inside the provider configuration block, but that is now deprecated and will be removed in a future version of OpenTofu. To silence this warning, move the provider version constraint into the required_providers block.`,
`config.tf:10,3-8: Reserved argument name in provider block; The provider argument name "count" is reserved for use by OpenTofu in a future version.`,
`config.tf:11,3-13: Reserved argument name in provider block; The provider argument name "depends_on" is reserved for use by OpenTofu in a future version.`,
`config.tf:12,3-11: Reserved argument name in provider block; The provider argument name "for_each" is reserved for use by OpenTofu in a future version.`,
`config.tf:14,3-12: Reserved block type name in provider block; The block type name "lifecycle" is reserved for use by OpenTofu in a future version.`,
`config.tf:15,3-9: Reserved block type name in provider block; The block type name "locals" is reserved for use by OpenTofu in a future version.`,
`config.tf:13,3-9: Reserved argument name in provider block; The provider argument name "source" is reserved for use by OpenTofu in a future version.`,
})
}

View File

@ -499,7 +499,7 @@ func validateProviderConfigs(parentCall *ModuleCall, cfg *Config, noProviderConf
Severity: hcl.DiagWarning,
Summary: "Reference to undefined provider",
Detail: fmt.Sprintf(
"There is no explicit declaration for local provider name %q in %s, so OpenTF is assuming you mean to pass a configuration for provider %q.\n\nTo clarify your intent and silence this warning, add to %s a required_providers entry named %q with source = %q, or a different source address if appropriate.",
"There is no explicit declaration for local provider name %q in %s, so OpenTofu is assuming you mean to pass a configuration for provider %q.\n\nTo clarify your intent and silence this warning, add to %s a required_providers entry named %q with source = %q, or a different source address if appropriate.",
name, moduleText, defAddr.ForDisplay(),
parentModuleText, name, defAddr.ForDisplay(),
),
@ -624,7 +624,7 @@ func validateProviderConfigs(parentCall *ModuleCall, cfg *Config, noProviderConf
Severity: hcl.DiagWarning,
Summary: "Reference to undefined provider",
Detail: fmt.Sprintf(
"There is no explicit declaration for local provider name %q in %s, so OpenTF is assuming you mean to pass a configuration for %q.\n\nIf you also control the child module, add a required_providers entry named %q with the source address %q.",
"There is no explicit declaration for local provider name %q in %s, so OpenTofu is assuming you mean to pass a configuration for %q.\n\nIf you also control the child module, add a required_providers entry named %q with the source address %q.",
name, moduleText, providerAddr.Provider.ForDisplay(),
name, providerAddr.Provider.ForDisplay(),
),
@ -756,7 +756,7 @@ func validateProviderConfigs(parentCall *ModuleCall, cfg *Config, noProviderConf
fmt.Fprintf(
&buf,
"Earlier versions of OpenTF used empty provider blocks (\"proxy provider configurations\") for child modules to declare their need to be passed a provider configuration by their callers. That approach was ambiguous and is now deprecated.\n\nIf you control this module, you can migrate to the new declaration syntax by removing all of the empty provider %q blocks and then adding or updating an entry like the following to the required_providers block of %s:\n",
"Earlier versions of OpenTofu used empty provider blocks (\"proxy provider configurations\") for child modules to declare their need to be passed a provider configuration by their callers. That approach was ambiguous and is now deprecated.\n\nIf you control this module, you can migrate to the new declaration syntax by removing all of the empty provider %q blocks and then adding or updating an entry like the following to the required_providers block of %s:\n",
name, moduleText,
)
fmt.Fprintf(&buf, " %s = {\n", name)

View File

@ -39,7 +39,7 @@ func decodeProvisionerBlock(block *hcl.Block) (*Provisioner, hcl.Diagnostics) {
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: fmt.Sprintf("The \"%s\" provisioner has been removed", pv.Type),
Detail: fmt.Sprintf("The \"%s\" provisioner was deprecated in OpenTF 0.13.4 has been removed from OpenTF. Visit https://learn.hashicorp.com/collections/terraform/provision for alternatives to using provisioners that are a better fit for the OpenTF workflow.", pv.Type),
Detail: fmt.Sprintf("The \"%s\" provisioner was deprecated in OpenTofu 0.13.4 has been removed from OpenTofu. Visit https://learn.hashicorp.com/collections/terraform/provision for alternatives to using provisioners that are a better fit for the OpenTofu workflow.", pv.Type),
Subject: &pv.TypeRange,
})
return nil, diags
@ -140,7 +140,7 @@ func decodeProvisionerBlock(block *hcl.Block) (*Provisioner, hcl.Diagnostics) {
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Reserved block type name in provisioner block",
Detail: fmt.Sprintf("The block type name %q is reserved for use by OpenTF in a future version.", block.Type),
Detail: fmt.Sprintf("The block type name %q is reserved for use by OpenTofu in a future version.", block.Type),
Subject: &block.TypeRange,
})
}

View File

@ -339,7 +339,7 @@ func decodeResourceBlock(block *hcl.Block, override bool) (*Resource, hcl.Diagno
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Reserved block type name in resource block",
Detail: fmt.Sprintf("The block type name %q is reserved for use by OpenTF in a future version.", block.Type),
Detail: fmt.Sprintf("The block type name %q is reserved for use by OpenTofu in a future version.", block.Type),
Subject: &block.TypeRange,
})
}
@ -526,7 +526,7 @@ func decodeDataBlock(block *hcl.Block, override, nested bool) (*Resource, hcl.Di
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Reserved block type name in data block",
Detail: fmt.Sprintf("The block type name %q is reserved for use by OpenTF in a future version.", block.Type),
Detail: fmt.Sprintf("The block type name %q is reserved for use by OpenTofu in a future version.", block.Type),
Subject: block.TypeRange.Ptr(),
})
}

View File

@ -408,7 +408,7 @@ func decodeTestRunModuleBlock(block *hcl.Block) (*TestRunModuleCall, hcl.Diagnos
Severity: hcl.DiagError,
Summary: "Invalid module source address",
Detail: fmt.Sprintf(
"OpenTF failed to determine your intended installation method for remote module package %q.\n\nIf you intended this as a path relative to the current module, use \"./%s\" instead. The \"./\" prefix indicates that the address is a relative filesystem path.",
"OpenTofu failed to determine your intended installation method for remote module package %q.\n\nIf you intended this as a path relative to the current module, use \"./%s\" instead. The \"./\" prefix indicates that the address is a relative filesystem path.",
err.Addr, err.Addr,
),
Subject: module.SourceDeclRange.Ptr(),
@ -421,7 +421,7 @@ func decodeTestRunModuleBlock(block *hcl.Block) (*TestRunModuleCall, hcl.Diagnos
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Invalid registry module source address",
Detail: fmt.Sprintf("Failed to parse module registry address: %s.\n\nOpenTF assumed that you intended a module registry source address because you also set the argument \"version\", which applies only to registry modules.", err),
Detail: fmt.Sprintf("Failed to parse module registry address: %s.\n\nOpenTofu assumed that you intended a module registry source address because you also set the argument \"version\", which applies only to registry modules.", err),
Subject: module.SourceDeclRange.Ptr(),
})
} else {

View File

@ -1,4 +1,4 @@
empty-configs/mod/main.tf:10,1-15: Redundant empty provider block; Earlier versions of OpenTF used empty provider blocks ("proxy provider configurations") for child modules to declare their need to be passed a provider configuration by their callers. That approach was ambiguous and is now deprecated.
empty-configs/mod/main.tf:10,1-15: Redundant empty provider block; Earlier versions of OpenTofu used empty provider blocks ("proxy provider configurations") for child modules to declare their need to be passed a provider configuration by their callers. That approach was ambiguous and is now deprecated.
If you control this module, you can migrate to the new declaration syntax by removing all of the empty provider "foo" blocks and then adding or updating an entry like the following to the required_providers block of module.mod:
empty-configs/mod/main.tf:17,1-15: Redundant empty provider block; Earlier versions of OpenTF used empty provider blocks ("proxy provider configurations") for child modules to declare their need to be passed a provider configuration by their callers. That approach was ambiguous and is now deprecated.
empty-configs/mod/main.tf:17,1-15: Redundant empty provider block; Earlier versions of OpenTofu used empty provider blocks ("proxy provider configurations") for child modules to declare their need to be passed a provider configuration by their callers. That approach was ambiguous and is now deprecated.
If you control this module, you can migrate to the new declaration syntax by removing all of the empty provider "baz" blocks and then adding or updating an entry like the following to the required_providers block of module.mod:

View File

@ -1 +1 @@
incorrect-type/main.tf:16,5-8: Reference to undefined provider; There is no explicit declaration for local provider name "baz" in module.mod, so OpenTF is assuming you mean to pass a configuration for "hashicorp/baz".
incorrect-type/main.tf:16,5-8: Reference to undefined provider; There is no explicit declaration for local provider name "baz" in module.mod, so OpenTofu is assuming you mean to pass a configuration for "hashicorp/baz".

View File

@ -1 +1 @@
unexpected-provider/main.tf:13,5-8: Reference to undefined provider; There is no explicit declaration for local provider name "foo" in module.mod, so OpenTF is assuming you mean to pass a configuration for "hashicorp/foo".
unexpected-provider/main.tf:13,5-8: Reference to undefined provider; There is no explicit declaration for local provider name "foo" in module.mod, so OpenTofu is assuming you mean to pass a configuration for "hashicorp/foo".

View File

@ -1 +1 @@
unknown-root-provider/main.tf:5,11-14: Reference to undefined provider; There is no explicit declaration for local provider name "bar" in the root module, so OpenTF is assuming you mean to pass a configuration for provider "hashicorp/bar".
unknown-root-provider/main.tf:5,11-14: Reference to undefined provider; There is no explicit declaration for local provider name "bar" in the root module, so OpenTofu is assuming you mean to pass a configuration for provider "hashicorp/bar".

View File

@ -1,7 +1,7 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Package depsfile contains the logic for reading and writing OpenTF's
// 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)
@ -9,12 +9,12 @@
// where .tf files configure a particular module while these configure
// a whole configuration tree. Another, more practical consideration is that
// we intend both of these files to be primarily maintained automatically by
// OpenTF itself, rather than by human-originated edits, and so keeping
// them separate means that it's easier to distinguish the files that OpenTF
// OpenTofu itself, rather than by human-originated edits, and so keeping
// them separate means that it's easier to distinguish the files that OpenTofu
// will change automatically during normal workflow from the files that
// OpenTF only edits on direct request.
// OpenTofu only edits on direct request.
//
// Both files use HCL syntax, for consistency with other files in OpenTF
// Both files use HCL syntax, for consistency with other files in OpenTofu
// that we expect humans to (in this case, only occasionally) edit directly.
// A dependency lock file tracks the most recently selected upstream versions
// of each dependency, and is intended for checkin to version control.

View File

@ -23,13 +23,13 @@ type Locks struct {
// overriddenProviders is a subset of providers which we might be tracking
// in field providers but whose lock information we're disregarding for
// this particular run due to some feature that forces OpenTF to not
// this particular run due to some feature that forces OpenTofu to not
// use a normally-installed plugin for it. For example, the "provider dev
// overrides" feature means that we'll be using an arbitrary directory on
// disk as the package, regardless of what might be selected in "providers".
//
// overriddenProviders is an in-memory-only annotation, never stored as
// part of a lock file and thus not persistent between OpenTF runs.
// part of a lock file and thus not persistent between OpenTofu runs.
// The CLI layer is generally the one responsible for populating this,
// by calling SetProviderOverridden in response to CLI Configuration
// settings, environment variables, or whatever similar sources.
@ -118,7 +118,7 @@ func (l *Locks) RemoveProvider(addr addrs.Provider) {
delete(l.providers, addr)
}
// SetProviderOverridden records that this particular OpenTF process will
// SetProviderOverridden records that this particular OpenTofu process will
// not pay attention to the recorded lock entry for the given provider, and
// will instead access that provider's functionality in some other special
// way that isn't sensitive to provider version selections or checksums.
@ -333,7 +333,7 @@ type ProviderLock struct {
// version is the specific version that was previously selected, while
// versionConstraints is the constraint that was used to make that
// selection, which we can potentially use to hint to run
// e.g. opentf init -upgrade if a user has changed a version
// e.g. tofu init -upgrade if a user has changed a version
// constraint but the previous selection still remains valid.
// "version" is therefore authoritative, while "versionConstraints" is
// just for a UI hint and not used to make any real decisions.
@ -384,9 +384,9 @@ func (l *ProviderLock) Version() getproviders.Version {
// being used to choose the version returned by Version.
//
// These version constraints are not authoritative for future selections and
// are included only so OpenTF can detect if the constraints in
// are included only so OpenTofu can detect if the constraints in
// configuration have changed since a selection was made, and thus hint to the
// user that they may need to run opentf init -upgrade to apply the new
// user that they may need to run tofu init -upgrade to apply the new
// constraints.
func (l *ProviderLock) VersionConstraints() getproviders.VersionConstraints {
return l.versionConstraints
@ -398,7 +398,7 @@ func (l *ProviderLock) VersionConstraints() getproviders.VersionConstraints {
//
// If your intent is to verify a package against the recorded hashes, use
// PreferredHashes to get only the hashes which the current version
// of OpenTF considers the strongest of the available hashing schemes, one
// of OpenTofu considers the strongest of the available hashing schemes, one
// of which must match in order for verification to be considered successful.
//
// Do not modify the backing array of the returned slice.

View File

@ -51,7 +51,7 @@ func LoadLocksFromFile(filename string) (*Locks, tfdiags.Diagnostics) {
// a plan file, in which case the given filename will typically be a
// placeholder that will only be seen in the unusual case that the plan file
// contains an invalid lock file, which should only be possible if the user
// edited it directly (OpenTF bugs notwithstanding).
// edited it directly (OpenTofu bugs notwithstanding).
func LoadLocksFromBytes(src []byte, filename string) (*Locks, tfdiags.Diagnostics) {
return loadLocks(func(parser *hclparse.Parser) (*hcl.File, hcl.Diagnostics) {
return parser.ParseHCL(src, filename)
@ -115,7 +115,7 @@ func SaveLocksToBytes(locks *Locks) ([]byte, tfdiags.Diagnostics) {
// In other uses of the "hclwrite" package we typically try to make
// surgical updates to the author's existing files, preserving their
// block ordering, comments, etc. We intentionally don't do that here
// to reinforce the fact that this file primarily belongs to OpenTF,
// to reinforce the fact that this file primarily belongs to OpenTofu,
// and to help ensure that VCS diffs of the file primarily reflect
// changes that actually affect functionality rather than just cosmetic
// changes, by maintaining it in a highly-normalized form.
@ -125,12 +125,12 @@ func SaveLocksToBytes(locks *Locks) ([]byte, tfdiags.Diagnostics) {
// End-users _may_ edit the lock file in exceptional situations, like
// working around potential dependency selection bugs, but we intend it
// to be primarily maintained automatically by the "opentf init"
// to be primarily maintained automatically by the "tofu init"
// command.
rootBody.AppendUnstructuredTokens(hclwrite.Tokens{
{
Type: hclsyntax.TokenComment,
Bytes: []byte("# This file is maintained automatically by \"opentf init\".\n"),
Bytes: []byte("# This file is maintained automatically by \"tofu init\".\n"),
},
{
Type: hclsyntax.TokenComment,
@ -177,7 +177,7 @@ func decodeLocksFromHCL(locks *Locks, body hcl.Body) tfdiags.Diagnostics {
// "module" is just a placeholder for future enhancement, so we
// can mostly-ignore the this block type we intend to add in
// future, but warn in case someone tries to use one e.g. if they
// downgraded to an earlier version of OpenTF.
// downgraded to an earlier version of OpenTofu.
{
Type: "module",
LabelNames: []string{"path"},
@ -218,7 +218,7 @@ func decodeLocksFromHCL(locks *Locks, body hcl.Body) tfdiags.Diagnostics {
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagWarning,
Summary: "Dependency locks for modules are not yet supported",
Detail: fmt.Sprintf("OpenTF v%s only supports dependency locks for providers, not for modules. This configuration may be intended for a later version of OpenTF that also supports dependency locks for modules.", currentVersion),
Detail: fmt.Sprintf("OpenTofu v%s only supports dependency locks for providers, not for modules. This configuration may be intended for a later version of OpenTofu that also supports dependency locks for modules.", currentVersion),
Subject: block.TypeRange.Ptr(),
})
seenModule = true
@ -262,7 +262,7 @@ func decodeProviderLockFromHCL(block *hcl.Block) (*ProviderLock, tfdiags.Diagnos
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Invalid provider source address",
Detail: fmt.Sprintf("Cannot lock a version for built-in provider %s. Built-in providers are bundled inside OpenTF itself, so you can't select a version for them independently of the OpenTF release you are currently running.", addr),
Detail: fmt.Sprintf("Cannot lock a version for built-in provider %s. Built-in providers are bundled inside OpenTofu itself, so you can't select a version for them independently of the OpenTofu release you are currently running.", addr),
Subject: block.LabelRanges[0].Ptr(),
})
return nil, diags

View File

@ -163,7 +163,7 @@ func TestLoadLocksFromFile(t *testing.T) {
func TestLoadLocksFromFileAbsent(t *testing.T) {
t.Run("lock file is a directory", func(t *testing.T) {
// This can never happen when OpenTF is the one generating the
// This can never happen when OpenTofu is the one generating the
// lock file, but might arise if the user makes a directory with the
// lock file's name for some reason. (There is no actual reason to do
// so, so that would always be a mistake.)
@ -243,7 +243,7 @@ func TestSaveLocksToFile(t *testing.T) {
t.Fatalf(err.Error())
}
gotContent := string(gotContentBytes)
wantContent := `# This file is maintained automatically by "opentf init".
wantContent := `# This file is maintained automatically by "tofu init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/test/bar" {

View File

@ -4,17 +4,17 @@
package depsfile
// LockFilePath is the path, relative to a configuration's root module
// directory, where OpenTF expects to find the dependency lock file for
// directory, where OpenTofu expects to find the dependency lock file for
// that configuration.
//
// This file is intended to be kept in version control, so it lives directly
// in the root module directory. The ".terraform" prefix is intended to
// suggest that it's metadata about several types of objects that ultimately
// end up in the .terraform directory after running "opentf init".
// end up in the .terraform directory after running "tofu init".
const LockFilePath = ".terraform.lock.hcl"
// DevOverrideFilePath is the path, relative to a configuration's root module
// directory, where OpenTF will look to find a possible override file that
// directory, where OpenTofu will look to find a possible override file that
// represents a request to temporarily (within a single working directory only)
// use specific local directories in place of packages that would normally
// need to be installed from a remote location.

View File

@ -39,6 +39,6 @@ provider "registry.terraform.io/-/null" { # ERROR: Invalid provider source addre
}
# Built-in providers are not allowed, because they are not versioned
# independently of the OpenTF CLI release they are embedded in.
# independently of the OpenTofu CLI release they are embedded in.
provider "terraform.io/builtin/foo" { # ERROR: Invalid provider source address
}

View File

@ -17,8 +17,8 @@ import (
// GenerateResourceContents generates HCL configuration code for the provided
// resource and state value.
//
// If you want to generate actual valid OpenTF code you should follow this
// call up with a call to WrapResourceContents, which will place an OpenTF
// If you want to generate actual valid OpenTofu code you should follow this
// call up with a call to WrapResourceContents, which will place an OpenTofu
// resource header around the attributes and blocks returned by this function.
func GenerateResourceContents(addr addrs.AbsResourceInstance,
schema *configschema.Block,

View File

@ -18,7 +18,7 @@ func ValidateTargetFile(out string) (diags tfdiags.Diagnostics) {
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Target generated file already exists",
"OpenTF can only write generated config into a new file. Either choose a different target location or move all existing configuration out of the target file, delete it and try again."))
"OpenTofu can only write generated config into a new file. Either choose a different target location or move all existing configuration out of the target file, delete it and try again."))
}
return diags
@ -42,26 +42,26 @@ func (c *Change) MaybeWriteConfig(writer io.Writer, out string) (io.Writer, bool
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Failed to create target generated file",
fmt.Sprintf("OpenTF did not have permission to create the generated file (%s) in the target directory. Please modify permissions over the target directory, and try again.", out)))
fmt.Sprintf("OpenTofu did not have permission to create the generated file (%s) in the target directory. Please modify permissions over the target directory, and try again.", out)))
return nil, false, diags
}
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Failed to create target generated file",
fmt.Sprintf("OpenTF could not create the generated file (%s) in the target directory: %v. Depending on the error message, this may be a bug in OpenTF itself. If so, please report it!", out, err)))
fmt.Sprintf("OpenTofu could not create the generated file (%s) in the target directory: %v. Depending on the error message, this may be a bug in OpenTF itself. If so, please report it!", out, err)))
return nil, false, diags
} else {
writer = w
}
header := "# __generated__ by OpenTF\n# Please review these resources and move them into your main configuration files.\n"
header := "# __generated__ by OpenTofu\n# Please review these resources and move them into your main configuration files.\n"
// Missing the header from the file, isn't the end of the world
// so if this did return an error, then we will just ignore it.
_, _ = writer.Write([]byte(header))
}
header := "\n# __generated__ by OpenTF"
header := "\n# __generated__ by OpenTofu"
if len(c.ImportID) > 0 {
header += fmt.Sprintf(" from %q", c.ImportID)
}
@ -70,7 +70,7 @@ func (c *Change) MaybeWriteConfig(writer io.Writer, out string) (io.Writer, bool
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Warning,
"Failed to save generated config",
fmt.Sprintf("OpenTF encountered an error while writing generated config: %v. The config for %s must be created manually before applying. Depending on the error message, this may be a bug in OpenTF itself. If so, please report it!", err, c.Addr)))
fmt.Sprintf("OpenTofu encountered an error while writing generated config: %v. The config for %s must be created manually before applying. Depending on the error message, this may be a bug in OpenTF itself. If so, please report it!", err, c.Addr)))
}
wroteConfig = true
}

View File

@ -10,7 +10,7 @@ import (
)
// fileDetector is a replacement for go-getter's own file detector which
// better meets OpenTF's needs: specifically, it rejects relative filesystem
// better meets OpenTofu's needs: specifically, it rejects relative filesystem
// paths with a somewhat-decent error message.
//
// This is a replacement for some historical hackery we did where we tried to
@ -64,5 +64,5 @@ type MaybeRelativePathErr struct {
}
func (e *MaybeRelativePathErr) Error() string {
return fmt.Sprintf("OpenTF cannot detect a supported external module source type for %s", e.Addr)
return fmt.Sprintf("OpenTofu cannot detect a supported external module source type for %s", e.Addr)
}

View File

@ -22,7 +22,7 @@ import (
// executable.
//
// Note that over time we've found go-getter's design to be not wholly fit
// for OpenTF's purposes in various ways, and so we're continuing to use
// for OpenTofu's purposes in various ways, and so we're continuing to use
// it here because our backward compatibility with earlier versions depends
// on it, but we use go-getter very carefully and always only indirectly via
// the public API of this package so that we can get the subset of the

View File

@ -32,7 +32,7 @@ import (
//
// Some of go-getter's detectors make outgoing HTTP requests, and so
// the behavior of this function may depend on the network connectivity
// of the system where OpenTF is running. However, most of the getters
// of the system where OpenTofu is running. However, most of the getters
// we use are local-only, and so HTTP requests are only for some ambiguous
// edge-cases, such as the BitBucket detector which has a mechanism to
// detect whether to use Git or Mercurial, because earlier versions of
@ -48,7 +48,7 @@ func NormalizePackageAddress(given string) (packageAddr, subDir string, err erro
// NOTE: We're passing an empty string to the "current working directory"
// here because that's only relevant for relative filesystem paths,
// but OpenTF handles relative filesystem paths itself outside of
// but OpenTofu handles relative filesystem paths itself outside of
// go-getter and so it'd always be an error to pass one into here.
// go-getter's "file" detector returns an error if it encounters a
// relative path when the pwd argument is empty.

View File

@ -27,11 +27,11 @@ func SplitPackageSubdir(given string) (packageAddr, subDir string) {
// versions just used go-getter directly and so we need to preserve
// its various quirks for compatibility reasons.
//
// However, note that in OpenTF we _always_ split off the subdirectory
// portion and handle it within OpenTF-level code, _never_ passing
// However, note that in OpenTofu we _always_ split off the subdirectory
// portion and handle it within OpenTofu-level code, _never_ passing
// a subdirectory portion down into go-getter's own Get function, because
// OpenTF's ability to refer between local paths inside the same
// package depends on OpenTF itself always being aware of where the
// OpenTofu's ability to refer between local paths inside the same
// package depends on OpenTofu itself always being aware of where the
// package's root directory ended up on disk, and always needs the
// package installed wholesale.
packageAddr, subDir = getter.SourceDirSubdir(given)