This commit is contained in:
Kjeld Schouten
2024-04-29 13:54:24 +02:00
parent d2f32a5035
commit 6eb2039dec
4 changed files with 23 additions and 5 deletions

View File

@@ -28,7 +28,11 @@
{{- if not $data.containerName -}}
{{- fail (printf "CNPG %s - You need to specify [%s.azure.containerName] or [%s.destinationPath]" ($type | camelcase) $key $key) -}}
{{- end -}}
{{- $destinationPath = (printf "https://%s.%s.core.windows.net/%s/%s/%s/cnpg" $data.storageAccount $data.serviceName $data.containerName (($data.path | default "/") | trimSuffix "/")) $rootCtx.Release.Name -}}
{{- if $data.path -}}
{{- $destinationPath = (printf "https://%s.%s.core.windows.net/%s/%s/%s/cnpg" $data.storageAccount $data.serviceName $data.containerName ($data.path | trimSuffix "/") $rootCtx.Release.Name) -}}
{{- else -}}
{{- $destinationPath = (printf "https://%s.%s.core.windows.net/%s/%s/cnpg" $data.storageAccount $data.serviceName $data.containerName $rootCtx.Release.Name) -}}
{{- end -}}
{{- end }}
endpointURL: {{ $endpointURL }}
destinationPath: {{ $destinationPath }}

View File

@@ -27,7 +27,11 @@
{{- if not $data.bucket -}}
{{- fail (printf "CNPG %s - You need to specify [%s.google.bucket] or [%s.destinationPath]" ($type | camelcase) $key $key) -}}
{{- end -}}
{{- $destinationPath = (printf "gs://%s/%s/%s/cnpg" $data.bucket (($data.path | default "/") | trimSuffix "/")) $rootCtx.Release.Name -}}
{{- if $data.path -}}
{{- $destinationPath = (printf "gs://%s/%s/%s/cnpg" $data.bucket ($data.path | trimSuffix "/") $rootCtx.Release.Name) -}}
{{- else -}}
{{- $destinationPath = (printf "gs://%s/%s/cnpg" $data.bucket $rootCtx.Release.Name) -}}
{{- end -}}
{{- end }}
endpointURL: {{ $endpointURL }}
destinationPath: {{ $destinationPath }}

View File

@@ -22,7 +22,11 @@
{{- if not $data.bucket -}}
{{- fail (printf "CNPG %s - You need to specify [%s.s3.bucket] or [%s.destinationPath]" ($type | camelcase) $key $key) -}}
{{- end -}}
{{- $destinationPath = (printf "s3://%s/%s/%s/cnpg" $data.bucket (($data.path | default "/") | trimSuffix "/")) $rootCtx.Release.Name -}}
{{- if $data.path -}}
{{- $destinationPath = (printf "s3://%s/%s/%s/cnpg" $data.bucket ($data.path | trimSuffix "/") $rootCtx.Release.Name ) -}}
{{- else -}}
{{- $destinationPath = (printf "s3://%s/%s/cnpg" $data.bucket $rootCtx.Release.Name) -}}
{{- end -}}
{{- end -}}
{{- if not $endpointURL -}}
{{- if not $data.region -}}

View File

@@ -101,8 +101,14 @@
{{- $_ := set $volsyncData "repository" $volsyncSecretName -}}
{{- $credentials := get $.Values.credentials $volsync.credentials -}}
{{- $resticrepository := printf "s3:%s/%s/%s/volsync/%s" $credentials.url $credentials.bucket ( $credentials.path | default "/" ) $.Release.Name $volsyncSecretName -}}
{{- $resticpassword := $credentials.encrKey -}}
{{- if $credentials.path -}}
{{- $resticrepository := printf "s3:%s/%s/%s/volsync/%s" $credentials.url $credentials.bucket ( $credentials.path | trimSuffix "/" ) $.Release.Name $volsyncSecretName -}}
{{- else -}}
{{- $resticrepository := printf "s3:%s/%s/volsync/%s" $credentials.url $credentials.bucket $.Release.Name $volsyncSecretName -}}
{{- end -}}
{{- $resticpassword := ( $credentials.encrKey | default $.Release.Name ) -}}
{{- $s3id := $credentials.accessKey -}}
{{- $s3key := $credentials.secretKey -}}