|
|
|
@ -200,11 +200,20 @@ func (r *Rollback) performRollback(currentRelease, targetRelease *release.Releas
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if r.Wait {
|
|
|
|
|
if err := r.cfg.KubeClient.Wait(target, r.Timeout, r.WaitForJobs); err != nil {
|
|
|
|
|
targetRelease.SetStatus(release.StatusFailed, fmt.Sprintf("Release %q failed: %s", targetRelease.Name, err.Error()))
|
|
|
|
|
r.cfg.recordRelease(currentRelease)
|
|
|
|
|
r.cfg.recordRelease(targetRelease)
|
|
|
|
|
return targetRelease, errors.Wrapf(err, "release %s failed", targetRelease.Name)
|
|
|
|
|
if r.WaitForJobs {
|
|
|
|
|
if err := r.cfg.KubeClient.WaitWithJobs(target, r.Timeout); err != nil {
|
|
|
|
|
targetRelease.SetStatus(release.StatusFailed, fmt.Sprintf("Release %q failed: %s", targetRelease.Name, err.Error()))
|
|
|
|
|
r.cfg.recordRelease(currentRelease)
|
|
|
|
|
r.cfg.recordRelease(targetRelease)
|
|
|
|
|
return targetRelease, errors.Wrapf(err, "release %s failed", targetRelease.Name)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if err := r.cfg.KubeClient.Wait(target, r.Timeout); err != nil {
|
|
|
|
|
targetRelease.SetStatus(release.StatusFailed, fmt.Sprintf("Release %q failed: %s", targetRelease.Name, err.Error()))
|
|
|
|
|
r.cfg.recordRelease(currentRelease)
|
|
|
|
|
r.cfg.recordRelease(targetRelease)
|
|
|
|
|
return targetRelease, errors.Wrapf(err, "release %s failed", targetRelease.Name)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|