mirror of
https://github.com/rancher/types.git
synced 2025-08-02 05:11:59 +00:00
Use 'dnsLabel' for Cluster name and machine requestedHostname
This commit is contained in:
parent
585d041598
commit
3afcf51cc0
@ -121,7 +121,7 @@ type MachineSpec struct {
|
||||
CustomConfig *CustomConfig `json:"customConfig"`
|
||||
Description string `json:"description,omitempty"`
|
||||
DisplayName string `json:"displayName"`
|
||||
RequestedHostname string `json:"requestedHostname,omitempty" norman:"noupdate"`
|
||||
RequestedHostname string `json:"requestedHostname,omitempty" norman:"type=dnsLabel,nullable,noupdate"`
|
||||
ClusterName string `json:"clusterName,omitempty" norman:"type=reference[cluster],noupdate,required"`
|
||||
Role []string `json:"role,omitempty" norman:"noupdate,type=array[enum],options=etcd|worker|controlplane"`
|
||||
MachineTemplateName string `json:"machineTemplateName,omitempty" norman:"type=reference[machineTemplate],noupdate"`
|
||||
|
@ -67,7 +67,15 @@ func clusterTypes(schemas *types.Schemas) *types.Schemas {
|
||||
schema.SubContext = "clusters"
|
||||
}).
|
||||
MustImport(&Version, v3.ClusterEvent{}).
|
||||
MustImport(&Version, v3.ClusterRegistrationToken{})
|
||||
MustImport(&Version, v3.ClusterRegistrationToken{}).
|
||||
MustImportAndCustomize(&Version, v3.Cluster{}, func(schema *types.Schema) {
|
||||
schema.MustCustomizeField("name", func(field types.Field) types.Field {
|
||||
field.Type = "dnsLabel"
|
||||
field.Nullable = true
|
||||
field.Required = false
|
||||
return field
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
func authzTypes(schemas *types.Schemas) *types.Schemas {
|
||||
@ -185,6 +193,7 @@ func machineTypes(schemas *types.Schemas) *types.Schemas {
|
||||
}
|
||||
}).
|
||||
MustImport(&Version, v3.MachineTemplate{})
|
||||
|
||||
}
|
||||
|
||||
func authnTypes(schemas *types.Schemas) *types.Schemas {
|
||||
|
Loading…
Reference in New Issue
Block a user