fix(helm-list): only list configmaps owned by TILLER

pull/1207/head
fibonacci1729 8 years ago
parent b8f8efc601
commit f77435e686

@ -84,7 +84,10 @@ func (cfgmaps *ConfigMaps) Get(key string) (*rspb.Release, error) {
// that filter(release) == true. An error is returned if the
// configmap fails to retrieve the releases.
func (cfgmaps *ConfigMaps) List(filter func(*rspb.Release) bool) ([]*rspb.Release, error) {
list, err := cfgmaps.impl.List(api.ListOptions{})
lsel := kblabels.Set{"OWNER": "TILLER"}.AsSelector()
opts := api.ListOptions{LabelSelector: lsel}
list, err := cfgmaps.impl.List(opts)
if err != nil {
logerrf(err, "list: failed to list")
return nil, err

@ -125,6 +125,7 @@ func newRecord(key string, rls *rspb.Release) *record {
lbs.init()
lbs.set("NAME", rls.Name)
lbs.set("OWNER", "TILLER")
lbs.set("STATUS", rspb.Status_Code_name[int32(rls.Info.Status.Code)])
lbs.set("VERSION", strconv.Itoa(int(rls.Version)))

@ -113,6 +113,7 @@ func (s *Storage) Deployed(name string) (*rspb.Release, error) {
ls, err := s.Driver.Query(map[string]string{
"NAME": name,
"OWNER": "TILLER",
"STATUS": "DEPLOYED",
})
switch {

Loading…
Cancel
Save