From 2ae8f5343eab74f15222d7ae0c7606e545685ebc Mon Sep 17 00:00:00 2001 From: Tower Deploy Date: Fri, 15 May 2026 07:37:16 +0200 Subject: [PATCH] feat(chart): backup CronJob keys S3 off instance.id (code fallback) --- Chart.yaml | 2 +- templates/backup-cronjob.yaml | 8 +++++++- values.yaml | 7 +++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index c45999a..9ce7869 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -5,7 +5,7 @@ description: | Variation between instances is expressed via values.yaml only. No chart variants. No string-templating in Tower. type: application -version: 0.1.11 +version: 0.1.12 appVersion: "1.0" keywords: - odoo diff --git a/templates/backup-cronjob.yaml b/templates/backup-cronjob.yaml index f8389c3..ad19958 100644 --- a/templates/backup-cronjob.yaml +++ b/templates/backup-cronjob.yaml @@ -108,8 +108,14 @@ spec: value: {{ .Values.backups.s3.region | quote }} - name: S3_BUCKET value: {{ .Values.backups.s3.bucket | quote }} + # S3_PREFIX -- the instance's durable identity. Prefer + # instance.id (`-`, unique per lifetime, + # written by Tower at create + backfill); fall back to + # the bare code for overlays not yet carrying an id + # (transition window). Once every overlay has an id the + # fallback is dead and can be dropped. - name: S3_PREFIX - value: {{ .Values.instance.code | quote }} + value: {{ .Values.instance.id | default .Values.instance.code | quote }} - name: RETAIN value: {{ .Values.backups.retain | quote }} command: diff --git a/values.yaml b/values.yaml index 8f7e648..5d39118 100644 --- a/values.yaml +++ b/values.yaml @@ -9,6 +9,13 @@ instance: # Short slug used in K8s object names + as the Helm release name. # Must be DNS-safe (lowercase, no underscores, <= 40 chars). code: demo + # id -- durable instance identity, `-`. Written by + # Tower at create time (and backfilled onto existing instances). + # The backup CronJob uses it as the S3 key prefix so a deleted + + # recreated instance never inherits the previous one's snapshots. + # Empty in a bare `helm template` lint -- the CronJob falls back to + # `code` then. + id: "" # The full HTTPS hostname this instance answers on. # Tenants live under *.tenants.odoosky.org (covered by wildcard DNS A). domain: demo.tenants.odoosky.org