rules(kubernetes): allow numeric resources, validate string resources more thoroughly
This commit is contained in:
parent
dcb211c382
commit
4604a1da62
|
@ -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"
|
Loading…
Reference in New Issue