mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Handle errors
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user