diff --git a/class/defaults.yml b/class/defaults.yml index 95a174a7..50d0cd69 100644 --- a/class/defaults.yml +++ b/class/defaults.yml @@ -252,8 +252,12 @@ parameters: registry: quay.io # TODO: Rename master to primary when upgrading to Postgres 11 https://github.com/bitnami/charts/commit/7eabc85fd4fae43127228a22829c7ce3fe85c389 master: - annotations: - k8up.syn.tools/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER" PGPASSWORD="$POSTGRES_PASSWORD" pg_dump' + podAnnotations: + # Annotations to support both K8up v1 and v2 + k8up.syn.tools/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER" PGPASSWORD="$POSTGRES_PASSWORD" pg_dump --clean' + k8up.syn.tools/file-extension: .sql + k8up.io/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER" PGPASSWORD="$POSTGRES_PASSWORD" pg_dump --clean' + k8up.io/file-extension: .sql labels: ${keycloak:labels} volumePermissions: enabled: ${keycloak:database:tls:enabled} diff --git a/tests/golden/builtin/builtin/builtin/01_keycloak_helmchart/keycloak/charts/postgresql/templates/statefulset.yaml b/tests/golden/builtin/builtin/builtin/01_keycloak_helmchart/keycloak/charts/postgresql/templates/statefulset.yaml index 6592ce5e..6bda1377 100644 --- a/tests/golden/builtin/builtin/builtin/01_keycloak_helmchart/keycloak/charts/postgresql/templates/statefulset.yaml +++ b/tests/golden/builtin/builtin/builtin/01_keycloak_helmchart/keycloak/charts/postgresql/templates/statefulset.yaml @@ -1,9 +1,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: - annotations: - k8up.syn.tools/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER" - PGPASSWORD="$POSTGRES_PASSWORD" pg_dump' + annotations: null labels: app.kubernetes.io/component: keycloak app.kubernetes.io/instance: builtin @@ -21,6 +19,13 @@ spec: serviceName: keycloak-postgresql-headless template: metadata: + annotations: + k8up.io/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER" + PGPASSWORD="$POSTGRES_PASSWORD" pg_dump --clean' + k8up.io/file-extension: .sql + k8up.syn.tools/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER" + PGPASSWORD="$POSTGRES_PASSWORD" pg_dump --clean' + k8up.syn.tools/file-extension: .sql labels: app.kubernetes.io/instance: keycloak app.kubernetes.io/managed-by: Helm