|
|
@ -70,15 +70,15 @@ func (m *Memory) Delete(name string) (*release.Release, error) {
|
|
|
|
return rel, nil
|
|
|
|
return rel, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// List returns all releases.
|
|
|
|
// List returns all releases whose status is not Status_DELETED.
|
|
|
|
func (m *Memory) List() ([]*release.Release, error) {
|
|
|
|
func (m *Memory) List() ([]*release.Release, error) {
|
|
|
|
m.RLock()
|
|
|
|
m.RLock()
|
|
|
|
defer m.RUnlock()
|
|
|
|
defer m.RUnlock()
|
|
|
|
buf := make([]*release.Release, len(m.releases))
|
|
|
|
buf := []*release.Release{}
|
|
|
|
i := 0
|
|
|
|
|
|
|
|
for _, v := range m.releases {
|
|
|
|
for _, v := range m.releases {
|
|
|
|
buf[i] = v
|
|
|
|
if v.Info.Status.Code != release.Status_DELETED {
|
|
|
|
i++
|
|
|
|
buf = append(buf, v)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return buf, nil
|
|
|
|
return buf, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|