1
0
Fork 0

rules(kubernetes): allow numeric resources, validate string resources more thoroughly

This commit is contained in:
ssube 2019-06-15 20:53:20 -05:00
parent dcb211c382
commit 4604a1da62
1 changed files with 13 additions and 9 deletions

View File

@ -23,18 +23,22 @@ rules:
type: object
required: [cpu, memory]
properties:
cpu:
type: string
memory:
type: string
cpu: &resources-cpu
oneOf:
- type: number
- type: string
pattern: "[1-9][0-9]*m"
memory: &resources-memory
oneOf:
- type: number
- type: string
pattern: "[1-9][0-9]*[KMG]i"
requests:
type: object
required: [cpu, memory]
properties:
cpu:
type: string
memory:
type: string
cpu: *resources-cpu
memory: *resources-memory
- name: kubernetes-resources-minimum-cpu
desc: resource limits are too low
@ -61,4 +65,4 @@ rules:
properties:
cpu:
type: string
pattern: "[0-9]{3}m"
pattern: "[0-9]{3}m"