1
0
mirror of https://github.com/rancher/types.git synced 2025-06-28 06:26:49 +00:00

Workload endpoints: bug fix for publicEndpoints when annotation is nil

This commit is contained in:
Alena Prokharchyk 2018-03-05 12:13:02 -08:00
parent 8d7dbe2543
commit 4ccd2f14eb

View File

@ -12,10 +12,10 @@ type WorkloadAnnotations struct {
func (n WorkloadAnnotations) FromInternal(data map[string]interface{}) {
v, ok := values.RemoveValue(data, "workloadAnnotations", "field.cattle.io/publicEndpoints")
if ok {
annotations := convert.ToMapInterface(data["annotations"])
if annotations == nil {
annotations = map[string]interface{}{}
if _, ok := data["annotations"]; !ok {
data["annotations"] = map[string]interface{}{}
}
annotations := convert.ToMapInterface(data["annotations"])
annotations["field.cattle.io/publicEndpoints"] = v
}
}