diff --git a/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml index eb6e5ce58..ad45f0e70 100644 --- a/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml @@ -89,7 +89,7 @@ spec: # 4. Using AWS itself. # AWS uses bucketname.endpoint/object while others use endpoint/bucketname/object - name: ASSETS_ORIGIN - value: "{{ include "openreplay.s3Endpoint" . }}/{{.Values.global.s3.assetsBucket}}" + value: "{{ include "openreplay.assets_origin" . }}" {{- include "openreplay.env.redis_string" .Values.global.redis | nindent 12 }} ports: {{- range $key, $val := .Values.service.ports }} diff --git a/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml index dc28ed493..c9825fc9a 100644 --- a/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml @@ -65,7 +65,7 @@ spec: # 4. Using AWS itself. # AWS uses bucketname.endpoint/object while others use endpoint/bucketname/object - name: ASSETS_ORIGIN - value: "{{ include "openreplay.s3Endpoint" . }}/{{.Values.global.s3.assetsBucket}}" + value: {{ include "openreplay.assets_origin" . }} {{- include "openreplay.env.redis_string" .Values.global.redis | nindent 12 }} ports: {{- range $key, $val := .Values.service.ports }} diff --git a/scripts/helmcharts/openreplay/charts/sourcemapreader/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/sourcemapreader/templates/deployment.yaml index 76c3f7ba7..52a0c2854 100644 --- a/scripts/helmcharts/openreplay/charts/sourcemapreader/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/sourcemapreader/templates/deployment.yaml @@ -76,7 +76,7 @@ spec: # 4. Using AWS itself. # AWS uses bucketname.endpoint/object while others use endpoint/bucketname/object - name: ASSETS_ORIGIN - value: "{{ include "openreplay.s3Endpoint" . }}/{{.Values.global.s3.assetsBucket}}" + value: {{ include "openreplay.assets_origin" . }} ports: {{- range $key, $val := .Values.service.ports }} - name: {{ $key }} diff --git a/scripts/helmcharts/openreplay/templates/_helpers.tpl b/scripts/helmcharts/openreplay/templates/_helpers.tpl index 805ab62f5..be8ef934e 100644 --- a/scripts/helmcharts/openreplay/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/templates/_helpers.tpl @@ -142,3 +142,11 @@ Create the volume mount config for redis TLS certificates subPath: {{ .tls.certCAFilename }} {{- end }} {{- end }} + +{{- define "openreplay.assets_origin"}} +{{- if .Values.global.assetsOrigin }} +{{- .Values.global.assetsOrigin }} +{{- else }} +{{- include "openreplay.s3Endpoint" . }}/{{.Values.global.s3.assetsBucket}} +{{- end }} +{{- end }}