|
|
@ -340,7 +340,7 @@ func (s *ReleaseServer) performUpdate(originalRelease, updatedRelease *release.R
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if err := s.performKubeUpdate(originalRelease, updatedRelease); err != nil {
|
|
|
|
if err := s.performKubeUpdate(originalRelease, updatedRelease, req.Restart); err != nil {
|
|
|
|
log.Printf("warning: Release Upgrade %q failed: %s", updatedRelease.Name, err)
|
|
|
|
log.Printf("warning: Release Upgrade %q failed: %s", updatedRelease.Name, err)
|
|
|
|
originalRelease.Info.Status.Code = release.Status_SUPERSEDED
|
|
|
|
originalRelease.Info.Status.Code = release.Status_SUPERSEDED
|
|
|
|
updatedRelease.Info.Status.Code = release.Status_FAILED
|
|
|
|
updatedRelease.Info.Status.Code = release.Status_FAILED
|
|
|
@ -472,7 +472,7 @@ func (s *ReleaseServer) performRollback(currentRelease, targetRelease *release.R
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if err := s.performKubeUpdate(currentRelease, targetRelease); err != nil {
|
|
|
|
if err := s.performKubeUpdate(currentRelease, targetRelease, req.Restart); err != nil {
|
|
|
|
log.Printf("warning: Release Rollback %q failed: %s", targetRelease.Name, err)
|
|
|
|
log.Printf("warning: Release Rollback %q failed: %s", targetRelease.Name, err)
|
|
|
|
currentRelease.Info.Status.Code = release.Status_SUPERSEDED
|
|
|
|
currentRelease.Info.Status.Code = release.Status_SUPERSEDED
|
|
|
|
targetRelease.Info.Status.Code = release.Status_FAILED
|
|
|
|
targetRelease.Info.Status.Code = release.Status_FAILED
|
|
|
@ -496,11 +496,11 @@ func (s *ReleaseServer) performRollback(currentRelease, targetRelease *release.R
|
|
|
|
return res, nil
|
|
|
|
return res, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (s *ReleaseServer) performKubeUpdate(currentRelease, targetRelease *release.Release) error {
|
|
|
|
func (s *ReleaseServer) performKubeUpdate(currentRelease, targetRelease *release.Release, restart bool) error {
|
|
|
|
kubeCli := s.env.KubeClient
|
|
|
|
kubeCli := s.env.KubeClient
|
|
|
|
current := bytes.NewBufferString(currentRelease.Manifest)
|
|
|
|
current := bytes.NewBufferString(currentRelease.Manifest)
|
|
|
|
target := bytes.NewBufferString(targetRelease.Manifest)
|
|
|
|
target := bytes.NewBufferString(targetRelease.Manifest)
|
|
|
|
return kubeCli.Update(targetRelease.Namespace, current, target)
|
|
|
|
return kubeCli.Update(targetRelease.Namespace, current, target, restart)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// prepareRollback finds the previous release and prepares a new release object with
|
|
|
|
// prepareRollback finds the previous release and prepares a new release object with
|
|
|
@ -818,7 +818,7 @@ func (s *ReleaseServer) performRelease(r *release.Release, req *services.Install
|
|
|
|
// so as to append to the old release's history
|
|
|
|
// so as to append to the old release's history
|
|
|
|
r.Version = old.Version + 1
|
|
|
|
r.Version = old.Version + 1
|
|
|
|
|
|
|
|
|
|
|
|
if err := s.performKubeUpdate(old, r); err != nil {
|
|
|
|
if err := s.performKubeUpdate(old, r, false); err != nil {
|
|
|
|
log.Printf("warning: Release replace %q failed: %s", r.Name, err)
|
|
|
|
log.Printf("warning: Release replace %q failed: %s", r.Name, err)
|
|
|
|
old.Info.Status.Code = release.Status_SUPERSEDED
|
|
|
|
old.Info.Status.Code = release.Status_SUPERSEDED
|
|
|
|
r.Info.Status.Code = release.Status_FAILED
|
|
|
|
r.Info.Status.Code = release.Status_FAILED
|
|
|
|