2018-03-02 00:56:09 +00:00
|
|
|
package mapper
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/rancher/norman/types"
|
|
|
|
"github.com/rancher/norman/types/convert"
|
|
|
|
"github.com/rancher/norman/types/values"
|
|
|
|
)
|
|
|
|
|
|
|
|
type WorkloadAnnotations struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n WorkloadAnnotations) FromInternal(data map[string]interface{}) {
|
|
|
|
v, ok := values.RemoveValue(data, "workloadAnnotations", "field.cattle.io/publicEndpoints")
|
|
|
|
if ok {
|
2018-03-05 20:13:02 +00:00
|
|
|
if _, ok := data["annotations"]; !ok {
|
|
|
|
data["annotations"] = map[string]interface{}{}
|
2018-03-02 05:34:34 +00:00
|
|
|
}
|
2018-03-05 20:13:02 +00:00
|
|
|
annotations := convert.ToMapInterface(data["annotations"])
|
2018-03-02 00:56:09 +00:00
|
|
|
annotations["field.cattle.io/publicEndpoints"] = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-05 04:44:54 +00:00
|
|
|
func (n WorkloadAnnotations) ToInternal(data map[string]interface{}) error {
|
|
|
|
return nil
|
2018-03-02 00:56:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (n WorkloadAnnotations) ModifySchema(schema *types.Schema, schemas *types.Schemas) error {
|
|
|
|
return nil
|
|
|
|
}
|