Short circuit anno/label transformer for performance.

This commit is contained in:
monopole
2021-01-08 17:44:08 -08:00
parent 6f2f401f6b
commit 769f65d6c4
7 changed files with 54 additions and 34 deletions

View File

@@ -24,6 +24,9 @@ func (p *AnnotationsTransformerPlugin) Config(
}
func (p *AnnotationsTransformerPlugin) Transform(m resmap.ResMap) error {
if len(p.Annotations) == 0 {
return nil
}
for _, r := range m.Resources() {
err := r.ApplyFilter(annotations.Filter{
Annotations: p.Annotations,

View File

@@ -24,6 +24,9 @@ func (p *LabelTransformerPlugin) Config(
}
func (p *LabelTransformerPlugin) 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,