Add clarification log messages before calling cleanup-on-fail during update

Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
pull/4871/head
Timofey Kirillov 6 years ago
parent bf7106f6c0
commit faa5fd0b5e

@ -371,6 +371,7 @@ func (c *Client) UpdateWithOptions(namespace string, originalReader, targetReade
cleanupErrors := []string{}
if opts.CleanupOnFail && (err != nil || len(updateErrors) != 0) {
c.Log("Cleanup on fail enabled: cleaning up newly created resources due to update manifests failures")
cleanupErrors = c.cleanup(newlyCreatedResources)
}
@ -405,6 +406,7 @@ func (c *Client) UpdateWithOptions(namespace string, originalReader, targetReade
err := c.waitForResources(time.Duration(opts.Timeout)*time.Second, target)
if opts.CleanupOnFail && err != nil {
c.Log("Cleanup on fail enabled: cleaning up newly created resources due to wait failure during update")
cleanupErrors = c.cleanup(newlyCreatedResources)
return fmt.Errorf(strings.Join(append([]string{err.Error()}, cleanupErrors...), " && "))
}

Loading…
Cancel
Save