Skip to content

Commit

Permalink
Use tpl to render the persistence secret (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit-K authored Jan 3, 2025
1 parent 5064107 commit 0f5850c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion helm/polaris/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ spec:
emptyDir: {}
- name: secret-volume
secret:
secretName: {{ .Values.persistenceConfigSecret }}
secretName: {{ tpl .Values.persistenceConfigSecret . }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
Expand Down
2 changes: 1 addition & 1 deletion helm/polaris/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ spec:
emptyDir: {}
- name: secret-volume
secret:
secretName: {{ .Values.persistenceConfigSecret }}
secretName: {{ tpl .Values.persistenceConfigSecret . }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
Expand Down
13 changes: 13 additions & 0 deletions helm/polaris/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,19 @@ tests:
content:
name: eclipselink-config-volume
mountPath: /eclipselink-config
- it: should evaluate template expressions in persistence secret name
set:
persistenceConfigSecret: '{{ .Release.Name }}-persistence-secret'
polarisServerConfig:
metaStoreManager:
conf-file: /eclipselink-config/conf.jar!/persistence.xml
asserts:
- contains:
path: spec.template.spec.volumes
content:
name: secret-volume
secret:
secretName: polaris-release-persistence-secret

# spec.template.spec.containers[0].ports
- it: should set container ports by default
Expand Down
14 changes: 14 additions & 0 deletions helm/polaris/tests/job_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,20 @@ tests:
content:
name: eclipselink-config-volume
mountPath: /eclipselink-config
- it: should evaluate template expressions in persistence secret name
set:
bootstrapMetastoreManager: true
persistenceConfigSecret: '{{ .Release.Name }}-persistence-secret'
polarisServerConfig:
metaStoreManager:
conf-file: /eclipselink-config/conf.jar!/persistence.xml
asserts:
- contains:
path: spec.template.spec.volumes
content:
name: secret-volume
secret:
secretName: polaris-release-persistence-secret

# spec.template.spec.containers[0].resources (with bootstrapMetastoreManager enabled)
- it: should not set container resources by default
Expand Down

0 comments on commit 0f5850c

Please sign in to comment.