Skip to content

Commit 0628439

Browse files
FxKusdudoladov
authored andcommitted
fix cpu resource validation (zalando#757)
1 parent 107334f commit 0628439

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

charts/postgres-operator/crds/postgresqls.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ spec:
222222
# only the format of the given number.
223223
#
224224
# https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu
225-
pattern: '^(\d+m|\d+\.\d{1,3})$'
225+
pattern: '^(\d+m|\d+(\.\d{1,3})?)$'
226226
# Note: the value specified here must not be zero or be lower
227227
# than the corresponding request.
228228
memory:
@@ -253,7 +253,7 @@ spec:
253253
# only the format of the given number.
254254
#
255255
# https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu
256-
pattern: '^(\d+m|\d+\.\d{1,3})$'
256+
pattern: '^(\d+m|\d+(\.\d{1,3})?)$'
257257
# Note: the value specified here must not be zero or be higher
258258
# than the corresponding limit.
259259
memory:

manifests/postgresql.crd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ spec:
186186
# only the format of the given number.
187187
#
188188
# https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu
189-
pattern: '^(\d+m|\d+\.\d{1,3})$'
189+
pattern: '^(\d+m|\d+(\.\d{1,3})?)$'
190190
# Note: the value specified here must not be zero or be lower
191191
# than the corresponding request.
192192
memory:
@@ -217,7 +217,7 @@ spec:
217217
# only the format of the given number.
218218
#
219219
# https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu
220-
pattern: '^(\d+m|\d+\.\d{1,3})$'
220+
pattern: '^(\d+m|\d+(\.\d{1,3})?)$'
221221
# Note: the value specified here must not be zero or be higher
222222
# than the corresponding limit.
223223
memory:

pkg/apis/acid.zalan.do/v1/crds.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ var PostgresCRDResourceValidation = apiextv1beta1.CustomResourceValidation{
356356
"cpu": {
357357
Type: "string",
358358
Description: "Decimal natural followed by m, or decimal natural followed by dot followed by up to three decimal digits (precision used by Kubernetes). Must be greater than 0",
359-
Pattern: "^(\\d+m|\\d+\\.\\d{1,3})$",
359+
Pattern: "^(\\d+m|\\d+(\\.\\d{1,3})?)$",
360360
},
361361
"memory": {
362362
Type: "string",
@@ -372,7 +372,7 @@ var PostgresCRDResourceValidation = apiextv1beta1.CustomResourceValidation{
372372
"cpu": {
373373
Type: "string",
374374
Description: "Decimal natural followed by m, or decimal natural followed by dot followed by up to three decimal digits (precision used by Kubernetes). Must be greater than 0",
375-
Pattern: "^(\\d+m|\\d+\\.\\d{1,3})$",
375+
Pattern: "^(\\d+m|\\d+(\\.\\d{1,3})?)$",
376376
},
377377
"memory": {
378378
Type: "string",

0 commit comments

Comments
 (0)