1
0
mirror of https://github.com/rancher/types.git synced 2025-09-26 12:42:59 +00:00

Add MetadataUpdates field

This commit is contained in:
Darren Shepherd
2019-09-14 16:13:12 -07:00
committed by Craig Jellick
parent 12df9be80e
commit cf57c648c1
2 changed files with 21 additions and 17 deletions

View File

@@ -62,6 +62,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"`
@@ -182,19 +192,16 @@ 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"`
DesiredNodeLabels map[string]string `json:"desiredNodeLabels,omitempty"`
DesiredNodeAnnotations map[string]string `json:"desiredNodeAnnotations,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"`
DesiredNodeUnschedulable string `json:"desiredNodeUnschedulable,omitempty"`
NodeDrainInput *NodeDrainInput `json:"nodeDrainInput,omitempty"`
MetadataUpdate MetadataUpdate `json:"metadataUpdate,omitempty"`
}
type NodeCommonParams struct {

View File

@@ -300,10 +300,7 @@ func nodeTypes(schemas *types.Schemas) *types.Schemas {
&m.Drop{Field: "annotations"},
&m.Move{From: "nodeLabels", To: "labels"},
&m.Move{From: "nodeAnnotations", To: "annotations"},
&m.Drop{Field: "desiredNodeLabels"},
&m.Drop{Field: "desiredNodeAnnotations"},
&m.Drop{Field: "currentNodeLabels"},
&m.Drop{Field: "currentNodeAnnotations"},
&m.Drop{Field: "metadataUpdate"},
&m.Drop{Field: "desiredNodeUnschedulable"},
&m.Drop{Field: "nodeDrainInput"},
&m.AnnotationField{Field: "publicEndpoints", List: true},