mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Avoid leaking sensitive values in undeclared warnings
This commit is contained in:
parent
cf49f794d7
commit
9ba211c04e
@ -80,12 +80,11 @@ func ParseVariableValues(vv map[string]UnparsedVariableValue, decls map[string]*
|
|||||||
// should migrate to using environment variables instead before
|
// should migrate to using environment variables instead before
|
||||||
// this becomes an error in a future major release.
|
// this becomes an error in a future major release.
|
||||||
if seenUndeclaredInFile < 3 {
|
if seenUndeclaredInFile < 3 {
|
||||||
diags = diags.Append(&hcl.Diagnostic{
|
diags = diags.Append(tfdiags.Sourceless(
|
||||||
Severity: hcl.DiagWarning,
|
tfdiags.Warning,
|
||||||
Summary: "Value for undeclared variable",
|
"Value for undeclared variable",
|
||||||
Detail: fmt.Sprintf("The root module does not declare a variable named %q. To use this value, add a \"variable\" block to the configuration.\n\nUsing a variables file to set an undeclared variable is deprecated and will become an error in a future release. If you wish to provide certain \"global\" settings to all configurations in your organization, use TF_VAR_... environment variables to set these instead.", name),
|
fmt.Sprintf("The root module does not declare a variable named %q but a value was found in file %q. To use this value, add a \"variable\" block to the configuration.\n\nUsing a variables file to set an undeclared variable is deprecated and will become an error in a future release. If you wish to provide certain \"global\" settings to all configurations in your organization, use TF_VAR_... environment variables to set these instead.", name, val.SourceRange.Filename),
|
||||||
Subject: val.SourceRange.ToHCL().Ptr(),
|
))
|
||||||
})
|
|
||||||
}
|
}
|
||||||
seenUndeclaredInFile++
|
seenUndeclaredInFile++
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user