1
0
Fork 0

feat(test): add example and rule to insert image pull policy

This commit is contained in:
Sean Sube 2022-04-24 16:59:27 -05:00
parent 6da2eb54d2
commit 047673c6af
2 changed files with 43 additions and 0 deletions

23
rules/kubernetes-fix.yml Normal file
View File

@ -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

View File

@ -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