Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema: fix unknown value validation bug #1047

Merged
merged 3 commits into from Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 1 addition & 9 deletions helper/schema/schema.go
Expand Up @@ -1735,15 +1735,7 @@ func (m schemaMap) validate(
// The SDK has to allow the unknown value through initially, so that
// Required fields set via an interpolated value are accepted.
if !isWhollyKnown(raw) {
if schema.Deprecated != "" {
return append(diags, diag.Diagnostic{
Severity: diag.Warning,
Summary: "Argument is deprecated",
Detail: schema.Deprecated,
AttributePath: path,
})
}
return diags
return nil
}

err = validateConflictingAttributes(k, schema, c)
Expand Down
5 changes: 1 addition & 4 deletions helper/schema/schema_test.go
Expand Up @@ -5792,10 +5792,7 @@ func TestSchemaMap_Validate(t *testing.T) {
Config: map[string]interface{}{
"old_news": hcl2shim.UnknownVariableValue,
},

Warnings: []string{
"Warning: Argument is deprecated: please use 'new_news' instead",
},
Err: false,
},

"Required sub-resource field": {
Expand Down