Skip to content

Commit f7b93b0

Browse files
author
Harrison Katz
committed
Update helm templates for clusterId and oneClickDemoMode interplay
1 parent cda68d5 commit f7b93b0

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

helm/ngrok-operator/templates/controller-deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ spec:
6262
- /api-manager
6363
args:
6464
- --release-name={{ .Release.Name }}
65+
{{- if .Values.oneClickDemoMode }}
66+
- --cluster-id=one-click-demo-mode
67+
{{- else }}
6568
- --cluster-id={{ .Values.clusterId | required "Missing required .Values.clusterId!"}}
69+
{{- end }}
6670
{{- include "ngrok-operator.manager.cliFeatureFlags" . | nindent 8 }}
6771
{{- if .Values.oneClickDemoMode }}
6872
- --one-click-demo-mode

helm/ngrok-operator/tests/controller-deployment_test.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,22 @@ tests:
246246
- contains:
247247
path: spec.template.spec.containers[0].args
248248
content: --one-click-demo-mode
249+
- it: Should pass cluster-id
250+
template: controller-deployment.yaml
251+
documentIndex: 0 # Document 0 is the deployment since its the first template
252+
asserts:
253+
- contains:
254+
path: spec.template.spec.containers[0].args
255+
content: --cluster-id=test-cluster
256+
- it: Should pass cluster-id as demo mode when enabled
257+
template: controller-deployment.yaml
258+
documentIndex: 0 # Document 0 is the deployment since its the first template
259+
set:
260+
oneClickDemoMode: true
261+
asserts:
262+
- contains:
263+
path: spec.template.spec.containers[0].args
264+
content: --cluster-id=one-click-demo-mode
249265
- it: Should pass log format argument if set
250266
set:
251267
log:

0 commit comments

Comments
 (0)