mirror of
https://github.com/helm/helm.git
synced 2026-08-04 15:10:47 +00:00
fix(helm-list): only list configmaps owned by TILLER
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user