mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 11:18:16 +00:00
allocate map if Labels is not initialized
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user