1
0
mirror of https://github.com/rancher/types.git synced 2025-09-16 23:08:25 +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 e280b8a142
commit 828ddcd4b6
2 changed files with 23 additions and 19 deletions

View File

@@ -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 {

View File

@@ -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},