Skip to content

Commit

Permalink
Merge pull request #28625 from hashicorp/backport/jbardin/schema-valu…
Browse files Browse the repository at this point in the history
…e-marks/humbly-neat-alpaca

Backport of null check in ValueMarks into v0.15
  • Loading branch information
jbardin authored May 6, 2021
2 parents 56b8352 + ab3b94b commit 3c31aad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions configs/configschema/marks.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ func (b *Block) ValueMarks(val cty.Value, path cty.Path) []cty.PathValueMarks {
}
}

if val.IsNull() {
return pvm
}
for name, blockS := range b.BlockTypes {
// If our block doesn't contain any sensitive attributes, skip inspecting it
if !blockS.Block.ContainsSensitive() {
Expand Down
4 changes: 4 additions & 0 deletions configs/configschema/marks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ func TestBlockValueMarks(t *testing.T) {
cty.UnknownVal(schema.ImpliedType()),
cty.UnknownVal(schema.ImpliedType()),
},
{
cty.NullVal(schema.ImpliedType()),
cty.NullVal(schema.ImpliedType()),
},
{
cty.ObjectVal(map[string]cty.Value{
"sensitive": cty.UnknownVal(cty.String),
Expand Down

0 comments on commit 3c31aad

Please sign in to comment.