1
0
mirror of https://github.com/rancher/types.git synced 2025-07-16 06:25:50 +00:00

Merge pull request #282 from alena1108/fix

Workload endpoints: bug fix for publicEndpoints when annotation is nil
This commit is contained in:
Alena Prokharchyk 2018-03-05 12:19:32 -08:00 committed by GitHub
commit b050266a9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
}
}