Introduce resmap.ApplyFilter.

This commit is contained in:
monopole
2021-05-10 16:55:28 -07:00
parent 714af0cd66
commit 01ddeb476d
17 changed files with 294 additions and 101 deletions

View File

@@ -31,14 +31,8 @@ func (p *plugin) Transform(m resmap.ResMap) error {
if len(p.Labels) == 0 {
return nil
}
for _, r := range m.Resources() {
err := r.ApplyFilter(labels.Filter{
Labels: p.Labels,
FsSlice: p.FieldSpecs,
})
if err != nil {
return err
}
}
return nil
return m.ApplyFilter(labels.Filter{
Labels: p.Labels,
FsSlice: p.FieldSpecs,
})
}