Skip to content

Commit 567ff60

Browse files
committed
don't error if the key doesn't exist and value is null.
1 parent be88f44 commit 567ff60

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

manifest/morph/morph.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -597,12 +597,14 @@ func morphObjectToType(v tftypes.Value, t tftypes.Type, p *tftypes.AttributePath
597597
elp := p.WithAttributeName(k)
598598
nt, ok := t.(tftypes.Object).AttributeTypes[k]
599599
if !ok {
600-
diags = append(diags, &tfprotov5.Diagnostic{
601-
Attribute: p,
602-
Severity: tfprotov5.DiagnosticSeverityWarning,
603-
Summary: "Attribute not found in schema",
604-
Detail: fmt.Sprintf("Unable to find schema type for attribute:\n%s", attributePathSummary(elp)),
605-
})
600+
if !v.IsNull() {
601+
diags = append(diags, &tfprotov5.Diagnostic{
602+
Attribute: p,
603+
Severity: tfprotov5.DiagnosticSeverityWarning,
604+
Summary: "Attribute not found in schema",
605+
Detail: fmt.Sprintf("Unable to find schema type for attribute:\n%s", attributePathSummary(elp)),
606+
})
607+
}
606608
continue
607609
}
608610
nv, d := ValueToType(v, nt, elp)

0 commit comments

Comments
 (0)