diff --git a/library/common-test/Chart.yaml b/library/common-test/Chart.yaml index 2f2ff45b..a48846ba 100644 --- a/library/common-test/Chart.yaml +++ b/library/common-test/Chart.yaml @@ -3,7 +3,7 @@ appVersion: "" dependencies: - name: common repository: file://../common - version: ~18.1.0 + version: ~18.2.0 deprecated: false description: Helper chart to test different use cases of the common library home: https://github.com/truecharts/apps/tree/master/charts/library/common-test diff --git a/library/common/Chart.yaml b/library/common/Chart.yaml index 8961761e..84e9284c 100644 --- a/library/common/Chart.yaml +++ b/library/common/Chart.yaml @@ -15,7 +15,7 @@ maintainers: name: common sources: null type: library -version: 18.1.8 +version: 18.2.0 annotations: artifacthub.io/category: "integration-delivery" artifacthub.io/license: "BUSL-1.1" diff --git a/library/common/templates/lib/cnpg/barmanObjectStore/_azure.tpl b/library/common/templates/lib/cnpg/barmanObjectStore/_azure.tpl index 6b19f93e..90cdde34 100644 --- a/library/common/templates/lib/cnpg/barmanObjectStore/_azure.tpl +++ b/library/common/templates/lib/cnpg/barmanObjectStore/_azure.tpl @@ -6,6 +6,7 @@ {{- $fullname := include "tc.v1.common.lib.chart.names.fullname" $rootCtx -}} {{- $secretName := (printf "%s-cnpg-%s-provider-%s-azure-creds" $fullname $objectData.shortName $type) -}} + {{- $serverName := $objectData.clusterName -}} {{- $endpointURL := "" -}} {{- $destinationPath := "" -}} @@ -14,10 +15,22 @@ {{- $endpointURL = $objectData.recovery.endpointURL -}} {{- $destinationPath = $objectData.recovery.destinationPath -}} {{- $k = "recovery" -}} + {{- if $objectData.recovery.serverName -}} + {{- $serverName = $objectData.recovery.serverName -}} + {{- end -}} + {{- if $objectData.recovery.revision -}} + {{- $serverName = printf "%s-%s" $serverName $objectData.recovery.revision -}} + {{- end -}} {{- else if eq $type "backup" -}} {{- $endpointURL = $objectData.backups.endpointURL -}} {{- $destinationPath = $objectData.backups.destinationPath -}} {{- $k = "backups" -}} + {{- if $objectData.backups.serverName -}} + {{- $serverName = $objectData.backups.serverName -}} + {{- end -}} + {{- if $objectData.backups.revision -}} + {{- $serverName = printf "%s-%s" $serverName $objectData.backups.revision -}} + {{- end -}} {{- end -}} {{- if not $destinationPath -}} {{- if not $data.storageAccount -}} @@ -33,6 +46,7 @@ {{- end }} endpointURL: {{ $endpointURL }} destinationPath: {{ $destinationPath }} +serverName: {{ $serverName }} azureCredentials: connectionString: name: {{ $secretName }} diff --git a/library/common/templates/lib/cnpg/barmanObjectStore/_google.tpl b/library/common/templates/lib/cnpg/barmanObjectStore/_google.tpl index e70f0694..6a1e0fdf 100644 --- a/library/common/templates/lib/cnpg/barmanObjectStore/_google.tpl +++ b/library/common/templates/lib/cnpg/barmanObjectStore/_google.tpl @@ -6,6 +6,7 @@ {{- $fullname := include "tc.v1.common.lib.chart.names.fullname" $rootCtx -}} {{- $secretName := (printf "%s-cnpg-%s-provider-%s-google-creds" $fullname $objectData.shortName $type) -}} + {{- $serverName := $objectData.clusterName -}} {{- $gkeEnv := false -}} {{- if (kindIs "bool" $data.gkeEnvionment) -}} @@ -19,10 +20,22 @@ {{- $endpointURL = $objectData.recovery.endpointURL -}} {{- $destinationPath = $objectData.recovery.destinationPath -}} {{- $k = "recovery" -}} + {{- if $objectData.recovery.serverName -}} + {{- $serverName = $objectData.recovery.serverName -}} + {{- end -}} + {{- if $objectData.recovery.revision -}} + {{- $serverName = printf "%s-%s" $serverName $objectData.recovery.revision -}} + {{- end -}} {{- else if eq $type "backup" -}} {{- $endpointURL = $objectData.backups.endpointURL -}} {{- $destinationPath = $objectData.backups.destinationPath -}} {{- $k = "backups" -}} + {{- if $objectData.backups.serverName -}} + {{- $serverName = $objectData.backups.serverName -}} + {{- end -}} + {{- if $objectData.backups.revision -}} + {{- $serverName = printf "%s-%s" $serverName $objectData.backups.revision -}} + {{- end -}} {{- end -}} {{- if not $destinationPath -}} {{- if not $data.bucket -}} @@ -32,6 +45,7 @@ {{- end }} endpointURL: {{ $endpointURL }} destinationPath: {{ $destinationPath }} +serverName: {{ $serverName }} googleCredentials: gkeEnvironment: {{ $gkeEnv }} applicationCredentials: diff --git a/library/common/templates/lib/cnpg/barmanObjectStore/_s3.tpl b/library/common/templates/lib/cnpg/barmanObjectStore/_s3.tpl index 2bcb8251..74dbb400 100644 --- a/library/common/templates/lib/cnpg/barmanObjectStore/_s3.tpl +++ b/library/common/templates/lib/cnpg/barmanObjectStore/_s3.tpl @@ -6,6 +6,7 @@ {{- $fullname := include "tc.v1.common.lib.chart.names.fullname" $rootCtx -}} {{- $secretName := (printf "%s-cnpg-%s-provider-%s-s3-creds" $fullname $objectData.shortName $type) -}} + {{- $serverName := $objectData.clusterName -}} {{- $endpointURL := "" -}} {{- $destinationPath := "" -}} @@ -14,10 +15,22 @@ {{- $endpointURL = $objectData.recovery.endpointURL -}} {{- $destinationPath = $objectData.recovery.destinationPath -}} {{- $k = "recovery" -}} + {{- if $objectData.recovery.serverName -}} + {{- $serverName = $objectData.recovery.serverName -}} + {{- end -}} + {{- if $objectData.recovery.revision -}} + {{- $serverName = printf "%s-%s" $serverName $objectData.recovery.revision -}} + {{- end -}} {{- else if eq $type "backup" -}} {{- $endpointURL = $objectData.backups.endpointURL -}} {{- $destinationPath = $objectData.backups.destinationPath -}} {{- $k = "backups" -}} + {{- if $objectData.backups.serverName -}} + {{- $serverName = $objectData.backups.serverName -}} + {{- end -}} + {{- if $objectData.backups.revision -}} + {{- $serverName = printf "%s-%s" $serverName $objectData.backups.revision -}} + {{- end -}} {{- end -}} {{- if not $destinationPath -}} {{- if not $data.bucket -}} @@ -31,8 +44,10 @@ {{- end -}} {{- $endpointURL = (printf "https://s3.%s.amazonaws.com" $data.region) -}} {{- end }} + endpointURL: {{ $endpointURL }} destinationPath: {{ $destinationPath }} +serverName: {{ $serverName }} s3Credentials: accessKeyId: name: {{ $secretName }} diff --git a/library/common/values.yaml b/library/common/values.yaml index ac263832..e8d1f711 100644 --- a/library/common/values.yaml +++ b/library/common/values.yaml @@ -1155,6 +1155,11 @@ cnpg: # * `pg_basebackup` - Recovers a CNPG cluster viaa streaming replication protocol. Useful if you want to # migrate databases to CloudNativePG, even from outside Kubernetes. # TODO method: object_store + ## set a revision to append to the serverName to ensure restore and backup dont target the same thing + # revision: 1 + + # override serverName in recovery obkect + servername: "" ## Point in time recovery target. Specify one of the following: pitrTarget: @@ -1203,6 +1208,13 @@ cnpg: # S3: https://s3..amazonaws.com" endpointURL: "" # Leave empty if using the default S3 endpoint + ## set a revision to append to the serverName to ensure restore and backup dont target the same thing + # revision: 1 + + # override serverName in recovery obkect + servername: "" + + # Overrides the provider specific default path. Defaults to: # S3: s3:// # Azure: https://..core.windows.net/