mirror of
https://github.com/rancher/types.git
synced 2025-09-12 13:03:45 +00:00
DNS label as name type for workload proxy stores
Instead of putting it on the workload store itself DNS label is more restricive
This commit is contained in:
@@ -119,7 +119,7 @@ func workloadTypes(schemas *types.Schemas) *types.Schemas {
|
||||
"resume": {},
|
||||
}
|
||||
schema.MustCustomizeField("name", func(field types.Field) types.Field {
|
||||
field.Type = "dnsLabel"
|
||||
field.Type = "dnsLabelRestricted"
|
||||
field.Nullable = false
|
||||
field.Required = true
|
||||
return field
|
||||
@@ -173,6 +173,12 @@ func statefulSetTypes(schemas *types.Schemas) *types.Schemas {
|
||||
MustImport(&Version, v1beta2.StatefulSetSpec{}, statefulSetConfigOverride{}).
|
||||
MustImportAndCustomize(&Version, v1beta2.StatefulSet{}, func(schema *types.Schema) {
|
||||
schema.BaseType = "workload"
|
||||
schema.MustCustomizeField("name", func(field types.Field) types.Field {
|
||||
field.Type = "dnsLabelRestricted"
|
||||
field.Nullable = false
|
||||
field.Required = true
|
||||
return field
|
||||
})
|
||||
}, projectOverride{}, struct {
|
||||
PublicEndpoints string `json:"publicEndpoints" norman:"type=array[publicEndpoint],nocreate,noupdate"`
|
||||
}{})
|
||||
@@ -201,6 +207,12 @@ func replicaSetTypes(schemas *types.Schemas) *types.Schemas {
|
||||
MustImport(&Version, v1beta1.ReplicaSetSpec{}, replicaSetConfigOverride{}).
|
||||
MustImportAndCustomize(&Version, v1beta1.ReplicaSet{}, func(schema *types.Schema) {
|
||||
schema.BaseType = "workload"
|
||||
schema.MustCustomizeField("name", func(field types.Field) types.Field {
|
||||
field.Type = "dnsLabelRestricted"
|
||||
field.Nullable = false
|
||||
field.Required = true
|
||||
return field
|
||||
})
|
||||
}, projectOverride{}, struct {
|
||||
PublicEndpoints string `json:"publicEndpoints" norman:"type=array[publicEndpoint],nocreate,noupdate"`
|
||||
}{})
|
||||
@@ -231,6 +243,12 @@ func replicationControllerTypes(schemas *types.Schemas) *types.Schemas {
|
||||
schema.BaseType = "workload"
|
||||
schema.CollectionMethods = []string{http.MethodGet}
|
||||
schema.ResourceMethods = []string{http.MethodGet}
|
||||
schema.MustCustomizeField("name", func(field types.Field) types.Field {
|
||||
field.Type = "dnsLabelRestricted"
|
||||
field.Nullable = false
|
||||
field.Required = true
|
||||
return field
|
||||
})
|
||||
}, projectOverride{}, struct {
|
||||
PublicEndpoints string `json:"publicEndpoints" norman:"type=array[publicEndpoint],nocreate,noupdate"`
|
||||
}{})
|
||||
@@ -269,6 +287,12 @@ func daemonSetTypes(schemas *types.Schemas) *types.Schemas {
|
||||
MustImport(&Version, v1beta2.DaemonSetSpec{}, daemonSetOverride{}).
|
||||
MustImportAndCustomize(&Version, v1beta2.DaemonSet{}, func(schema *types.Schema) {
|
||||
schema.BaseType = "workload"
|
||||
schema.MustCustomizeField("name", func(field types.Field) types.Field {
|
||||
field.Type = "dnsLabelRestricted"
|
||||
field.Nullable = false
|
||||
field.Required = true
|
||||
return field
|
||||
})
|
||||
}, projectOverride{}, struct {
|
||||
PublicEndpoints string `json:"publicEndpoints" norman:"type=array[publicEndpoint],nocreate,noupdate"`
|
||||
}{})
|
||||
@@ -298,6 +322,12 @@ func jobTypes(schemas *types.Schemas) *types.Schemas {
|
||||
MustImport(&Version, batchv1.JobSpec{}, jobOverride{}).
|
||||
MustImportAndCustomize(&Version, batchv1.Job{}, func(schema *types.Schema) {
|
||||
schema.BaseType = "workload"
|
||||
schema.MustCustomizeField("name", func(field types.Field) types.Field {
|
||||
field.Type = "dnsLabelRestricted"
|
||||
field.Nullable = false
|
||||
field.Required = true
|
||||
return field
|
||||
})
|
||||
}, projectOverride{}, struct {
|
||||
PublicEndpoints string `json:"publicEndpoints" norman:"type=array[publicEndpoint],nocreate,noupdate"`
|
||||
}{})
|
||||
@@ -359,6 +389,12 @@ func cronJobTypes(schemas *types.Schemas) *types.Schemas {
|
||||
MustImport(&Version, batchv1beta1.JobTemplateSpec{}).
|
||||
MustImportAndCustomize(&Version, batchv1beta1.CronJob{}, func(schema *types.Schema) {
|
||||
schema.BaseType = "workload"
|
||||
schema.MustCustomizeField("name", func(field types.Field) types.Field {
|
||||
field.Type = "dnsLabelRestricted"
|
||||
field.Nullable = false
|
||||
field.Required = true
|
||||
return field
|
||||
})
|
||||
}, projectOverride{}, struct {
|
||||
PublicEndpoints string `json:"publicEndpoints" norman:"type=array[publicEndpoint],nocreate,noupdate"`
|
||||
}{})
|
||||
@@ -415,6 +451,12 @@ func deploymentTypes(schemas *types.Schemas) *types.Schemas {
|
||||
"pause": {},
|
||||
"resume": {},
|
||||
}
|
||||
schema.MustCustomizeField("name", func(field types.Field) types.Field {
|
||||
field.Type = "dnsLabelRestricted"
|
||||
field.Nullable = false
|
||||
field.Required = true
|
||||
return field
|
||||
})
|
||||
}, projectOverride{}, struct {
|
||||
PublicEndpoints string `json:"publicEndpoints" norman:"type=array[publicEndpoint],nocreate,noupdate"`
|
||||
}{})
|
||||
@@ -590,7 +632,7 @@ func addServiceOrDNSRecord(dns bool) types.SchemasInitFunc {
|
||||
return f
|
||||
})
|
||||
schema.MustCustomizeField("name", func(field types.Field) types.Field {
|
||||
field.Type = "dnsLabel"
|
||||
field.Type = "dnsLabelRestricted"
|
||||
field.Nullable = false
|
||||
field.Required = true
|
||||
return field
|
||||
|
Reference in New Issue
Block a user