Handle errors

This commit is contained in:
Mikhail Mazurskiy
2021-06-05 09:43:13 +10:00
parent 0305860078
commit a3ed120efb
25 changed files with 232 additions and 126 deletions

View File

@@ -37,11 +37,20 @@ func (p *plugin) Transform(m resmap.ResMap) error {
if r.GetName() == p.Name {
for i := 1; i <= p.Count; i++ {
c := r.DeepCopy()
c.SetName(fmt.Sprintf("%s-%d", p.Name, i))
m.Append(c)
err := c.SetName(fmt.Sprintf("%s-%d", p.Name, i))
if err != nil {
return err
}
err = m.Append(c)
if err != nil {
return err
}
}
} else {
m.Append(r)
err := m.Append(r)
if err != nil {
return err
}
}
}
return nil