Commit e868da17 authored by Steve Wolter's avatar Steve Wolter Committed by Matthew Fisher

Check for err before working with newRelease. (#4630)

Should fix #4585.
Signed-off-by: 's avatarSteve Wolter <swolter@google.com>
parent a297a0a7
......@@ -150,6 +150,8 @@ func (s *ReleaseServer) performUpdateForce(req *services.UpdateReleaseRequest) (
return nil, err
}
res := &services.UpdateReleaseResponse{}
newRelease, err := s.prepareRelease(&services.InstallReleaseRequest{
Chart: req.Chart,
Values: req.Values,
......@@ -161,11 +163,6 @@ func (s *ReleaseServer) performUpdateForce(req *services.UpdateReleaseRequest) (
Timeout: req.Timeout,
Wait: req.Wait,
})
// update new release with next revision number so as to append to the old release's history
newRelease.Version = oldRelease.Version + 1
res := &services.UpdateReleaseResponse{Release: newRelease}
if err != nil {
s.Log("failed update prepare step: %s", err)
// On dry run, append the manifest contents to a failed release. This is
......@@ -176,6 +173,10 @@ func (s *ReleaseServer) performUpdateForce(req *services.UpdateReleaseRequest) (
return res, err
}
// update new release with next revision number so as to append to the old release's history
newRelease.Version = oldRelease.Version + 1
res.Release = newRelease
if req.DryRun {
s.Log("dry run for %s", newRelease.Name)
res.Release.Info.Description = "Dry run complete"
......
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