mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-03-02 18:10:20 +00:00
Support simulating helm test failure and timeout
This is to support testing of https://github.com/fluxcd/helm-operator/issues/369.
This commit is contained in:
@@ -42,6 +42,8 @@ Parameter | Default | Description
|
||||
`faults.error` | `false` | 1/3 chances of a random HTTP response error
|
||||
`faults.unhealthy` | `false` | When set, the healthy state is never reached
|
||||
`faults.unready` | `false` | When set, the ready state is never reached
|
||||
`faults.testFail` | `false` | When set, a helm test is included which always fails
|
||||
`faults.testTimeout` | `false` | When set, a helm test is included which always times out
|
||||
`h2c.enabled` | `false` | Allow upgrading to h2c
|
||||
`image.repository` | `stefanprodan/podinfo` | Image repository
|
||||
`image.tag` | `<VERSION>` | Image tag
|
||||
|
||||
26
charts/podinfo/templates/tests/fail.yaml
Normal file
26
charts/podinfo/templates/tests/fail.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
{{- if .Values.faults.test }}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: {{ template "podinfo.fullname" . }}-fault-test-{{ randAlphaNum 5 | lower }}
|
||||
labels:
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
app: {{ template "podinfo.name" . }}
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
|
||||
sidecar.istio.io/inject: "false"
|
||||
linkerd.io/inject: disabled
|
||||
appmesh.k8s.aws/sidecarInjectorWebhook: disabled
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: fault
|
||||
image: alpine:3.11
|
||||
command: ['/bin/sh']
|
||||
args: ['-c', 'exit 1']
|
||||
restartPolicy: Never
|
||||
{{- end }}
|
||||
26
charts/podinfo/templates/tests/timeout.yaml
Normal file
26
charts/podinfo/templates/tests/timeout.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
{{- if .Values.faults.test }}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: {{ template "podinfo.fullname" . }}-fault-test-{{ randAlphaNum 5 | lower }}
|
||||
labels:
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
app: {{ template "podinfo.name" . }}
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
|
||||
sidecar.istio.io/inject: "false"
|
||||
linkerd.io/inject: disabled
|
||||
appmesh.k8s.aws/sidecarInjectorWebhook: disabled
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: fault
|
||||
image: alpine:3.11
|
||||
command: ['/bin/sh']
|
||||
args: ['-c', 'while sleep 3600; do :; done']
|
||||
restartPolicy: Never
|
||||
{{- end }}
|
||||
@@ -15,6 +15,8 @@ faults:
|
||||
error: false
|
||||
unhealthy: false
|
||||
unready: false
|
||||
testFail: false
|
||||
testTimeout: false
|
||||
|
||||
h2c:
|
||||
enabled: false
|
||||
|
||||
Reference in New Issue
Block a user