|
1 | 1 | {{- define "cluster.barmanObjectStoreConfig" -}} |
2 | 2 |
|
3 | 3 | {{- if .scope.endpointURL }} |
4 | | - endpointURL: {{ .scope.endpointURL | quote }} |
| 4 | + endpointURL: {{ include "tpl" (dict "value" .scope.endpointURL "context" .context) | quote }} |
5 | 5 | {{- end }} |
6 | 6 |
|
7 | 7 | {{- if or (.scope.endpointCA.create) (.scope.endpointCA.name) }} |
8 | 8 | endpointCA: |
9 | | - name: {{.scope.endpointCA.name }} |
| 9 | + name: {{ include "tpl" (dict "value" .scope.endpointCA.name "context" .context) }} |
10 | 10 | key: {{ .scope.endpointCA.key }} |
11 | 11 | {{- end }} |
12 | 12 |
|
13 | 13 | {{- if .scope.destinationPath }} |
14 | | - destinationPath: {{ .scope.destinationPath }} |
| 14 | + destinationPath: {{ include "tpl" (dict "value" .scope.destinationPath "context" .context) | quote }} |
15 | 15 | {{- end }} |
16 | 16 |
|
17 | 17 | {{- if eq .scope.provider "s3" }} |
18 | 18 | {{- if empty .scope.endpointURL }} |
19 | | - endpointURL: "https://s3.{{ required "You need to specify S3 region if endpointURL is not specified." .scope.s3.region }}.amazonaws.com" |
| 19 | + {{- $region := include "tpl" (dict "value" (required "You need to specify S3 region if endpointURL is not specified." .scope.s3.region) "context" .context) }} |
| 20 | + endpointURL: {{ printf "https://s3.%s.amazonaws.com" $region | quote }} |
20 | 21 | {{- end }} |
21 | 22 | {{- if empty .scope.destinationPath }} |
22 | | - destinationPath: "s3://{{ required "You need to specify S3 bucket if destinationPath is not specified." .scope.s3.bucket }}{{ .scope.s3.path }}" |
| 23 | + {{- $bucket := include "tpl" (dict "value" (required "You need to specify S3 bucket if destinationPath is not specified." .scope.s3.bucket) "context" .context) }} |
| 24 | + {{- $path := include "tpl" (dict "value" .scope.s3.path "context" .context) }} |
| 25 | + destinationPath: {{ printf "s3://%s%s" $bucket $path | quote }} |
23 | 26 | {{- end }} |
24 | 27 | {{- $secretName := coalesce .scope.secret.name (printf "%s-%s-s3-creds" .chartFullname .secretPrefix) }} |
25 | 28 | s3Credentials: |
26 | 29 | {{- if .scope.s3.inheritFromIAMRole }} |
27 | 30 | inheritFromIAMRole: true |
28 | 31 | {{- else }} |
29 | 32 | accessKeyId: |
30 | | - name: {{ $secretName }} |
| 33 | + name: {{ include "tpl" (dict "value" $secretName "context" .context) }} |
31 | 34 | key: ACCESS_KEY_ID |
32 | 35 | secretAccessKey: |
33 | | - name: {{ $secretName }} |
| 36 | + name: {{ include "tpl" (dict "value" $secretName "context" .context) }} |
34 | 37 | key: ACCESS_SECRET_KEY |
35 | 38 | {{- end }} |
36 | 39 | {{- else if eq .scope.provider "azure" }} |
| 40 | + |
37 | 41 | {{- if empty .scope.destinationPath }} |
38 | | - destinationPath: "https://{{ required "You need to specify Azure storageAccount if destinationPath is not specified." .scope.azure.storageAccount }}.{{ .scope.azure.serviceName }}.core.windows.net/{{ .scope.azure.containerName }}{{ .scope.azure.path }}" |
| 42 | + {{- $storageAccount := include "tpl" (dict "value" (required "You need to specify Azure storageAccount if destinationPath is not specified." .scope.azure.storageAccount) "context" .context) }} |
| 43 | + {{- $containerName := include "tpl" (dict "value" .scope.azure.containerName "context" .context) }} |
| 44 | + destinationPath: {{ printf "https://%s.%s.core.windows.net/%s%s" $storageAccount .scope.azure.serviceName $containerName .scope.azure.path | quote }} |
39 | 45 | {{- end }} |
40 | 46 | {{- $secretName := coalesce .scope.secret.name (printf "%s-%s-azure-creds" .chartFullname .secretPrefix) }} |
41 | 47 | azureCredentials: |
42 | 48 | {{- if .scope.azure.inheritFromAzureAD }} |
43 | 49 | inheritFromAzureAD: true |
44 | 50 | {{- else if .scope.azure.connectionString }} |
45 | 51 | connectionString: |
46 | | - name: {{ $secretName }} |
| 52 | + name: {{ include "tpl" (dict "value" $secretName "context" .context) }} |
47 | 53 | key: AZURE_CONNECTION_STRING |
48 | 54 | {{- else }} |
49 | 55 | storageAccount: |
50 | | - name: {{ $secretName }} |
| 56 | + name: {{ include "tpl" (dict "value" $secretName "context" .context) }} |
51 | 57 | key: AZURE_STORAGE_ACCOUNT |
52 | 58 | {{- if .scope.azure.storageKey }} |
53 | 59 | storageKey: |
54 | | - name: {{ $secretName }} |
| 60 | + name: {{ include "tpl" (dict "value" $secretName "context" .context) }} |
55 | 61 | key: AZURE_STORAGE_KEY |
56 | 62 | {{- else }} |
57 | 63 | storageSasToken: |
58 | | - name: {{ $secretName }} |
| 64 | + name: {{ include "tpl" (dict "value" $secretName "context" .context) }} |
59 | 65 | key: AZURE_STORAGE_SAS_TOKEN |
60 | 66 | {{- end }} |
61 | 67 | {{- end }} |
62 | 68 | {{- else if eq .scope.provider "google" }} |
63 | 69 | {{- if empty .scope.destinationPath }} |
64 | | - destinationPath: "gs://{{ required "You need to specify Google storage bucket if destinationPath is not specified." .scope.google.bucket }}{{ .scope.google.path }}" |
| 70 | + {{- $bucket := include "tpl" (dict "value" (required "You need to specify Google storage bucket if destinationPath is not specified." .scope.google.bucket) "context" .context) }} |
| 71 | + destinationPath: {{ printf "gs://%s%s" $bucket .scope.google.path | quote }} |
65 | 72 | {{- end }} |
66 | 73 | {{- $secretName := coalesce .scope.secret.name (printf "%s-%s-google-creds" .chartFullname .secretPrefix) }} |
67 | 74 | googleCredentials: |
68 | 75 | gkeEnvironment: {{ .scope.google.gkeEnvironment }} |
69 | 76 | {{- if not .scope.google.gkeEnvironment }} |
70 | 77 | applicationCredentials: |
71 | | - name: {{ $secretName }} |
| 78 | + name: {{ include "tpl" (dict "value" $secretName "context" .context) }} |
72 | 79 | key: APPLICATION_CREDENTIALS |
73 | 80 | {{- end }} |
74 | 81 | {{- end -}} |
|
0 commit comments