From aaf027b15f904110404a3c5cedaaac89c7bc6c53 Mon Sep 17 00:00:00 2001 From: git_admin Date: Tue, 28 Apr 2026 13:52:55 +0000 Subject: [PATCH] db-init: init BASE_INSTALLED= for set -u safety --- templates/odoo-deployment.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/templates/odoo-deployment.yaml b/templates/odoo-deployment.yaml index 3675d7e..6301792 100644 --- a/templates/odoo-deployment.yaml +++ b/templates/odoo-deployment.yaml @@ -84,6 +84,15 @@ spec: # check below skips the odoo step when base is already # installed — fresh deploys still bootstrap correctly # because base isn't installed in a brand-new database. + # Init both vars to "" so `set -u` doesn't crash when + # the schema query returns nothing (fresh DB case — + # ir_module_module doesn't exist yet, so the inner + # query block is skipped, leaving BASE_INSTALLED + # unset). Without this, db-init crashlooped on every + # fresh deploy with: "BASE_INSTALLED: parameter not + # set". + IS_INIT="" + BASE_INSTALLED="" IS_INIT=$(PGPASSWORD="$PASSWORD" psql -h "$HOST" -p "$PORT" -U "$USER" -d "$DBNAME" -tAc \ "SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='ir_module_module'" 2>/dev/null || true) if [ "$IS_INIT" = "1" ]; then