diff --git a/apis/management.cattle.io/v3/machine_types.go b/apis/management.cattle.io/v3/machine_types.go index d0c3d065..b3555d56 100644 --- a/apis/management.cattle.io/v3/machine_types.go +++ b/apis/management.cattle.io/v3/machine_types.go @@ -65,6 +65,16 @@ type Node struct { Status NodeStatus `json:"status"` } +type MetadataUpdate struct { + Labels MapDelta `json:"labels,omitempty"` + Annotations MapDelta `json:"annotations,omitempty"` +} + +type MapDelta struct { + Add map[string]string `json:"add,omitempty"` + Delete map[string]bool `json:"delete,omitempty"` +} + type NodeStatus struct { Conditions []NodeCondition `json:"conditions,omitempty"` InternalNodeStatus v1.NodeStatus `json:"internalNodeStatus,omitempty"` @@ -189,21 +199,18 @@ type NodeSpec struct { Worker bool `json:"worker" norman:"noupdate"` NodeTemplateName string `json:"nodeTemplateName,omitempty" norman:"type=reference[nodeTemplate],noupdate"` - NodePoolName string `json:"nodePoolName" norman:"type=reference[nodePool],nocreate,noupdate"` - CustomConfig *CustomConfig `json:"customConfig"` - Imported bool `json:"imported"` - Description string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - RequestedHostname string `json:"requestedHostname,omitempty" norman:"type=hostname,nullable,noupdate,required"` - InternalNodeSpec v1.NodeSpec `json:"internalNodeSpec"` - DesiredNodeTaints []v1.Taint `json:"desiredNodeTaints"` - DesiredNodeLabels map[string]string `json:"desiredNodeLabels,omitempty"` - DesiredNodeAnnotations map[string]string `json:"desiredNodeAnnotations,omitempty"` - UpdateTaintsFromAPI *bool `json:"updateTaintsFromAPI,omitempty"` - CurrentNodeLabels map[string]string `json:"currentNodeLabels,omitempty"` - CurrentNodeAnnotations map[string]string `json:"currentNodeAnnotations,omitempty"` - DesiredNodeUnschedulable string `json:"desiredNodeUnschedulable,omitempty"` - NodeDrainInput *NodeDrainInput `json:"nodeDrainInput,omitempty"` + NodePoolName string `json:"nodePoolName" norman:"type=reference[nodePool],nocreate,noupdate"` + CustomConfig *CustomConfig `json:"customConfig"` + Imported bool `json:"imported"` + Description string `json:"description,omitempty"` + DisplayName string `json:"displayName"` + RequestedHostname string `json:"requestedHostname,omitempty" norman:"type=hostname,nullable,noupdate,required"` + InternalNodeSpec v1.NodeSpec `json:"internalNodeSpec"` + DesiredNodeTaints []v1.Taint `json:"desiredNodeTaints"` + UpdateTaintsFromAPI *bool `json:"updateTaintsFromAPI,omitempty"` + DesiredNodeUnschedulable string `json:"desiredNodeUnschedulable,omitempty"` + NodeDrainInput *NodeDrainInput `json:"nodeDrainInput,omitempty"` + MetadataUpdate MetadataUpdate `json:"metadataUpdate,omitempty"` } type NodeCommonParams struct { diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index 2173df1b..34425e87 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -330,11 +330,8 @@ func nodeTypes(schemas *types.Schemas) *types.Schemas { &m.Move{From: "nodeLabels", To: "labels"}, &m.Move{From: "nodeAnnotations", To: "annotations"}, &m.Drop{Field: "desiredNodeTaints"}, - &m.Drop{Field: "desiredNodeLabels"}, - &m.Drop{Field: "desiredNodeAnnotations"}, + &m.Drop{Field: "metadataUpdate"}, &m.Drop{Field: "updateTaintsFromAPI"}, - &m.Drop{Field: "currentNodeLabels"}, - &m.Drop{Field: "currentNodeAnnotations"}, &m.Drop{Field: "desiredNodeUnschedulable"}, &m.Drop{Field: "nodeDrainInput"}, &m.AnnotationField{Field: "publicEndpoints", List: true},