From 115dbac2bd5dbafa835e1252a3c8f3587d781a47 Mon Sep 17 00:00:00 2001 From: souravbiswassanto Date: Fri, 20 Feb 2026 13:08:12 +0600 Subject: [PATCH] Add postgres 18 version support for stash Signed-off-by: souravbiswassanto --- catalog/catalog.json | 3 +- catalog/copy-images.sh | 1 + catalog/export-images.sh | 1 + catalog/imagelist.yaml | 1 + catalog/import-images.sh | 1 + catalog/import-into-k3s.sh | 1 + .../18.2/postgres-backup-function.yaml | 39 ++++++++++++++++ .../postgres/18.2/postgres-backup-task.yaml | 14 ++++++ .../18.2/postgres-restore-function.yaml | 30 +++++++++++++ .../postgres/18.2/postgres-restore-task.yaml | 14 ++++++ .../18.2/postgres-backup-function.yaml | 44 +++++++++++++++++++ .../postgres/18.2/postgres-backup-task.yaml | 18 ++++++++ .../18.2/postgres-restore-function.yaml | 35 +++++++++++++++ .../postgres/18.2/postgres-restore-task.yaml | 18 ++++++++ 14 files changed, 219 insertions(+), 1 deletion(-) create mode 100644 catalog/raw/postgres/18.2/postgres-backup-function.yaml create mode 100644 catalog/raw/postgres/18.2/postgres-backup-task.yaml create mode 100644 catalog/raw/postgres/18.2/postgres-restore-function.yaml create mode 100644 catalog/raw/postgres/18.2/postgres-restore-task.yaml create mode 100644 charts/stash-catalog/templates/postgres/18.2/postgres-backup-function.yaml create mode 100644 charts/stash-catalog/templates/postgres/18.2/postgres-backup-task.yaml create mode 100644 charts/stash-catalog/templates/postgres/18.2/postgres-restore-function.yaml create mode 100644 charts/stash-catalog/templates/postgres/18.2/postgres-restore-task.yaml diff --git a/catalog/catalog.json b/catalog/catalog.json index dbd3ee9a..62c72b86 100644 --- a/catalog/catalog.json +++ b/catalog/catalog.json @@ -90,7 +90,8 @@ "14.0-v26", "15.1-v18", "16.1-v7", - "17.2-v5" + "17.2-v5", + "18.2" ] }, { diff --git a/catalog/copy-images.sh b/catalog/copy-images.sh index fc580385..b5ee5afe 100755 --- a/catalog/copy-images.sh +++ b/catalog/copy-images.sh @@ -84,6 +84,7 @@ $CMD cp --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-post $CMD cp --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-postgres:15.1-v18 $IMAGE_REGISTRY/stashed/stash-postgres:15.1-v18 $CMD cp --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-postgres:16.1-v7 $IMAGE_REGISTRY/stashed/stash-postgres:16.1-v7 $CMD cp --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-postgres:17.2-v5 $IMAGE_REGISTRY/stashed/stash-postgres:17.2-v5 +$CMD cp --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-postgres:18.2 $IMAGE_REGISTRY/stashed/stash-postgres:18.2 $CMD cp --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-postgres:9.6.19-v37 $IMAGE_REGISTRY/stashed/stash-postgres:9.6.19-v37 $CMD cp --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-redis:5.0.13-v26 $IMAGE_REGISTRY/stashed/stash-redis:5.0.13-v26 $CMD cp --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-redis:6.2.5-v26 $IMAGE_REGISTRY/stashed/stash-redis:6.2.5-v26 diff --git a/catalog/export-images.sh b/catalog/export-images.sh index 14fc7c59..0208b777 100755 --- a/catalog/export-images.sh +++ b/catalog/export-images.sh @@ -81,6 +81,7 @@ $CMD pull --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-po $CMD pull --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-postgres:15.1-v18 images/stashed-stash-postgres-15.1-v18.tar $CMD pull --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-postgres:16.1-v7 images/stashed-stash-postgres-16.1-v7.tar $CMD pull --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-postgres:17.2-v5 images/stashed-stash-postgres-17.2-v5.tar +$CMD pull --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-postgres:18.2 images/stashed-stash-postgres-18.2.tar $CMD pull --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-postgres:9.6.19-v37 images/stashed-stash-postgres-9.6.19-v37.tar $CMD pull --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-redis:5.0.13-v26 images/stashed-stash-redis-5.0.13-v26.tar $CMD pull --allow-nondistributable-artifacts --insecure ghcr.io/stashed/stash-redis:6.2.5-v26 images/stashed-stash-redis-6.2.5-v26.tar diff --git a/catalog/imagelist.yaml b/catalog/imagelist.yaml index 158700f5..b3e01377 100644 --- a/catalog/imagelist.yaml +++ b/catalog/imagelist.yaml @@ -47,6 +47,7 @@ - ghcr.io/stashed/stash-postgres:15.1-v18 - ghcr.io/stashed/stash-postgres:16.1-v7 - ghcr.io/stashed/stash-postgres:17.2-v5 +- ghcr.io/stashed/stash-postgres:18.2 - ghcr.io/stashed/stash-postgres:9.6.19-v37 - ghcr.io/stashed/stash-redis:5.0.13-v26 - ghcr.io/stashed/stash-redis:6.2.5-v26 diff --git a/catalog/import-images.sh b/catalog/import-images.sh index 2f8ccffe..95bd5f44 100755 --- a/catalog/import-images.sh +++ b/catalog/import-images.sh @@ -75,6 +75,7 @@ $CMD push --allow-nondistributable-artifacts --insecure images/stashed-stash-pos $CMD push --allow-nondistributable-artifacts --insecure images/stashed-stash-postgres-15.1-v18.tar $IMAGE_REGISTRY/stashed/stash-postgres:15.1-v18 $CMD push --allow-nondistributable-artifacts --insecure images/stashed-stash-postgres-16.1-v7.tar $IMAGE_REGISTRY/stashed/stash-postgres:16.1-v7 $CMD push --allow-nondistributable-artifacts --insecure images/stashed-stash-postgres-17.2-v5.tar $IMAGE_REGISTRY/stashed/stash-postgres:17.2-v5 +$CMD push --allow-nondistributable-artifacts --insecure images/stashed-stash-postgres-18.2.tar $IMAGE_REGISTRY/stashed/stash-postgres:18.2 $CMD push --allow-nondistributable-artifacts --insecure images/stashed-stash-postgres-9.6.19-v37.tar $IMAGE_REGISTRY/stashed/stash-postgres:9.6.19-v37 $CMD push --allow-nondistributable-artifacts --insecure images/stashed-stash-redis-5.0.13-v26.tar $IMAGE_REGISTRY/stashed/stash-redis:5.0.13-v26 $CMD push --allow-nondistributable-artifacts --insecure images/stashed-stash-redis-6.2.5-v26.tar $IMAGE_REGISTRY/stashed/stash-redis:6.2.5-v26 diff --git a/catalog/import-into-k3s.sh b/catalog/import-into-k3s.sh index 2dbd3b87..71f7f6b4 100755 --- a/catalog/import-into-k3s.sh +++ b/catalog/import-into-k3s.sh @@ -73,6 +73,7 @@ k3s ctr images import images/stashed-stash-postgres-14.0-v26.tar k3s ctr images import images/stashed-stash-postgres-15.1-v18.tar k3s ctr images import images/stashed-stash-postgres-16.1-v7.tar k3s ctr images import images/stashed-stash-postgres-17.2-v5.tar +k3s ctr images import images/stashed-stash-postgres-18.2.tar k3s ctr images import images/stashed-stash-postgres-9.6.19-v37.tar k3s ctr images import images/stashed-stash-redis-5.0.13-v26.tar k3s ctr images import images/stashed-stash-redis-6.2.5-v26.tar diff --git a/catalog/raw/postgres/18.2/postgres-backup-function.yaml b/catalog/raw/postgres/18.2/postgres-backup-function.yaml new file mode 100644 index 00000000..550c9429 --- /dev/null +++ b/catalog/raw/postgres/18.2/postgres-backup-function.yaml @@ -0,0 +1,39 @@ +apiVersion: stash.appscode.com/v1beta1 +kind: Function +metadata: + name: postgres-backup-18.2 +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:18.2 diff --git a/catalog/raw/postgres/18.2/postgres-backup-task.yaml b/catalog/raw/postgres/18.2/postgres-backup-task.yaml new file mode 100644 index 00000000..79bd7463 --- /dev/null +++ b/catalog/raw/postgres/18.2/postgres-backup-task.yaml @@ -0,0 +1,14 @@ +apiVersion: stash.appscode.com/v1beta1 +kind: Task +metadata: + name: postgres-backup-18.2 +spec: + steps: + - name: postgres-backup-18.2 + params: + - name: outputDir + value: /stash-tmp/output + - name: update-status + params: + - name: outputDir + value: /stash-tmp/output diff --git a/catalog/raw/postgres/18.2/postgres-restore-function.yaml b/catalog/raw/postgres/18.2/postgres-restore-function.yaml new file mode 100644 index 00000000..01c7e94e --- /dev/null +++ b/catalog/raw/postgres/18.2/postgres-restore-function.yaml @@ -0,0 +1,30 @@ +apiVersion: stash.appscode.com/v1beta1 +kind: Function +metadata: + name: postgres-restore-18.2 +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:18.2 diff --git a/catalog/raw/postgres/18.2/postgres-restore-task.yaml b/catalog/raw/postgres/18.2/postgres-restore-task.yaml new file mode 100644 index 00000000..5e70b3c4 --- /dev/null +++ b/catalog/raw/postgres/18.2/postgres-restore-task.yaml @@ -0,0 +1,14 @@ +apiVersion: stash.appscode.com/v1beta1 +kind: Task +metadata: + name: postgres-restore-18.2 +spec: + steps: + - name: postgres-restore-18.2 + 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/18.2/postgres-backup-function.yaml b/charts/stash-catalog/templates/postgres/18.2/postgres-backup-function.yaml new file mode 100644 index 00000000..c0046aa6 --- /dev/null +++ b/charts/stash-catalog/templates/postgres/18.2/postgres-backup-function.yaml @@ -0,0 +1,44 @@ +{{ if .Values.postgres.enabled }} +apiVersion: stash.appscode.com/v1beta1 +kind: Function +metadata: + name: 'postgres-backup-18.2' + 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:18.2' +{{ end }} diff --git a/charts/stash-catalog/templates/postgres/18.2/postgres-backup-task.yaml b/charts/stash-catalog/templates/postgres/18.2/postgres-backup-task.yaml new file mode 100644 index 00000000..f7382966 --- /dev/null +++ b/charts/stash-catalog/templates/postgres/18.2/postgres-backup-task.yaml @@ -0,0 +1,18 @@ +{{ if .Values.postgres.enabled }} +apiVersion: stash.appscode.com/v1beta1 +kind: Task +metadata: + name: 'postgres-backup-18.2' + labels: + {{- include "stash-catalog.labels" . | nindent 4 }} +spec: + steps: + - name: postgres-backup-18.2 + 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/18.2/postgres-restore-function.yaml b/charts/stash-catalog/templates/postgres/18.2/postgres-restore-function.yaml new file mode 100644 index 00000000..b87bfbcf --- /dev/null +++ b/charts/stash-catalog/templates/postgres/18.2/postgres-restore-function.yaml @@ -0,0 +1,35 @@ +{{ if .Values.postgres.enabled }} +apiVersion: stash.appscode.com/v1beta1 +kind: Function +metadata: + name: 'postgres-restore-18.2' + 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:18.2' +{{ end }} diff --git a/charts/stash-catalog/templates/postgres/18.2/postgres-restore-task.yaml b/charts/stash-catalog/templates/postgres/18.2/postgres-restore-task.yaml new file mode 100644 index 00000000..62d6cd9c --- /dev/null +++ b/charts/stash-catalog/templates/postgres/18.2/postgres-restore-task.yaml @@ -0,0 +1,18 @@ +{{ if .Values.postgres.enabled }} +apiVersion: stash.appscode.com/v1beta1 +kind: Task +metadata: + name: 'postgres-restore-18.2' + labels: + {{- include "stash-catalog.labels" . | nindent 4 }} +spec: + steps: + - name: postgres-restore-18.2 + params: + - name: outputDir + value: /stash-tmp/output + - name: update-status + params: + - name: outputDir + value: /stash-tmp/output +{{ end }}