allocate map if Labels is not initialized

This commit is contained in:
Masahiro Sano
2015-02-11 20:05:41 +09:00
parent fcee2e16b9
commit a841b91aed
2 changed files with 15 additions and 0 deletions

View File

@@ -156,6 +156,10 @@ func labelFunc(obj runtime.Object, overwrite bool, resourceVersion string, label
}
}
if meta.Labels == nil {
meta.Labels = make(map[string]string)
}
for key, value := range labels {
meta.Labels[key] = value
}