Pass labels from secret/configmap to release object

Signed-off-by: Dmitry Chepurovskiy <dm3ch@dm3ch.net>
This commit is contained in:
Dmitry Chepurovskiy 2020-07-29 22:24:07 +03:00
parent edc7d8ea32
commit 99bd709530
No known key found for this signature in database
GPG key ID: A9B6ED8F3D834514
3 changed files with 4 additions and 0 deletions

View file

@ -37,6 +37,8 @@ type Release struct {
Version int `json:"version,omitempty"`
// Namespace is the kubernetes namespace of the release.
Namespace string `json:"namespace,omitempty"`
// Labels of the release
Labels map[string]string `json:"labels,omitempty"`
}
// SetStatus is a helper for setting the status on a release.

View file

@ -106,6 +106,7 @@ func (cfgmaps *ConfigMaps) List(filter func(*rspb.Release) bool) ([]*rspb.Releas
continue
}
if filter(rls) {
rls.Labels = item.ObjectMeta.Labels
results = append(results, rls)
}
}

View file

@ -98,6 +98,7 @@ func (secrets *Secrets) List(filter func(*rspb.Release) bool) ([]*rspb.Release,
continue
}
if filter(rls) {
rls.Labels = item.ObjectMeta.Labels
results = append(results, rls)
}
}