mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 21:09:30 +02:00
add maxLength constraint for CRD (#1175)
* add maxLength constraint for CRD
This commit is contained in:
@@ -107,12 +107,13 @@ var min0 = 0.0
|
||||
var min1 = 1.0
|
||||
var min2 = 2.0
|
||||
var minDisable = -1.0
|
||||
var maxLength = int64(53)
|
||||
|
||||
// PostgresCRDResourceValidation to check applied manifest parameters
|
||||
var PostgresCRDResourceValidation = apiextv1beta1.CustomResourceValidation{
|
||||
OpenAPIV3Schema: &apiextv1beta1.JSONSchemaProps{
|
||||
Type: "object",
|
||||
Required: []string{"kind", "apiVersion", "spec"},
|
||||
Required: []string{"kind", "apiVersion", "metadata", "spec"},
|
||||
Properties: map[string]apiextv1beta1.JSONSchemaProps{
|
||||
"kind": {
|
||||
Type: "string",
|
||||
@@ -130,6 +131,16 @@ var PostgresCRDResourceValidation = apiextv1beta1.CustomResourceValidation{
|
||||
},
|
||||
},
|
||||
},
|
||||
"metadata": {
|
||||
Type: "object",
|
||||
Required: []string{"name"},
|
||||
Properties: map[string]apiextv1beta1.JSONSchemaProps{
|
||||
"name": {
|
||||
Type: "string",
|
||||
MaxLength: &maxLength,
|
||||
},
|
||||
},
|
||||
},
|
||||
"spec": {
|
||||
Type: "object",
|
||||
Required: []string{"numberOfInstances", "teamId", "postgresql", "volume"},
|
||||
|
||||
Reference in New Issue
Block a user