fix: rollback failure after update error

Signed-off-by: Martin Mulholland <mmulholl@redhat.com>
pull/10244/head
Martin Mulholland 3 years ago
parent f41f46c6c6
commit 8543cc4235
No known key found for this signature in database
GPG Key ID: AEE31640D43DB4EA

@ -256,13 +256,6 @@ func (c *Client) Update(original, target ResourceList, force bool) (*Result, err
return nil
})
switch {
case err != nil:
return res, err
case len(updateErrors) != 0:
return res, errors.Errorf(strings.Join(updateErrors, " && "))
}
for _, info := range original.Difference(target) {
c.Log("Deleting %q in %s...", info.Name, info.Namespace)
@ -284,6 +277,13 @@ func (c *Client) Update(original, target ResourceList, force bool) (*Result, err
}
res.Deleted = append(res.Deleted, info)
}
switch {
case err != nil:
return res, err
case len(updateErrors) != 0:
return res, errors.Errorf(strings.Join(updateErrors, " && "))
}
return res, nil
}

Loading…
Cancel
Save