Skip to content

Commit 1215a9b

Browse files
Fixed #667
1 parent cc3d9fc commit 1215a9b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

dynatrace/api/v1/config/synthetic/monitors/tag_with_source_info.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,18 @@ func (me TagsWithSourceInfo) MarshalHCL(properties hcl.Properties) error {
4141
}
4242

4343
func (me *TagsWithSourceInfo) UnmarshalHCL(decoder hcl.Decoder) error {
44-
return decoder.DecodeSlice("tag", me)
44+
if err := decoder.DecodeSlice("tag", me); err != nil {
45+
return err
46+
}
47+
finalEntries := TagsWithSourceInfo{}
48+
for _, entry := range *me {
49+
if len(entry.Key) == 0 {
50+
continue
51+
}
52+
finalEntries = append(finalEntries, entry)
53+
}
54+
*me = finalEntries
55+
return nil
4556
}
4657

4758
// Tag with source of a Dynatrace entity

0 commit comments

Comments
 (0)