Skip to content
Open
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
4 changes: 4 additions & 0 deletions charts/hdx-oss-v2/templates/hyperdx-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ spec:
- name: wait-for-mongodb
image: busybox
command: ['sh', '-c', 'until nc -z {{ include "hdx-oss.fullname" . }}-mongodb {{ .Values.mongodb.port }}; do echo waiting for mongodb; sleep 2; done;']
{{- if and (hasKey .Values.hyperdx "initContainer") (hasKey .Values.hyperdx.initContainer "resources") }}
resources:
{{- toYaml .Values.hyperdx.initContainer.resources | nindent 12}}
{{- end }}
{{- end }}
containers:
- name: app
Expand Down
49 changes: 48 additions & 1 deletion charts/hdx-oss-v2/tests/hyperdx-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,51 @@ tests:
value: private-registry-secret
- lengthEqual:
path: spec.template.spec.imagePullSecrets
count: 3
count: 3

- it: should include initContainers resources when configured and mongodb is enabled
set:
mongodb:
enabled: true
hyperdx:
initContainer:
resources:
limits:
cpu: 1
memory: 1Gi
requests:
cpu: 2
memory: 2Gi
asserts:
- isNotEmpty:
path: spec.template.spec.initContainers
- equal:
path: spec.template.spec.initContainers[0].name
value: wait-for-mongodb
- isNotEmpty:
path: spec.template.spec.initContainers[0].resources
- equal:
path: spec.template.spec.initContainers[0].resources.limits
content:
cpu: 1
memory: 1Gi
- equal:
path: spec.template.spec.initContainers[0].resources.requests
content:
cpu: 2
memory: 2Gi

- it: should not include initContainers resources when not configured and mongodb is enabled
set:
mongodb:
enabled: true
hyperdx:
initContainer:
asserts:
- isNotEmpty:
path: spec.template.spec.initContainers
- equal:
path: spec.template.spec.initContainers[0].name
value: wait-for-mongodb
- isEmpty:
path: spec.template.spec.initContainers[0].resources
Loading