Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/chart/event-handler/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
{{- end }}
labels:
{{- include "event-handler.labels" . | nindent 4 }}
{{- with .Values.extraLabels.config }}
{{- toYaml . | nindent 4 }}
{{- end }}
data:
teleport-event-handler.toml: |
storage = {{ .Values.eventHandler.storagePath | toJson }}
Expand Down
21 changes: 17 additions & 4 deletions examples/chart/event-handler/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
{{- end }}
labels:
{{- include "event-handler.labels" . | nindent 4 }}
{{- with .Values.extraLabels.deployment }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: 1
{{- if or .Values.persistentVolumeClaim.enabled .Values.persistentVolumeClaim.existingClaim }}
Expand All @@ -25,6 +28,9 @@ spec:
{{- end }}
labels:
{{- include "event-handler.labels" . | nindent 8 }}
{{- with .Values.extraLabels.pod }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -40,16 +46,23 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- /usr/local/bin/teleport-plugin
args:
- start
- "--config"
- "/etc/teleport-event-handler.toml"
{{- with .Values.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: "TELEPORT_PLUGIN_FAIL_FAST"
value: "true"
{{- if .Values.tls.existingCASecretName }}
{{- if .Values.tls.existingCASecretName }}
- name: SSL_CERT_FILE
value: /etc/teleport-tls-ca/ca.pem
{{- end }}
{{- end }}
{{- with .Values.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 80
Expand All @@ -71,11 +84,11 @@ spec:
- name: certificate
mountPath: /var/lib/teleport/plugins/event-handler/client.key
subPath: {{ .Values.fluentd.certificate.keyPath }}
{{- if .Values.tls.existingCASecretName }}
{{- if .Values.tls.existingCASecretName }}
- mountPath: /etc/teleport-tls-ca
name: "teleport-tls-ca"
readOnly: true
{{- end }}
{{- end }}
{{- if or .Values.persistentVolumeClaim.enabled .Values.persistentVolumeClaim.existingClaim }}
- name: "{{ .Values.persistentVolumeClaim.volumeName }}"
mountPath: "{{ .Values.eventHandler.storagePath }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ should match the snapshot:
helm.sh/chart: teleport-plugin-event-handler-18.5.1
spec:
containers:
- command:
- /usr/local/bin/teleport-plugin
- args:
- start
- --config
- /etc/teleport-event-handler.toml
command:
- /usr/local/bin/teleport-plugin
env:
- name: TELEPORT_PLUGIN_FAIL_FAST
value: "true"
Expand Down Expand Up @@ -75,11 +76,12 @@ should match the snapshot:
should mount tls.existingCASecretName and set environment when set in values:
1: |
containers:
- command:
- /usr/local/bin/teleport-plugin
- args:
- start
- --config
- /etc/teleport-event-handler.toml
command:
- /usr/local/bin/teleport-plugin
env:
- name: TELEPORT_PLUGIN_FAIL_FAST
value: "true"
Expand Down
12 changes: 10 additions & 2 deletions examples/chart/event-handler/tests/configmap_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ tests:
keyPath: myclient.key
asserts:
- matchSnapshot: {}

- it: should not contain annotations when not defined
asserts:
- isNull:
path: metadata.annotations

- it: should contain annotations when defined
set:
annotations:
Expand All @@ -34,3 +32,13 @@ tests:
value:
keyA: valA
keyB: valB
- it: sets extraLabels when set in values
set:
extraLabels:
config:
test-key: test-label-config
asserts:
- isSubset:
path: metadata.labels
content:
test-key: test-label-config
41 changes: 35 additions & 6 deletions examples/chart/event-handler/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ tests:
tag: v98.76.54
asserts:
- matchSnapshot: {}

- it: uses the recreate strategy if a PV is mounted
set:
persistentVolumeClaim:
Expand All @@ -18,7 +17,6 @@ tests:
- equal:
path: spec.strategy.type
value: Recreate

- it: should mount tls.existingCASecretName and set environment when set in values
template: deployment.yaml
values:
Expand All @@ -43,14 +41,12 @@ tests:
value: /etc/teleport-tls-ca/ca.pem
- matchSnapshot:
path: spec.template.spec

- it: should not contain deployment or pod annotations when not defined
asserts:
- isNull:
path: metadata.annotations
- isNull:
path: spec.template.metadata.annotations

- it: should contain deployment annotations when defined
set:
annotations:
Expand All @@ -65,7 +61,6 @@ tests:
keyB: valB
- isNull:
path: spec.template.metadata.annotations

- it: should contain pod annotations when defined
set:
annotations:
Expand All @@ -80,7 +75,6 @@ tests:
keyB: valB
- isNull:
path: metadata.annotations

- it: should contain both annotations when defined
set:
annotations:
Expand All @@ -101,3 +95,38 @@ tests:
value:
keyA: valA'
keyC: valC
- it: sets extraLabels when set in values
set:
extraLabels:
deployment:
test-key: test-label-deployment
pod:
test-key: test-label-pod
asserts:
- isSubset:
path: metadata.labels
content:
test-key: test-label-deployment
- isSubset:
path: spec.template.metadata.labels
content:
test-key: test-label-pod
- it: sets extraArgs when set in values
set:
extraArgs:
- --extra-arg
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: --extra-arg
- it: sets extraEnv when set in values
set:
extraEnv:
- name: TEST_ENV
value: test-value
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: TEST_ENV
value: test-value
33 changes: 33 additions & 0 deletions examples/chart/event-handler/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"annotations",
"tolerations",
"affinity",
"extraArgs",
"extraEnv",
"teleport",
"fluentd"
],
Expand Down Expand Up @@ -132,6 +134,16 @@
},
"additionalProperties": true
},
"extraArgs": {
"$id": "#/properties/extraArgs",
"type": "array",
"default": []
},
"extraEnv": {
"$id": "#/properties/extraEnv",
"type": "array",
"default": []
},
"resources": {
"$id": "#/properties/resources",
"type": "object",
Expand Down Expand Up @@ -252,6 +264,27 @@
}
}
},
"extraLabels": {
"$id": "#/properties/extraLabels",
"type": "object",
"properties": {
"config": {
"$id": "#/properties/extraLabels/properties/config",
"type": "object",
"default": {}
},
"deployment": {
"$id": "#/properties/extraLabels/properties/deployment",
"type": "object",
"default": {}
},
"pod": {
"$id": "#/properties/extraLabels/properties/pod",
"type": "object",
"default": {}
}
}
},
"tls": {
"$id": "#/properties/tls",
"type": "object",
Expand Down
Loading
Loading