Skip to content

Commit fddc374

Browse files
authored
feat: support 'enabled' flag for mongodb service (#25)
1 parent 4274b01 commit fddc374

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.mongodb.enabled }}
12
apiVersion: apps/v1
23
kind: Deployment
34
metadata:
@@ -42,4 +43,5 @@ spec:
4243
targetPort: {{ .Values.mongodb.port }}
4344
selector:
4445
{{- include "hdx-oss.selectorLabels" . | nindent 4 }}
45-
app: mongodb
46+
app: mongodb
47+
{{- end }}

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ suite: Test MongoDB Deployment
22
templates:
33
- mongodb-deployment.yaml
44
tests:
5-
- it: should render both deployment and service
5+
- it: should render both deployment and service when enabled
66
set:
77
mongodb:
88
image: mongo:5.0.14-focal
99
port: 27017
10+
enabled: true
1011
asserts:
1112
- hasDocuments:
1213
count: 2
@@ -15,4 +16,12 @@ tests:
1516
of: Deployment
1617
- documentIndex: 1
1718
isKind:
18-
of: Service
19+
of: Service
20+
21+
- it: should not render any documents when disabled
22+
set:
23+
mongodb:
24+
enabled: false
25+
asserts:
26+
- hasDocuments:
27+
count: 0

charts/hdx-oss-v2/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ hyperdx:
156156
mongodb:
157157
image: "mongo:5.0.14-focal"
158158
port: 27017
159+
enabled: true
159160

160161
clickhouse:
161162
image: "clickhouse/clickhouse-server:24-alpine"

0 commit comments

Comments
 (0)