Skip to content

Commit

Permalink
fix: mount the existing config map if provided (#79)
Browse files Browse the repository at this point in the history
Signed-off-by: arkbriar <[email protected]>
  • Loading branch information
arkbriar authored May 6, 2024
1 parent c51f478 commit d02a214
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/risingwave/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,11 @@ Create the etcd endpoints
Create the name of the AzureBlob credentials Secret to use
*/}}
{{- define "risingwave.configurationConfigMapName" -}}
{{- if not .Values.existingConfigMap }}
{{- printf "%s-configuration" (include "risingwave.fullname" .) | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- .Values.existingConfigMap | quote }}
{{- end }}
{{- end }}
{{/*
Expand Down
73 changes: 73 additions & 0 deletions charts/risingwave/tests/configmap_workload_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
suite: Test config map
templates:
- meta-sts.yaml
- compute-sts.yaml
- frontend-deploy.yaml
- compactor-deploy.yaml
- standalone/standalone-sts.yaml
chart:
appVersion: 1.0.0
version: 0.0.1
tests:
- it: cluster workloads mount the config map
templates:
- meta-sts.yaml
- compute-sts.yaml
- frontend-deploy.yaml
- compactor-deploy.yaml
set:
configuration: |
[example]
a = b
asserts:
- contains:
path: spec.template.spec.volumes
content:
name: config
configMap:
name: RELEASE-NAME-risingwave-configuration
- it: cluster workloads mount the existing config map
templates:
- meta-sts.yaml
- compute-sts.yaml
- frontend-deploy.yaml
- compactor-deploy.yaml
set:
existingConfigMap: "a"
asserts:
- contains:
path: spec.template.spec.volumes
content:
name: config
configMap:
name: a
- it: standalone sts mount the config map
templates:
- standalone/standalone-sts.yaml
set:
standalone:
enabled: true
configuration: |
[example]
a = b
asserts:
- contains:
path: spec.template.spec.volumes
content:
name: config
configMap:
name: RELEASE-NAME-risingwave-configuration
- it: standalone workloads mount the existing config map
templates:
- standalone/standalone-sts.yaml
set:
standalone:
enabled: true
existingConfigMap: "a"
asserts:
- contains:
path: spec.template.spec.volumes
content:
name: config
configMap:
name: a

0 comments on commit d02a214

Please sign in to comment.