Merge pull request #3673 from natasha41575/PanicDuplicateKeys

Return error instead of panicking for duplicate keys
This commit is contained in:
Jeff Regan
2021-03-05 11:55:33 -08:00
committed by GitHub
16 changed files with 125 additions and 31 deletions

View File

@@ -34,12 +34,16 @@ func (p *plugin) Transform(m resmap.ResMap) error {
return nil
}
for _, r := range m.Resources() {
if r.IsEmpty() {
empty, err := r.IsEmpty()
if err != nil {
return err
}
if empty {
// Don't mutate empty objects?
continue
}
r.StorePreviousId()
err := r.ApplyFilter(namespace.Filter{
err = r.ApplyFilter(namespace.Filter{
Namespace: p.Namespace,
FsSlice: p.FieldSpecs,
})