fix(tiller): save failed releases

When a release failed, the release record was not saved. That led to the
case where Kubernetes resources were deployed, but the release that
deployed them was not tracked.

To fix, we now save the release on failure. The 'helm delete' operation
can delete failed resources.

Closes #851
pull/855/head
Matt Butcher 8 years ago
parent c41ccddfa1
commit da14da360b

@ -271,6 +271,9 @@ func (s *releaseServer) InstallRelease(c ctx.Context, req *services.InstallRelea
if err := s.env.KubeClient.Create(s.env.Namespace, b); err != nil { if err := s.env.KubeClient.Create(s.env.Namespace, b); err != nil {
r.Info.Status.Code = release.Status_FAILED r.Info.Status.Code = release.Status_FAILED
log.Printf("warning: Release %q failed: %s", name, err) log.Printf("warning: Release %q failed: %s", name, err)
if err := s.env.Releases.Create(r); err != nil {
log.Printf("warning: Failed to record release %q: %s", name, err)
}
return res, fmt.Errorf("release %s failed: %s", name, err) return res, fmt.Errorf("release %s failed: %s", name, err)
} }

Loading…
Cancel
Save