diff --git a/internal/configs/configschema/filter.go b/internal/configs/configschema/filter.go index f4697d2f20..35aeba714c 100644 --- a/internal/configs/configschema/filter.go +++ b/internal/configs/configschema/filter.go @@ -50,10 +50,9 @@ func (b *Block) Filter(filterAttribute FilterT[*Attribute], filterBlock FilterT[ for name, attrS := range b.Attributes { if filterAttribute == nil || !filterAttribute(name, attrS) { ret.Attributes[name] = attrS - } - - if attrS.NestedType != nil { - ret.Attributes[name].NestedType = filterNestedType(attrS.NestedType, filterAttribute) + if attrS.NestedType != nil { + ret.Attributes[name].NestedType = filterNestedType(attrS.NestedType, filterAttribute) + } } } diff --git a/internal/configs/configschema/filter_test.go b/internal/configs/configschema/filter_test.go index 6525a565d2..b2666f0a40 100644 --- a/internal/configs/configschema/filter_test.go +++ b/internal/configs/configschema/filter_test.go @@ -175,6 +175,12 @@ func TestFilter(t *testing.T) { Nesting: NestingList, }, }, + "missing_attributes": { + NestedType: &Object{ + Nesting: NestingList, + }, + Computed: true, + }, }, BlockTypes: map[string]*NestedBlock{