Commit 4a7d47cd authored by Matt Butcher's avatar Matt Butcher Committed by GitHub

Merge pull request #2719 from nebril/release-module-nil

Handle nil responses returned from rudder funcs
parents e8d80729 6b16ee2f
...@@ -124,6 +124,9 @@ func (m *RemoteReleaseModule) Rollback(current, target *release.Release, req *se ...@@ -124,6 +124,9 @@ func (m *RemoteReleaseModule) Rollback(current, target *release.Release, req *se
func (m *RemoteReleaseModule) Status(r *release.Release, req *services.GetReleaseStatusRequest, env *environment.Environment) (string, error) { func (m *RemoteReleaseModule) Status(r *release.Release, req *services.GetReleaseStatusRequest, env *environment.Environment) (string, error) {
statusRequest := &rudderAPI.ReleaseStatusRequest{Release: r} statusRequest := &rudderAPI.ReleaseStatusRequest{Release: r}
resp, err := rudder.ReleaseStatus(statusRequest) resp, err := rudder.ReleaseStatus(statusRequest)
if resp == nil {
return "", err
}
return resp.Info.Status.Resources, err return resp.Info.Status.Resources, err
} }
...@@ -131,10 +134,17 @@ func (m *RemoteReleaseModule) Status(r *release.Release, req *services.GetReleas ...@@ -131,10 +134,17 @@ func (m *RemoteReleaseModule) Status(r *release.Release, req *services.GetReleas
func (m *RemoteReleaseModule) Delete(r *release.Release, req *services.UninstallReleaseRequest, env *environment.Environment) (string, []error) { func (m *RemoteReleaseModule) Delete(r *release.Release, req *services.UninstallReleaseRequest, env *environment.Environment) (string, []error) {
deleteRequest := &rudderAPI.DeleteReleaseRequest{Release: r} deleteRequest := &rudderAPI.DeleteReleaseRequest{Release: r}
resp, err := rudder.DeleteRelease(deleteRequest) resp, err := rudder.DeleteRelease(deleteRequest)
errs := make([]error, 0)
result := ""
if err != nil { if err != nil {
return resp.Release.Manifest, []error{err} errs = append(errs, err)
}
if resp != nil {
result = resp.Release.Manifest
} }
return resp.Release.Manifest, []error{} return result, errs
} }
// DeleteRelease is a helper that allows Rudder to delete a release without exposing most of Tiller inner functions // DeleteRelease is a helper that allows Rudder to delete a release without exposing most of Tiller inner functions
......
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