Commit c36868eb authored by Travis Nielsen's avatar Travis Nielsen Committed by GitHub
Browse files

Merge pull request #6720 from cloudical-io/fix_label_merge

core: fix label merge
parents 5b72a3f8 48d21947
No related merge requests found
Showing with 5 additions and 3 deletions
+5 -3
......@@ -40,9 +40,11 @@ func (a Labels) ApplyToObjectMeta(t *metav1.ObjectMeta) {
// original Labels with the attributes of the supplied one. The supplied
// Labels attributes will override the original ones if defined.
func (a Labels) Merge(with Labels) Labels {
ret := a
if ret == nil {
ret = map[string]string{}
ret := Labels{}
for k, v := range a {
if _, ok := ret[k]; !ok {
ret[k] = v
}
}
for k, v := range with {
if _, ok := ret[k]; !ok {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment