From 60770c81a2643ae3f6d5f7fcb3579e090503d770 Mon Sep 17 00:00:00 2001 From: Elbaz Date: Tue, 22 Aug 2023 15:33:08 +0300 Subject: [PATCH 1/3] update namings --- internal/configs/compat_shim.go | 4 ++-- internal/configs/config_build.go | 2 +- internal/configs/experiments_test.go | 4 ++-- internal/configs/module_call.go | 4 ++-- internal/configs/named_values.go | 2 +- internal/configs/parser_config_dir.go | 2 +- internal/configs/provider.go | 6 +++--- internal/configs/provider_test.go | 14 +++++++------- internal/configs/provisioner.go | 4 ++-- internal/configs/resource.go | 2 +- internal/configs/test_file.go | 4 ++-- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/internal/configs/compat_shim.go b/internal/configs/compat_shim.go index bf542650b7..9cc054720c 100644 --- a/internal/configs/compat_shim.go +++ b/internal/configs/compat_shim.go @@ -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. Terraform 0.11 and earlier required quotes, but quoted keywords are now deprecated and will be removed in a future version of Terraform. Remove the quotes surrounding this keyword to silence this warning.", + 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.", 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. Terraform 0.11 and earlier required quotes, but quoted references are now deprecated and will be removed in a future version of Terraform. Remove the quotes surrounding this reference to silence this warning.", + 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.", Subject: &srcRange, }) } diff --git a/internal/configs/config_build.go b/internal/configs/config_build.go index b7a98bb39d..a1e5b86985 100644 --- a/internal/configs/config_build.go +++ b/internal/configs/config_build.go @@ -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 Terraform 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 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.", Subject: mod.Backend.DeclRange.Ptr(), }) } diff --git a/internal/configs/experiments_test.go b/internal/configs/experiments_test.go index 4696fc2a74..31ad62e8cc 100644 --- a/internal/configs/experiments_test.go +++ b/internal/configs/experiments_test.go @@ -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 Terraform 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 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.", 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 Terraform.`, + Detail: `Experimental features are intended only for gathering early feedback on new language designs, and so are available only in alpha releases of OpenTF.`, Subject: &hcl.Range{ Filename: "testdata/experiments/current/current_experiment.tf", Start: hcl.Pos{Line: 2, Column: 3, Byte: 14}, diff --git a/internal/configs/module_call.go b/internal/configs/module_call.go index 761c8280e0..e424f35081 100644 --- a/internal/configs/module_call.go +++ b/internal/configs/module_call.go @@ -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( - "Terraform 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.", + "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.", 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\nTerraform 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\nOpenTF 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 { diff --git a/internal/configs/named_values.go b/internal/configs/named_values.go index 1f288284f0..95ee33506f 100644 --- a/internal/configs/named_values.go +++ b/internal/configs/named_values.go @@ -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: "Terraform 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 Terraform. Remove the quotes around \"string\".", + 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 Terraform. Remove the quotes around \"string\".", Subject: expr.Range().Ptr(), }) return cty.DynamicPseudoType, nil, VariableParseLiteral, diags diff --git a/internal/configs/parser_config_dir.go b/internal/configs/parser_config_dir.go index adac0ebcec..c9a6e776b2 100644 --- a/internal/configs/parser_config_dir.go +++ b/internal/configs/parser_config_dir.go @@ -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("Terraform could not calculate the relative path for test file %s and it has been skipped: %s", path, err), + Detail: fmt.Sprintf("OpenTF could not calculate the relative path for test file %s and it has been skipped: %s", path, err), }) continue } diff --git a/internal/configs/provider.go b/internal/configs/provider.go index c8b28d49f5..500094dcb5 100644 --- a/internal/configs/provider.go +++ b/internal/configs/provider.go @@ -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: "Terraform 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 Terraform. To silence this warning, move the provider version constraint into the required_providers block.", + 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 Terraform. 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 Terraform in a future version.", name), + Detail: fmt.Sprintf("The provider argument name %q is reserved for use by OpenTF 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 Terraform in a future version.", block.Type), + Detail: fmt.Sprintf("The block type name %q is reserved for use by OpenTF in a future version.", block.Type), Subject: &block.TypeRange, }) } diff --git a/internal/configs/provider_test.go b/internal/configs/provider_test.go index 1ee257af44..7062d06563 100644 --- a/internal/configs/provider_test.go +++ b/internal/configs/provider_test.go @@ -25,13 +25,13 @@ func TestProviderReservedNames(t *testing.T) { assertExactDiagnostics(t, diags, []string{ //TODO: This deprecation warning will be removed in terraform v0.15. - `config.tf:4,13-20: Version constraints inside provider configuration blocks are deprecated; Terraform 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 Terraform. 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 Terraform 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 Terraform 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 Terraform 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 Terraform 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 Terraform 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 Terraform in a future version.`, + `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 Terraform. 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.`, }) } diff --git a/internal/configs/provisioner.go b/internal/configs/provisioner.go index 9b0413b548..1df1e828f5 100644 --- a/internal/configs/provisioner.go +++ b/internal/configs/provisioner.go @@ -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 Terraform 0.13.4 has been removed from Terraform. Visit https://learn.hashicorp.com/collections/terraform/provision for alternatives to using provisioners that are a better fit for the Terraform workflow.", 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), 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 Terraform in a future version.", block.Type), + Detail: fmt.Sprintf("The block type name %q is reserved for use by OpenTF in a future version.", block.Type), Subject: &block.TypeRange, }) } diff --git a/internal/configs/resource.go b/internal/configs/resource.go index cc3bc05d19..64205df666 100644 --- a/internal/configs/resource.go +++ b/internal/configs/resource.go @@ -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 Terraform in a future version.", block.Type), + Detail: fmt.Sprintf("The block type name %q is reserved for use by OpenTF in a future version.", block.Type), Subject: &block.TypeRange, }) } diff --git a/internal/configs/test_file.go b/internal/configs/test_file.go index 28e0d7cbb5..4892bf2a7f 100644 --- a/internal/configs/test_file.go +++ b/internal/configs/test_file.go @@ -408,7 +408,7 @@ func decodeTestRunModuleBlock(block *hcl.Block) (*TestRunModuleCall, hcl.Diagnos Severity: hcl.DiagError, Summary: "Invalid module source address", Detail: fmt.Sprintf( - "Terraform 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.", + "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.", 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\nTerraform 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\nOpenTF 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 { From 75ff79532655c8a63fb2e9ae56e0fefa31886273 Mon Sep 17 00:00:00 2001 From: Elbaz Date: Tue, 22 Aug 2023 15:43:11 +0300 Subject: [PATCH 2/3] more naming updates --- internal/configs/experiments.go | 8 ++++---- internal/configs/module_call.go | 2 +- internal/configs/named_values.go | 6 +++--- internal/configs/provider.go | 2 +- internal/configs/provider_test.go | 4 ++-- internal/configs/provider_validation.go | 6 +++--- internal/configs/resource.go | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/internal/configs/experiments.go b/internal/configs/experiments.go index 94cfc32472..12f9411da2 100644 --- a/internal/configs/experiments.go +++ b/internal/configs/experiments.go @@ -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. Terraform %s supports only language edition %s, which is the default.", + "The language argument expects a bare language edition keyword. OpenTF %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( - "Terraform v%s only supports language edition %s. This module requires a %s version of Terraform CLI.", + "OpenTF v%s only supports language edition %s. This module requires a %s version of OpenTF 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 Terraform.", + Detail: "Experimental features are intended only for gathering early feedback on new language designs, and so are available only in alpha releases of OpenTF.", 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 Terraform 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 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.", Subject: expr.Range().Ptr(), }) } diff --git a/internal/configs/module_call.go b/internal/configs/module_call.go index e424f35081..9868bbb7f9 100644 --- a/internal/configs/module_call.go +++ b/internal/configs/module_call.go @@ -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 Terraform in a future version.", block.Type), + Detail: fmt.Sprintf("The block type name %q is reserved for use by OpenTF in a future version.", block.Type), Subject: &block.TypeRange, }) } diff --git a/internal/configs/named_values.go b/internal/configs/named_values.go index 95ee33506f..6811801e40 100644 --- a/internal/configs/named_values.go +++ b/internal/configs/named_values.go @@ -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 Terraform. Remove the quotes around \"string\".", + 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\".", 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: "Terraform 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 Terraform. Remove the quotes around \"list\" and write list(string) instead to explicitly indicate that the list elements are strings.", + 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.", 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: "Terraform 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 Terraform. Remove the quotes around \"map\" and write map(string) instead to explicitly indicate that the map elements are strings.", + 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.", Subject: expr.Range().Ptr(), }) return cty.DynamicPseudoType, nil, VariableParseHCL, diags diff --git a/internal/configs/provider.go b/internal/configs/provider.go index 500094dcb5..854cdb77b6 100644 --- a/internal/configs/provider.go +++ b/internal/configs/provider.go @@ -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 Terraform. To silence this warning, move the provider version constraint into the required_providers block.", + 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.", Subject: attr.Expr.Range().Ptr(), }) var versionDiags hcl.Diagnostics diff --git a/internal/configs/provider_test.go b/internal/configs/provider_test.go index 7062d06563..35a6797fea 100644 --- a/internal/configs/provider_test.go +++ b/internal/configs/provider_test.go @@ -24,8 +24,8 @@ func TestProviderReservedNames(t *testing.T) { _, diags := parser.LoadConfigFile("config.tf") assertExactDiagnostics(t, diags, []string{ - //TODO: This deprecation warning will be removed in terraform 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 Terraform. To silence this warning, move the provider version constraint into the required_providers block.`, + //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.`, diff --git a/internal/configs/provider_validation.go b/internal/configs/provider_validation.go index 5c3c79e1ea..0154756914 100644 --- a/internal/configs/provider_validation.go +++ b/internal/configs/provider_validation.go @@ -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 Terraform 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 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.", 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 Terraform 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 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.", 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 Terraform 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 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", name, moduleText, ) fmt.Fprintf(&buf, " %s = {\n", name) diff --git a/internal/configs/resource.go b/internal/configs/resource.go index 64205df666..2c8070ba61 100644 --- a/internal/configs/resource.go +++ b/internal/configs/resource.go @@ -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 Terraform in a future version.", block.Type), + Detail: fmt.Sprintf("The block type name %q is reserved for use by OpenTF in a future version.", block.Type), Subject: block.TypeRange.Ptr(), }) } From 6000fe690e33cc513102ae3f0cc173676d5793de Mon Sep 17 00:00:00 2001 From: Elbaz Date: Tue, 22 Aug 2023 15:47:37 +0300 Subject: [PATCH 3/3] fix warning checks --- .../testdata/config-diagnostics/empty-configs/warnings | 4 ++-- .../testdata/config-diagnostics/incorrect-type/warnings | 2 +- .../testdata/config-diagnostics/unexpected-provider/warnings | 2 +- .../config-diagnostics/unknown-root-provider/warnings | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/configs/testdata/config-diagnostics/empty-configs/warnings b/internal/configs/testdata/config-diagnostics/empty-configs/warnings index d2fe48dd53..473ae9cb47 100644 --- a/internal/configs/testdata/config-diagnostics/empty-configs/warnings +++ b/internal/configs/testdata/config-diagnostics/empty-configs/warnings @@ -1,4 +1,4 @@ -empty-configs/mod/main.tf:10,1-15: Redundant empty provider block; Earlier versions of Terraform 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 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. 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 Terraform 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 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. 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: diff --git a/internal/configs/testdata/config-diagnostics/incorrect-type/warnings b/internal/configs/testdata/config-diagnostics/incorrect-type/warnings index 1e35e8896c..10fde55c26 100644 --- a/internal/configs/testdata/config-diagnostics/incorrect-type/warnings +++ b/internal/configs/testdata/config-diagnostics/incorrect-type/warnings @@ -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 Terraform 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 OpenTF is assuming you mean to pass a configuration for "hashicorp/baz". diff --git a/internal/configs/testdata/config-diagnostics/unexpected-provider/warnings b/internal/configs/testdata/config-diagnostics/unexpected-provider/warnings index 82be3b7096..61eb7fc188 100644 --- a/internal/configs/testdata/config-diagnostics/unexpected-provider/warnings +++ b/internal/configs/testdata/config-diagnostics/unexpected-provider/warnings @@ -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 Terraform 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 OpenTF is assuming you mean to pass a configuration for "hashicorp/foo". diff --git a/internal/configs/testdata/config-diagnostics/unknown-root-provider/warnings b/internal/configs/testdata/config-diagnostics/unknown-root-provider/warnings index 4d85a512cb..b6eb8de9ae 100644 --- a/internal/configs/testdata/config-diagnostics/unknown-root-provider/warnings +++ b/internal/configs/testdata/config-diagnostics/unknown-root-provider/warnings @@ -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 Terraform 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 OpenTF is assuming you mean to pass a configuration for provider "hashicorp/bar".