github.com/rancher/types@v0.0.0-20220328215343-4370ff10ecd5/mapper/workload.go (about)

     1  package mapper
     2  
     3  import (
     4  	"github.com/rancher/norman/types"
     5  	"github.com/rancher/norman/types/convert"
     6  	"github.com/rancher/norman/types/values"
     7  )
     8  
     9  type WorkloadAnnotations struct {
    10  }
    11  
    12  func (n WorkloadAnnotations) FromInternal(data map[string]interface{}) {
    13  	v, ok := values.RemoveValue(data, "workloadAnnotations", "field.cattle.io/publicEndpoints")
    14  	if ok {
    15  		if _, ok := data["annotations"]; !ok {
    16  			data["annotations"] = map[string]interface{}{}
    17  		}
    18  		annotations := convert.ToMapInterface(data["annotations"])
    19  		annotations["field.cattle.io/publicEndpoints"] = v
    20  	}
    21  }
    22  
    23  func (n WorkloadAnnotations) ToInternal(data map[string]interface{}) error {
    24  	return nil
    25  }
    26  
    27  func (n WorkloadAnnotations) ModifySchema(schema *types.Schema, schemas *types.Schemas) error {
    28  	return nil
    29  }