fix(rules): ensure low CPU limits are non-0
This commit is contained in:
parent
13159057d5
commit
97d5c7aac6
|
@ -7,7 +7,6 @@ rules:
|
|||
- playbook
|
||||
|
||||
select: '$'
|
||||
|
||||
check:
|
||||
type: array
|
||||
items:
|
||||
|
@ -39,7 +38,6 @@ rules:
|
|||
- role
|
||||
|
||||
select: '$'
|
||||
|
||||
check:
|
||||
type: array
|
||||
items:
|
||||
|
|
|
@ -48,8 +48,7 @@ rules:
|
|||
- optional
|
||||
|
||||
select: '$.spec.template.spec.containers[*].resources'
|
||||
|
||||
# filter low-cpu resource limits
|
||||
# filter containers with cpu limits
|
||||
filter:
|
||||
type: object
|
||||
properties:
|
||||
|
@ -58,7 +57,7 @@ rules:
|
|||
properties:
|
||||
cpu:
|
||||
type: string
|
||||
pattern: "[0-9]{1,3}m"
|
||||
pattern: "[0-9]+m"
|
||||
|
||||
# ensure the limits aren't *too* low
|
||||
check:
|
||||
|
@ -69,7 +68,7 @@ rules:
|
|||
properties:
|
||||
cpu:
|
||||
type: string
|
||||
pattern: "[0-9]{3}m"
|
||||
pattern: "[1-9][0-9]{2,}m"
|
||||
|
||||
- name: kubernetes-deployment-replicas
|
||||
desc: deployments must specify a positive replica count
|
||||
|
|
Loading…
Reference in New Issue