diff --git a/apis/management.cattle.io/v3/machine_types.go b/apis/management.cattle.io/v3/machine_types.go index 2edf1495..220953d7 100644 --- a/apis/management.cattle.io/v3/machine_types.go +++ b/apis/management.cattle.io/v3/machine_types.go @@ -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"` diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index 235b33f4..633914d2 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -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 {