Make superseded releases keep labels

Signed-off-by: Dmitry Chepurovskiy <dm3ch@dm3ch.net>
Signed-off-by: Dmitry Chepurovskiy <me@dm3ch.net>
pull/10533/head
Dmitry Chepurovskiy 3 years ago committed by Dmitry Chepurovskiy
parent ff3e55f655
commit 627ec6a0c6
No known key found for this signature in database
GPG Key ID: 5B3A5FDCBFF9B3A4

@ -78,6 +78,7 @@ func (cfgmaps *ConfigMaps) Get(key string) (*rspb.Release, error) {
cfgmaps.Log("get: failed to decode data %q: %s", key, err) cfgmaps.Log("get: failed to decode data %q: %s", key, err)
return nil, err return nil, err
} }
r.Labels = obj.ObjectMeta.Labels
// return the release object // return the release object
return r, nil return r, nil
} }
@ -145,6 +146,7 @@ func (cfgmaps *ConfigMaps) Query(labels map[string]string) ([]*rspb.Release, err
cfgmaps.Log("query: failed to decode release: %s", err) cfgmaps.Log("query: failed to decode release: %s", err)
continue continue
} }
rls.Labels = item.ObjectMeta.Labels
results = append(results, rls) results = append(results, rls)
} }
return results, nil return results, nil

@ -72,6 +72,7 @@ func (secrets *Secrets) Get(key string) (*rspb.Release, error) {
} }
// found the secret, decode the base64 data string // found the secret, decode the base64 data string
r, err := decodeRelease(string(obj.Data["release"])) r, err := decodeRelease(string(obj.Data["release"]))
r.Labels = obj.ObjectMeta.Labels
return r, errors.Wrapf(err, "get: failed to decode data %q", key) return r, errors.Wrapf(err, "get: failed to decode data %q", key)
} }
@ -136,6 +137,7 @@ func (secrets *Secrets) Query(labels map[string]string) ([]*rspb.Release, error)
secrets.Log("query: failed to decode release: %s", err) secrets.Log("query: failed to decode release: %s", err)
continue continue
} }
rls.Labels = item.ObjectMeta.Labels
results = append(results, rls) results = append(results, rls)
} }
return results, nil return results, nil

Loading…
Cancel
Save