feat(rollback-storage): remove extraneous else block and fix type in records_test

pull/1155/head
fibonacci1729 8 years ago
parent 1d6c16175b
commit 83df6ebc4d

@ -181,17 +181,17 @@ func (s *releaseServer) GetReleaseStatus(c ctx.Context, req *services.GetRelease
} }
var rel *release.Release var rel *release.Release
if req.Version <= 0 {
var err error var err error
if req.Version <= 0 {
if rel, err = s.env.Releases.Deployed(req.Name); err != nil { if rel, err = s.env.Releases.Deployed(req.Name); err != nil {
return nil, err return nil, err
} }
} else { }
var err error
if rel, err = s.env.Releases.Get(req.Name, req.Version); err != nil { if rel, err = s.env.Releases.Get(req.Name, req.Version); err != nil {
return nil, err return nil, err
} }
}
if rel.Info == nil { if rel.Info == nil {
return nil, errors.New("release info is missing") return nil, errors.New("release info is missing")

@ -65,7 +65,7 @@ func TestRecordsRemove(t *testing.T) {
}{ }{
{"remove valid key", "rls-a.v1", false}, {"remove valid key", "rls-a.v1", false},
{"remove invalid key", "rls-a.v", true}, {"remove invalid key", "rls-a.v", true},
{"remove non-existant key", "rls-z.v1", true}, {"remove non-existent key", "rls-z.v1", true},
} }
rs := records([]*record{ rs := records([]*record{

Loading…
Cancel
Save