From 0c951b79cb97315158e3b5bff6c51ba8c1bf69ef Mon Sep 17 00:00:00 2001 From: souravbiswassanto Date: Wed, 20 Mar 2024 16:40:09 +0600 Subject: [PATCH] Add pg version 16 support Signed-off-by: souravbiswassanto --- catalog/catalog.json | 3 +- .../16.1/postgres-backup-function.yaml | 39 ++++++++++++++++ .../postgres/16.1/postgres-backup-task.yaml | 14 ++++++ .../16.1/postgres-restore-function.yaml | 30 +++++++++++++ .../postgres/16.1/postgres-restore-task.yaml | 14 ++++++ .../16.1/postgres-backup-function.yaml | 44 +++++++++++++++++++ .../postgres/16.1/postgres-backup-task.yaml | 18 ++++++++ .../16.1/postgres-restore-function.yaml | 35 +++++++++++++++ .../postgres/16.1/postgres-restore-task.yaml | 18 ++++++++ 9 files changed, 214 insertions(+), 1 deletion(-) create mode 100644 catalog/raw/postgres/16.1/postgres-backup-function.yaml create mode 100644 catalog/raw/postgres/16.1/postgres-backup-task.yaml create mode 100644 catalog/raw/postgres/16.1/postgres-restore-function.yaml create mode 100644 catalog/raw/postgres/16.1/postgres-restore-task.yaml create mode 100644 charts/stash-catalog/templates/postgres/16.1/postgres-backup-function.yaml create mode 100644 charts/stash-catalog/templates/postgres/16.1/postgres-backup-task.yaml create mode 100644 charts/stash-catalog/templates/postgres/16.1/postgres-restore-function.yaml create mode 100644 charts/stash-catalog/templates/postgres/16.1/postgres-restore-task.yaml diff --git a/catalog/catalog.json b/catalog/catalog.json index da3865346..2c9954bf8 100644 --- a/catalog/catalog.json +++ b/catalog/catalog.json @@ -86,7 +86,8 @@ "12.4-v29", "13.1-v26", "14.0-v18", - "15.1-v10" + "15.1-v10", + "16.1" ] }, { diff --git a/catalog/raw/postgres/16.1/postgres-backup-function.yaml b/catalog/raw/postgres/16.1/postgres-backup-function.yaml new file mode 100644 index 000000000..9e1254a46 --- /dev/null +++ b/catalog/raw/postgres/16.1/postgres-backup-function.yaml @@ -0,0 +1,39 @@ +apiVersion: stash.appscode.com/v1beta1 +kind: Function +metadata: + name: postgres-backup-16.1 +spec: + args: + - backup-pg + - --provider=${REPOSITORY_PROVIDER:=} + - --bucket=${REPOSITORY_BUCKET:=} + - --endpoint=${REPOSITORY_ENDPOINT:=} + - --insecure-tls=${REPOSITORY_INSECURE_TLS:=} + - --region=${REPOSITORY_REGION:=} + - --path=${REPOSITORY_PREFIX:=} + - --storage-secret-name=${REPOSITORY_SECRET_NAME:=} + - --storage-secret-namespace=${REPOSITORY_SECRET_NAMESPACE:=} + - --scratch-dir=/stash-tmp + - --enable-cache=${ENABLE_CACHE:=true} + - --max-connections=${MAX_CONNECTIONS:=0} + - --hostname=${HOSTNAME:=} + - --backup-cmd=${backupCMD:=pg_dumpall} + - --pg-args=${args:=} + - --wait-timeout=${waitTimeout:=300} + - --namespace=${NAMESPACE:=default} + - --appbinding=${TARGET_NAME:=} + - --appbinding-namespace=${TARGET_NAMESPACE:=} + - --backupsession=${BACKUP_SESSION:=} + - --retention-keep-last=${RETENTION_KEEP_LAST:=0} + - --retention-keep-hourly=${RETENTION_KEEP_HOURLY:=0} + - --retention-keep-daily=${RETENTION_KEEP_DAILY:=0} + - --retention-keep-weekly=${RETENTION_KEEP_WEEKLY:=0} + - --retention-keep-monthly=${RETENTION_KEEP_MONTHLY:=0} + - --retention-keep-yearly=${RETENTION_KEEP_YEARLY:=0} + - --retention-keep-tags=${RETENTION_KEEP_TAGS:=} + - --retention-prune=${RETENTION_PRUNE:=false} + - --retention-dry-run=${RETENTION_DRY_RUN:=false} + - --output-dir=${outputDir:=} + - --license-apiservice=${LICENSE_APISERVICE:=} + - --user=${user:=} + image: ghcr.io/stashed/stash-postgres:16.1 diff --git a/catalog/raw/postgres/16.1/postgres-backup-task.yaml b/catalog/raw/postgres/16.1/postgres-backup-task.yaml new file mode 100644 index 000000000..67910fa43 --- /dev/null +++ b/catalog/raw/postgres/16.1/postgres-backup-task.yaml @@ -0,0 +1,14 @@ +apiVersion: stash.appscode.com/v1beta1 +kind: Task +metadata: + name: postgres-backup-16.1 +spec: + steps: + - name: postgres-backup-16.1 + params: + - name: outputDir + value: /stash-tmp/output + - name: update-status + params: + - name: outputDir + value: /stash-tmp/output diff --git a/catalog/raw/postgres/16.1/postgres-restore-function.yaml b/catalog/raw/postgres/16.1/postgres-restore-function.yaml new file mode 100644 index 000000000..81b84467e --- /dev/null +++ b/catalog/raw/postgres/16.1/postgres-restore-function.yaml @@ -0,0 +1,30 @@ +apiVersion: stash.appscode.com/v1beta1 +kind: Function +metadata: + name: postgres-restore-16.1 +spec: + args: + - restore-pg + - --provider=${REPOSITORY_PROVIDER:=} + - --bucket=${REPOSITORY_BUCKET:=} + - --endpoint=${REPOSITORY_ENDPOINT:=} + - --insecure-tls=${REPOSITORY_INSECURE_TLS:=} + - --region=${REPOSITORY_REGION:=} + - --path=${REPOSITORY_PREFIX:=} + - --storage-secret-name=${REPOSITORY_SECRET_NAME:=} + - --storage-secret-namespace=${REPOSITORY_SECRET_NAMESPACE:=} + - --scratch-dir=/stash-tmp + - --enable-cache=${ENABLE_CACHE:=true} + - --max-connections=${MAX_CONNECTIONS:=0} + - --hostname=${HOSTNAME:=} + - --source-hostname=${SOURCE_HOSTNAME:=} + - --pg-args=${args:=} + - --wait-timeout=${waitTimeout:=300} + - --namespace=${NAMESPACE:=default} + - --appbinding=${TARGET_NAME:=} + - --appbinding-namespace=${TARGET_NAMESPACE:=} + - --snapshot=${RESTORE_SNAPSHOTS:=} + - --output-dir=${outputDir:=} + - --license-apiservice=${LICENSE_APISERVICE:=} + - --user=${user:=} + image: ghcr.io/stashed/stash-postgres:16.1 diff --git a/catalog/raw/postgres/16.1/postgres-restore-task.yaml b/catalog/raw/postgres/16.1/postgres-restore-task.yaml new file mode 100644 index 000000000..6c0d3252d --- /dev/null +++ b/catalog/raw/postgres/16.1/postgres-restore-task.yaml @@ -0,0 +1,14 @@ +apiVersion: stash.appscode.com/v1beta1 +kind: Task +metadata: + name: postgres-restore-16.1 +spec: + steps: + - name: postgres-restore-16.1 + params: + - name: outputDir + value: /stash-tmp/output + - name: update-status + params: + - name: outputDir + value: /stash-tmp/output diff --git a/charts/stash-catalog/templates/postgres/16.1/postgres-backup-function.yaml b/charts/stash-catalog/templates/postgres/16.1/postgres-backup-function.yaml new file mode 100644 index 000000000..1b16f99bf --- /dev/null +++ b/charts/stash-catalog/templates/postgres/16.1/postgres-backup-function.yaml @@ -0,0 +1,44 @@ +{{ if .Values.postgres.enabled }} +apiVersion: stash.appscode.com/v1beta1 +kind: Function +metadata: + name: 'postgres-backup-16.1' + labels: + {{- include "stash-catalog.labels" . | nindent 4 }} +spec: + args: + - backup-pg + - --provider=${REPOSITORY_PROVIDER:=} + - --bucket=${REPOSITORY_BUCKET:=} + - --endpoint=${REPOSITORY_ENDPOINT:=} + - --insecure-tls=${REPOSITORY_INSECURE_TLS:=} + - --region=${REPOSITORY_REGION:=} + - --path=${REPOSITORY_PREFIX:=} + - --storage-secret-name=${REPOSITORY_SECRET_NAME:=} + - --storage-secret-namespace=${REPOSITORY_SECRET_NAMESPACE:=} + - --scratch-dir=/stash-tmp + - --enable-cache=${ENABLE_CACHE:=true} + - --max-connections=${MAX_CONNECTIONS:=0} + - --hostname=${HOSTNAME:=} + - --backup-cmd=${backupCMD:=pg_dumpall} + - --pg-args=${args:={{ .Values.postgres.backup.args }}} + - --wait-timeout=${waitTimeout:={{ .Values.waitTimeout}}} + - --namespace=${NAMESPACE:=default} + - --appbinding=${TARGET_NAME:=} + - --appbinding-namespace=${TARGET_NAMESPACE:=} + - --backupsession=${BACKUP_SESSION:=} + - --retention-keep-last=${RETENTION_KEEP_LAST:=0} + - --retention-keep-hourly=${RETENTION_KEEP_HOURLY:=0} + - --retention-keep-daily=${RETENTION_KEEP_DAILY:=0} + - --retention-keep-weekly=${RETENTION_KEEP_WEEKLY:=0} + - --retention-keep-monthly=${RETENTION_KEEP_MONTHLY:=0} + - --retention-keep-yearly=${RETENTION_KEEP_YEARLY:=0} + - --retention-keep-tags=${RETENTION_KEEP_TAGS:=} + - --retention-prune=${RETENTION_PRUNE:=false} + - --retention-dry-run=${RETENTION_DRY_RUN:=false} + - --output-dir=${outputDir:=} + - --license-apiservice=${LICENSE_APISERVICE:=} + - --user=${user:=} + image: '{{ include "catalog.registry" (merge (dict "_reg" "ghcr.io" "_repo" "stashed") + .Values) }}/stash-postgres:16.1' +{{ end }} diff --git a/charts/stash-catalog/templates/postgres/16.1/postgres-backup-task.yaml b/charts/stash-catalog/templates/postgres/16.1/postgres-backup-task.yaml new file mode 100644 index 000000000..3e8533fa0 --- /dev/null +++ b/charts/stash-catalog/templates/postgres/16.1/postgres-backup-task.yaml @@ -0,0 +1,18 @@ +{{ if .Values.postgres.enabled }} +apiVersion: stash.appscode.com/v1beta1 +kind: Task +metadata: + name: 'postgres-backup-16.1' + labels: + {{- include "stash-catalog.labels" . | nindent 4 }} +spec: + steps: + - name: postgres-backup-16.1 + params: + - name: outputDir + value: /stash-tmp/output + - name: update-status + params: + - name: outputDir + value: /stash-tmp/output +{{ end }} diff --git a/charts/stash-catalog/templates/postgres/16.1/postgres-restore-function.yaml b/charts/stash-catalog/templates/postgres/16.1/postgres-restore-function.yaml new file mode 100644 index 000000000..d0ff04235 --- /dev/null +++ b/charts/stash-catalog/templates/postgres/16.1/postgres-restore-function.yaml @@ -0,0 +1,35 @@ +{{ if .Values.postgres.enabled }} +apiVersion: stash.appscode.com/v1beta1 +kind: Function +metadata: + name: 'postgres-restore-16.1' + labels: + {{- include "stash-catalog.labels" . | nindent 4 }} +spec: + args: + - restore-pg + - --provider=${REPOSITORY_PROVIDER:=} + - --bucket=${REPOSITORY_BUCKET:=} + - --endpoint=${REPOSITORY_ENDPOINT:=} + - --insecure-tls=${REPOSITORY_INSECURE_TLS:=} + - --region=${REPOSITORY_REGION:=} + - --path=${REPOSITORY_PREFIX:=} + - --storage-secret-name=${REPOSITORY_SECRET_NAME:=} + - --storage-secret-namespace=${REPOSITORY_SECRET_NAMESPACE:=} + - --scratch-dir=/stash-tmp + - --enable-cache=${ENABLE_CACHE:=true} + - --max-connections=${MAX_CONNECTIONS:=0} + - --hostname=${HOSTNAME:=} + - --source-hostname=${SOURCE_HOSTNAME:=} + - --pg-args=${args:={{ .Values.postgres.restore.args }}} + - --wait-timeout=${waitTimeout:={{ .Values.waitTimeout}}} + - --namespace=${NAMESPACE:=default} + - --appbinding=${TARGET_NAME:=} + - --appbinding-namespace=${TARGET_NAMESPACE:=} + - --snapshot=${RESTORE_SNAPSHOTS:=} + - --output-dir=${outputDir:=} + - --license-apiservice=${LICENSE_APISERVICE:=} + - --user=${user:=} + image: '{{ include "catalog.registry" (merge (dict "_reg" "ghcr.io" "_repo" "stashed") + .Values) }}/stash-postgres:16.1' +{{ end }} diff --git a/charts/stash-catalog/templates/postgres/16.1/postgres-restore-task.yaml b/charts/stash-catalog/templates/postgres/16.1/postgres-restore-task.yaml new file mode 100644 index 000000000..7c6eda88a --- /dev/null +++ b/charts/stash-catalog/templates/postgres/16.1/postgres-restore-task.yaml @@ -0,0 +1,18 @@ +{{ if .Values.postgres.enabled }} +apiVersion: stash.appscode.com/v1beta1 +kind: Task +metadata: + name: 'postgres-restore-16.1' + labels: + {{- include "stash-catalog.labels" . | nindent 4 }} +spec: + steps: + - name: postgres-restore-16.1 + params: + - name: outputDir + value: /stash-tmp/output + - name: update-status + params: + - name: outputDir + value: /stash-tmp/output +{{ end }}