1
0
mirror of https://github.com/rancher/types.git synced 2025-09-18 16:10:58 +00:00

Add computed clusterId field to node

This commit is contained in:
Darren Shepherd
2018-04-21 21:50:36 -07:00
parent 6e79f33557
commit 87abc9601e

View File

@@ -215,6 +215,7 @@ func nodeTypes(schemas *types.Schemas) *types.Schemas {
&m.Drop{Field: "desiredNodeLabels"},
&m.Drop{Field: "desiredNodeAnnotations"},
&m.AnnotationField{Field: "publicEndpoints", List: true},
m.Copy{From: "namespaceId", To: "clusterName"},
m.DisplayName{}).
AddMapperForType(&Version, v3.NodeDriver{}, m.DisplayName{}).
AddMapperForType(&Version, v3.NodeTemplate{}, m.DisplayName{}).
@@ -225,7 +226,9 @@ func nodeTypes(schemas *types.Schemas) *types.Schemas {
labelField.Create = true
labelField.Update = true
schema.ResourceFields["labels"] = labelField
clusterField := schema.ResourceFields["clusterId"]
clusterField.Type = "reference[cluster]"
schema.ResourceFields["clusterId"] = clusterField
}, struct {
PublicEndpoints string `json:"publicEndpoints" norman:"type=array[publicEndpoint],nocreate,noupdate"`
}{}).