1
0
mirror of https://github.com/rancher/types.git synced 2025-07-10 12:03:04 +00:00

Make cluster name generated

This commit is contained in:
Darren Shepherd 2018-01-12 15:02:18 -07:00
parent fff1769c30
commit eb54542307
2 changed files with 4 additions and 0 deletions

View File

@ -43,6 +43,7 @@ type Cluster struct {
type ClusterSpec struct {
Nodes []MachineConfig `json:"nodes"`
DisplayName string `json:"displayName"`
Description string `json:"description"`
Internal bool `json:"internal" norman:"nocreate,noupdate"`
GoogleKubernetesEngineConfig *GoogleKubernetesEngineConfig `json:"googleKubernetesEngineConfig,omitempty"`

View File

@ -50,6 +50,7 @@ func clusterTypes(schemas *types.Schemas) *types.Schemas {
return schemas.
AddMapperForType(&Version, v3.Cluster{},
&m.Embed{Field: "status"},
m.DisplayName{},
).
AddMapperForType(&Version, v3.ClusterStatus{},
m.Drop{Field: "appliedSpec"},
@ -162,6 +163,8 @@ func machineTypes(schemas *types.Schemas) *types.Schemas {
&m.Drop{Field: "machineDriverConfig"},
&m.Embed{Field: "nodeStatus"},
&m.SliceMerge{From: []string{"conditions", "nodeConditions"}, To: "conditions"}).
AddMapperForType(&Version, v3.MachineConfig{},
&m.Drop{Field: "clusterName"}).
AddMapperForType(&Version, v3.Machine{},
&m.Embed{Field: "status"},
m.DisplayName{}).