fix: handle error of remove annotations

This commit is contained in:
johnmanjiro13
2022-06-03 14:10:59 +09:00
parent 23de1499c2
commit a8c0be49ae

View File

@@ -112,10 +112,16 @@ func (b *Kustomizer) Run(
}
m.RemoveBuildAnnotations()
if !utils.StringSliceContains(kt.Kustomization().BuildMetadata, types.OriginAnnotations) {
m.RemoveOriginAnnotations()
err = m.RemoveOriginAnnotations()
if err != nil {
return nil, err
}
}
if !utils.StringSliceContains(kt.Kustomization().BuildMetadata, types.TransformerAnnotations) {
m.RemoveTransformerAnnotations()
err = m.RemoveTransformerAnnotations()
if err != nil {
return nil, err
}
}
return m, nil
}