Skip to content

Commit

Permalink
Update helm templates for clusterId and oneClickDemoMode interplay
Browse files Browse the repository at this point in the history
  • Loading branch information
hjkatz committed Nov 12, 2024
1 parent cda68d5 commit f7b93b0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions helm/ngrok-operator/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ spec:
- /api-manager
args:
- --release-name={{ .Release.Name }}
{{- if .Values.oneClickDemoMode }}
- --cluster-id=one-click-demo-mode
{{- else }}
- --cluster-id={{ .Values.clusterId | required "Missing required .Values.clusterId!"}}
{{- end }}
{{- include "ngrok-operator.manager.cliFeatureFlags" . | nindent 8 }}
{{- if .Values.oneClickDemoMode }}
- --one-click-demo-mode
Expand Down
16 changes: 16 additions & 0 deletions helm/ngrok-operator/tests/controller-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,22 @@ tests:
- contains:
path: spec.template.spec.containers[0].args
content: --one-click-demo-mode
- it: Should pass cluster-id
template: controller-deployment.yaml
documentIndex: 0 # Document 0 is the deployment since its the first template
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: --cluster-id=test-cluster
- it: Should pass cluster-id as demo mode when enabled
template: controller-deployment.yaml
documentIndex: 0 # Document 0 is the deployment since its the first template
set:
oneClickDemoMode: true
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: --cluster-id=one-click-demo-mode
- it: Should pass log format argument if set
set:
log:
Expand Down

0 comments on commit f7b93b0

Please sign in to comment.