feat(test): add example and rule to insert image pull policy
This commit is contained in:
parent
6da2eb54d2
commit
047673c6af
|
@ -0,0 +1,23 @@
|
||||||
|
name: kubernetes-fix
|
||||||
|
rules:
|
||||||
|
- name: kubernetes-container-pull-policy
|
||||||
|
desc: all containers should have a pull policy
|
||||||
|
level: info
|
||||||
|
tags:
|
||||||
|
- kubernetes
|
||||||
|
- image
|
||||||
|
- optional
|
||||||
|
|
||||||
|
select: '$..containers.*'
|
||||||
|
check:
|
||||||
|
type: object
|
||||||
|
required: [image, imagePullPolicy]
|
||||||
|
properties:
|
||||||
|
imagePullPolicy:
|
||||||
|
type: string
|
||||||
|
default: IfNotPresent
|
||||||
|
enum:
|
||||||
|
- Always
|
||||||
|
- IfNotPresent
|
||||||
|
- Never
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# test rules kubernetes
|
||||||
|
# test tags kubernetes
|
||||||
|
# test exit-status 1
|
||||||
|
|
||||||
|
metadata:
|
||||||
|
name: example
|
||||||
|
labels: {}
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: test
|
||||||
|
image: foo
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 4000m
|
||||||
|
memory: 5Gi
|
||||||
|
requests:
|
||||||
|
cpu: 4000m
|
||||||
|
memory: 5Gi
|
Loading…
Reference in New Issue