Commit 53b01949 authored by Matt Butcher's avatar Matt Butcher

fix(tiller): store failed release on post-inst failure

This fixes a bug where post-install hooks did not result in recording a
failure.
parent c7182a5a
...@@ -538,8 +538,8 @@ func (s *releaseServer) performRelease(r *release.Release, req *services.Install ...@@ -538,8 +538,8 @@ func (s *releaseServer) performRelease(r *release.Release, req *services.Install
kubeCli := s.env.KubeClient kubeCli := s.env.KubeClient
b := bytes.NewBufferString(r.Manifest) b := bytes.NewBufferString(r.Manifest)
if err := kubeCli.Create(r.Namespace, b); err != nil { if err := kubeCli.Create(r.Namespace, b); err != nil {
r.Info.Status.Code = release.Status_FAILED
log.Printf("warning: Release %q failed: %s", r.Name, err) log.Printf("warning: Release %q failed: %s", r.Name, err)
r.Info.Status.Code = release.Status_FAILED
s.recordRelease(r, req.ReuseName) s.recordRelease(r, req.ReuseName)
return res, fmt.Errorf("release %s failed: %s", r.Name, err) return res, fmt.Errorf("release %s failed: %s", r.Name, err)
} }
...@@ -547,6 +547,9 @@ func (s *releaseServer) performRelease(r *release.Release, req *services.Install ...@@ -547,6 +547,9 @@ func (s *releaseServer) performRelease(r *release.Release, req *services.Install
// post-install hooks // post-install hooks
if !req.DisableHooks { if !req.DisableHooks {
if err := s.execHook(r.Hooks, r.Name, r.Namespace, postInstall); err != nil { if err := s.execHook(r.Hooks, r.Name, r.Namespace, postInstall); err != nil {
log.Printf("warning: Release %q failed post-install: %s", r.Name, err)
r.Info.Status.Code = release.Status_FAILED
s.recordRelease(r, req.ReuseName)
return res, err return res, err
} }
} }
......
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