Commit faa5fd0b authored by Timofey Kirillov's avatar Timofey Kirillov

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

Signed-off-by: 's avatarTimofey Kirillov <timofey.kirillov@flant.com>
parent bf7106f6
......@@ -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...), " && "))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment