|
|
@ -69,8 +69,8 @@ func (s *ReleaseServer) prepareUpdate(req *services.UpdateReleaseRequest) (*rele
|
|
|
|
return nil, nil, errMissingChart
|
|
|
|
return nil, nil, errMissingChart
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// finds the non-deleted release with the given name
|
|
|
|
// finds the deployed release with the given name
|
|
|
|
currentRelease, err := s.env.Releases.Last(req.Name)
|
|
|
|
currentRelease, err := s.env.Releases.Deployed(req.Name)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, nil, err
|
|
|
|
return nil, nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -80,9 +80,15 @@ func (s *ReleaseServer) prepareUpdate(req *services.UpdateReleaseRequest) (*rele
|
|
|
|
return nil, nil, err
|
|
|
|
return nil, nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// finds the non-deleted release with the given name
|
|
|
|
|
|
|
|
lastRelease, err := s.env.Releases.Last(req.Name)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return nil, nil, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Increment revision count. This is passed to templates, and also stored on
|
|
|
|
// Increment revision count. This is passed to templates, and also stored on
|
|
|
|
// the release object.
|
|
|
|
// the release object.
|
|
|
|
revision := currentRelease.Version + 1
|
|
|
|
revision := lastRelease.Version + 1
|
|
|
|
|
|
|
|
|
|
|
|
ts := timeconv.Now()
|
|
|
|
ts := timeconv.Now()
|
|
|
|
options := chartutil.ReleaseOptions{
|
|
|
|
options := chartutil.ReleaseOptions{
|
|
|
@ -151,7 +157,6 @@ func (s *ReleaseServer) performUpdate(originalRelease, updatedRelease *release.R
|
|
|
|
if err := s.ReleaseModule.Update(originalRelease, updatedRelease, req, s.env); err != nil {
|
|
|
|
if err := s.ReleaseModule.Update(originalRelease, updatedRelease, req, s.env); err != nil {
|
|
|
|
msg := fmt.Sprintf("Upgrade %q failed: %s", updatedRelease.Name, err)
|
|
|
|
msg := fmt.Sprintf("Upgrade %q failed: %s", updatedRelease.Name, err)
|
|
|
|
s.Log("warning: %s", msg)
|
|
|
|
s.Log("warning: %s", msg)
|
|
|
|
originalRelease.Info.Status.Code = release.Status_SUPERSEDED
|
|
|
|
|
|
|
|
updatedRelease.Info.Status.Code = release.Status_FAILED
|
|
|
|
updatedRelease.Info.Status.Code = release.Status_FAILED
|
|
|
|
updatedRelease.Info.Description = msg
|
|
|
|
updatedRelease.Info.Description = msg
|
|
|
|
s.recordRelease(originalRelease, true)
|
|
|
|
s.recordRelease(originalRelease, true)
|
|
|
|