Skip to content

Commit ddcf6b7

Browse files
Set objcreds based on value provided, not provider type (#1274)
Signed-off-by: Arnob kumar saha <arnob@appscode.com>
1 parent 4f09346 commit ddcf6b7

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{ $objstore := .Values.global.infra.objstore }}
22

3-
{{- if and (include "settings.objstoreSecretName" .) ($objstore.provider) }}
3+
{{- if and (include "settings.objstoreSecretName" .) (or $objstore.s3 $objstore.azure $objstore.gcs) }}
44

55
apiVersion: v1
66
kind: Secret
@@ -11,24 +11,22 @@ metadata:
1111
{{- include "ace.labels" . | nindent 4 }}
1212
type: Opaque
1313
stringData:
14-
{{- if eq $objstore.provider "s3" }}
15-
AWS_ACCESS_KEY_ID: '{{ $objstore.s3.AWS_ACCESS_KEY_ID }}'
16-
AWS_SECRET_ACCESS_KEY: '{{ $objstore.s3.AWS_SECRET_ACCESS_KEY }}'
17-
ca.crt: {{ $objstore.s3.CA_CERT_DATA | default "" | quote }}
18-
{{- with $objstore.s3.AWS_REGION }}
14+
{{- with $objstore.s3 }}
15+
AWS_ACCESS_KEY_ID: '{{ .AWS_ACCESS_KEY_ID }}'
16+
AWS_SECRET_ACCESS_KEY: '{{ .AWS_SECRET_ACCESS_KEY }}'
17+
ca.crt: {{ .CA_CERT_DATA | default "" | quote }}
18+
{{- with .AWS_REGION }}
1919
AWS_REGION: '{{ . }}'
2020
{{- end }}
2121
{{- end }}
2222

23-
{{- if eq $objstore.provider "azure" }}
24-
{{- with $objstore.azure }}
23+
{{- with $objstore.azure }}
2524
AZURE_ACCOUNT_NAME: '{{ .AZURE_ACCOUNT_NAME }}'
2625
AZURE_ACCOUNT_KEY: '{{ .AZURE_ACCOUNT_KEY }}'
27-
{{- end }}
2826
{{- end }}
2927

30-
{{- if eq $objstore.provider "gcs" }}
31-
sa.json: {{ $objstore.gcs.GOOGLE_SERVICE_ACCOUNT_JSON_KEY | default "" | quote }}
28+
{{- with $objstore.gcs }}
29+
sa.json: {{ .GOOGLE_SERVICE_ACCOUNT_JSON_KEY | default "" | quote }}
3230
{{- end }}
3331

3432
{{- end }}

0 commit comments

Comments
 (0)