From 3f73bae22f1b33cfd3bf5c1b577899bedbeaebee Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Fri, 4 Apr 2025 23:37:59 +0200 Subject: [PATCH] fix(helm): proper aws endpoint detection Signed-off-by: rjshrjndrn --- .../openreplay/charts/assets/templates/deployment.yaml | 2 +- .../openreplay/charts/canvases/templates/deployment.yaml | 2 +- .../openreplay/charts/connector/templates/deployment.yaml | 2 +- .../openreplay/charts/images/templates/deployment.yaml | 2 +- .../openreplay/charts/storage/templates/deployment.yaml | 2 +- scripts/helmcharts/openreplay/templates/_helpers.tpl | 7 +++++-- scripts/helmcharts/openreplay/templates/job.yaml | 2 +- 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml index ad45f0e70..825228e88 100644 --- a/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml @@ -74,7 +74,7 @@ spec: - name: LICENSE_KEY value: '{{ .Values.global.enterpriseEditionLicense }}' - name: AWS_ENDPOINT - value: '{{ .Values.global.s3.endpoint }}' + value: '{{- include "openreplay.s3Endpoint" . }}' - name: AWS_REGION value: '{{ .Values.global.s3.region }}' - name: KAFKA_SERVERS diff --git a/scripts/helmcharts/openreplay/charts/canvases/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/canvases/templates/deployment.yaml index 428d58897..f160e50a9 100644 --- a/scripts/helmcharts/openreplay/charts/canvases/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/canvases/templates/deployment.yaml @@ -62,7 +62,7 @@ spec: value: {{ .Values.global.s3.secretKey }} {{- end }} - name: AWS_ENDPOINT - value: '{{ .Values.global.s3.endpoint }}' + value: '{{- include "openreplay.s3Endpoint" . }}' - name: AWS_REGION value: '{{ .Values.global.s3.region }}' - name: BUCKET_NAME diff --git a/scripts/helmcharts/openreplay/charts/connector/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/connector/templates/deployment.yaml index d46405502..065ce1f09 100644 --- a/scripts/helmcharts/openreplay/charts/connector/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/connector/templates/deployment.yaml @@ -83,7 +83,7 @@ spec: value: {{ .Values.global.s3.secretKey }} {{- end }} - name: AWS_ENDPOINT - value: '{{ .Values.global.s3.endpoint }}' + value: '{{- include "openreplay.s3Endpoint" . }}' - name: AWS_REGION value: '{{ .Values.global.s3.region }}' {{- include "openreplay.env.redis_string" .Values.global.redis | nindent 12 }} diff --git a/scripts/helmcharts/openreplay/charts/images/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/images/templates/deployment.yaml index 2a93d495d..38f4f24c4 100644 --- a/scripts/helmcharts/openreplay/charts/images/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/images/templates/deployment.yaml @@ -62,7 +62,7 @@ spec: value: {{ .Values.global.s3.secretKey }} {{- end }} - name: AWS_ENDPOINT - value: '{{ .Values.global.s3.endpoint }}' + value: '{{- include "openreplay.s3Endpoint" . }}' - name: AWS_REGION value: '{{ .Values.global.s3.region }}' - name: BUCKET_NAME diff --git a/scripts/helmcharts/openreplay/charts/storage/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/storage/templates/deployment.yaml index bc5ea5a9c..8868c77fb 100644 --- a/scripts/helmcharts/openreplay/charts/storage/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/storage/templates/deployment.yaml @@ -62,7 +62,7 @@ spec: value: {{ .Values.global.s3.secretKey }} {{- end }} - name: AWS_ENDPOINT - value: '{{ .Values.global.s3.endpoint }}' + value: '{{- include "openreplay.s3Endpoint" . }}' - name: AWS_REGION value: '{{ .Values.global.s3.region }}' - name: BUCKET_NAME diff --git a/scripts/helmcharts/openreplay/templates/_helpers.tpl b/scripts/helmcharts/openreplay/templates/_helpers.tpl index be8ef934e..de12340a9 100644 --- a/scripts/helmcharts/openreplay/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/templates/_helpers.tpl @@ -33,10 +33,13 @@ ingress-nginx: &ingress-nginx {{- if contains "minio" .Values.global.s3.endpoint -}} {{- include "openreplay.domainURL" . -}} {{- else -}} - {{- .Values.global.s3.endpoint -}} + {{- .Values.global.s3.endpoint -}} {{- end -}} -{{- else -}} +{{/* Endpoint wil be empty if used with aws iam roles*/}} +{{- else if and .Values.global.s3.accessKey .Values.global.s3.secretKey -}} {{- printf "https://s3.%s.amazonaws.com" .Values.global.s3.region -}} +{{- else -}} + {{- .Values.global.s3.endpoint -}} {{- end -}} {{- end -}} diff --git a/scripts/helmcharts/openreplay/templates/job.yaml b/scripts/helmcharts/openreplay/templates/job.yaml index 1cf314514..e4d5463a8 100644 --- a/scripts/helmcharts/openreplay/templates/job.yaml +++ b/scripts/helmcharts/openreplay/templates/job.yaml @@ -404,7 +404,7 @@ spec: - name: AWS_DEFAULT_REGION value: "{{ .Values.global.s3.region }}" - name: AWS_ENDPOINT - value: "{{ .Values.global.s3.endpoint }}" + value: "{{- include "openreplay.s3Endpoint" . }}" - name: VAULT_BUCKET value: "{{ .Values.global.s3.vaultBucket }}" image: amazon/aws-cli