Skip to content

Commit 521b5a1

Browse files
jjh5887teeohhem
andauthored
Parameterize hyperdx-deployment initContainer image and pullPolicy (#133)
Update the chart template to make the wait-for-mongodb initContainer image and pullPolicy configurable via values. Co-authored-by: Tom Alexander <[email protected]>
1 parent f392123 commit 521b5a1

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

.changeset/slow-dolls-search.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"helm-charts": patch
3+
---
4+
5+
refactor: Parameterize hyperdx-deployment initContainer image and pullPolicy

charts/hdx-oss-v2/templates/hyperdx-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ spec:
5050
{{- if .Values.mongodb.enabled }}
5151
initContainers:
5252
- name: wait-for-mongodb
53-
image: "busybox@sha256:1fcf5df59121b92d61e066df1788e8df0cc35623f5d62d9679a41e163b6a0cdb"
54-
imagePullPolicy: IfNotPresent
53+
image: {{ .Values.hyperdx.waitForMongodb.image }}
54+
imagePullPolicy: {{ .Values.hyperdx.waitForMongodb.pullPolicy }}
5555
command: ['sh', '-c', 'until nc -z {{ include "hdx-oss.fullname" . }}-mongodb {{ .Values.mongodb.port }}; do echo waiting for mongodb; sleep 2; done;']
5656
{{- end }}
5757
containers:

charts/hdx-oss-v2/tests/hyperdx-deployment_test.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ tests:
120120
- equal:
121121
path: spec.template.spec.initContainers[0].image
122122
value: busybox@sha256:1fcf5df59121b92d61e066df1788e8df0cc35623f5d62d9679a41e163b6a0cdb
123+
- equal:
124+
path: spec.template.spec.initContainers[0].imagePullPolicy
125+
value: IfNotPresent
123126
- contains:
124127
path: spec.template.spec.initContainers[0].command
125128
content: sh
@@ -130,6 +133,22 @@ tests:
130133
path: spec.template.spec.initContainers[0].command[2]
131134
pattern: "until nc -z .+-mongodb [0-9]+; do echo waiting for mongodb; sleep 2; done;"
132135

136+
- it: should allow overriding initContainer image and pullPolicy
137+
set:
138+
mongodb:
139+
enabled: true
140+
hyperdx:
141+
waitForMongodb:
142+
image: busybox:1.36.1
143+
pullPolicy: Always
144+
asserts:
145+
- equal:
146+
path: spec.template.spec.initContainers[0].image
147+
value: busybox:1.36.1
148+
- equal:
149+
path: spec.template.spec.initContainers[0].imagePullPolicy
150+
value: Always
151+
133152
- it: should include livenessProbe with default values when enabled
134153
asserts:
135154
- isSubset:
@@ -269,4 +288,4 @@ tests:
269288
value: private-registry-secret
270289
- lengthEqual:
271290
path: spec.template.spec.imagePullSecrets
272-
count: 3
291+
count: 3

charts/hdx-oss-v2/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ hyperdx:
1616
repository: docker.hyperdx.io/hyperdx/hyperdx
1717
tag:
1818
pullPolicy: IfNotPresent
19+
waitForMongodb:
20+
# Image used by the init container that waits for MongoDB to be reachable.
21+
image: "busybox@sha256:1fcf5df59121b92d61e066df1788e8df0cc35623f5d62d9679a41e163b6a0cdb"
22+
pullPolicy: IfNotPresent
1923
livenessProbe:
2024
enabled: true
2125
initialDelaySeconds: 10

0 commit comments

Comments
 (0)