1
0
mirror of https://github.com/rancher/types.git synced 2025-06-24 12:41:33 +00:00
types/mapper/workload.go
2018-03-01 21:34:34 -08:00

29 lines
736 B
Go

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 {
annotations := convert.ToMapInterface(data["annotations"])
if annotations == nil {
annotations = map[string]interface{}{}
}
annotations["field.cattle.io/publicEndpoints"] = v
}
}
func (n WorkloadAnnotations) ToInternal(data map[string]interface{}) {
}
func (n WorkloadAnnotations) ModifySchema(schema *types.Schema, schemas *types.Schemas) error {
return nil
}