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:
commit
b050266a9e
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user