Commit 9d67d8b9 authored by Aishwarya Thangappa's avatar Aishwarya Thangappa

Added PENDING status to helm install

parent 313a891b
...@@ -116,7 +116,7 @@ func (s *ReleaseServer) prepareRelease(req *services.InstallReleaseRequest) (*re ...@@ -116,7 +116,7 @@ func (s *ReleaseServer) prepareRelease(req *services.InstallReleaseRequest) (*re
Info: &release.Info{ Info: &release.Info{
FirstDeployed: ts, FirstDeployed: ts,
LastDeployed: ts, LastDeployed: ts,
Status: &release.Status{Code: release.Status_UNKNOWN}, Status: &release.Status{Code: release.Status_PENDING},
Description: "Initial install underway", // Will be overwritten. Description: "Initial install underway", // Will be overwritten.
}, },
Manifest: manifestDoc.String(), Manifest: manifestDoc.String(),
...@@ -172,6 +172,7 @@ func (s *ReleaseServer) performRelease(r *release.Release, req *services.Install ...@@ -172,6 +172,7 @@ func (s *ReleaseServer) performRelease(r *release.Release, req *services.Install
Recreate: false, Recreate: false,
Timeout: req.Timeout, Timeout: req.Timeout,
} }
s.recordRelease(r, false)
if err := s.ReleaseModule.Update(old, r, updateReq, s.env); err != nil { if err := s.ReleaseModule.Update(old, r, updateReq, s.env); err != nil {
msg := fmt.Sprintf("Release replace %q failed: %s", r.Name, err) msg := fmt.Sprintf("Release replace %q failed: %s", r.Name, err)
s.Log("warning: %s", msg) s.Log("warning: %s", msg)
...@@ -179,19 +180,20 @@ func (s *ReleaseServer) performRelease(r *release.Release, req *services.Install ...@@ -179,19 +180,20 @@ func (s *ReleaseServer) performRelease(r *release.Release, req *services.Install
r.Info.Status.Code = release.Status_FAILED r.Info.Status.Code = release.Status_FAILED
r.Info.Description = msg r.Info.Description = msg
s.recordRelease(old, true) s.recordRelease(old, true)
s.recordRelease(r, false) s.recordRelease(r, true)
return res, err return res, err
} }
default: default:
// nothing to replace, create as normal // nothing to replace, create as normal
// regular manifests // regular manifests
s.recordRelease(r, false)
if err := s.ReleaseModule.Create(r, req, s.env); err != nil { if err := s.ReleaseModule.Create(r, req, s.env); err != nil {
msg := fmt.Sprintf("Release %q failed: %s", r.Name, err) msg := fmt.Sprintf("Release %q failed: %s", r.Name, err)
s.Log("warning: %s", msg) s.Log("warning: %s", msg)
r.Info.Status.Code = release.Status_FAILED r.Info.Status.Code = release.Status_FAILED
r.Info.Description = msg r.Info.Description = msg
s.recordRelease(r, false) s.recordRelease(r, true)
return res, fmt.Errorf("release %s failed: %s", r.Name, err) return res, fmt.Errorf("release %s failed: %s", r.Name, err)
} }
} }
...@@ -203,7 +205,7 @@ func (s *ReleaseServer) performRelease(r *release.Release, req *services.Install ...@@ -203,7 +205,7 @@ func (s *ReleaseServer) performRelease(r *release.Release, req *services.Install
s.Log("warning: %s", msg) s.Log("warning: %s", msg)
r.Info.Status.Code = release.Status_FAILED r.Info.Status.Code = release.Status_FAILED
r.Info.Description = msg r.Info.Description = msg
s.recordRelease(r, false) s.recordRelease(r, true)
return res, err return res, err
} }
} }
...@@ -217,7 +219,7 @@ func (s *ReleaseServer) performRelease(r *release.Release, req *services.Install ...@@ -217,7 +219,7 @@ func (s *ReleaseServer) performRelease(r *release.Release, req *services.Install
// //
// One possible strategy would be to do a timed retry to see if we can get // One possible strategy would be to do a timed retry to see if we can get
// this stored in the future. // this stored in the future.
s.recordRelease(r, false) s.recordRelease(r, true)
return res, nil return res, nil
} }
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