Use this rule to control that the YAML documents do contain a required key. Parameters can be defined as a regular expression.
With parent-key-name = kind and parent-key-value = Pod and parent-key-name-root = yes and required-key-name = readinessProbe
the following code snippet would PASS:
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness-http
spec:
containers:
- name: liveness
image: k8s.gcr.io/liveness
args:
- /server
readinessProbe:
httpGet:
path: /healthz
port: 8080
httpHeaders:
- name: Custom-Header
value: Awesome
initialDelaySeconds: 3
periodSeconds: 3
the following code snippets would FAIL:
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness-http
spec:
containers:
- name: liveness
image: k8s.gcr.io/liveness
args:
- /server
initialDelaySeconds: 3
periodSeconds: 3