From 797284ab4f9fcd96360552d5b3d48ff1fedbc48b Mon Sep 17 00:00:00 2001 From: Myasnikov Daniil Date: Mon, 1 Jun 2026 18:47:07 +0500 Subject: [PATCH] fix(platform): preserve no-delete label when migration 43 stamps version Address review feedback from lexfrei on migrations/43: the version stamp did a label-less `kubectl create configmap | kubectl apply` under the same field manager migration 42 used, stripping the platform.cozystack.io/no-delete label and dropping cozystack-version out of the deletion-protection guardrail on every upgrade through this migration. Replace it with a labeled heredoc manifest mirroring migration 42 so the label survives the stamp. Assisted-By: Claude Signed-off-by: Myasnikov Daniil --- .../platform/images/migrations/migrations/43 | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/packages/core/platform/images/migrations/migrations/43 b/packages/core/platform/images/migrations/migrations/43 index de49359b1..0c421d1fc 100755 --- a/packages/core/platform/images/migrations/migrations/43 +++ b/packages/core/platform/images/migrations/migrations/43 @@ -27,6 +27,21 @@ for ns in $(kubectl get cluster.postgresql.cnpg.io -A \ fi done -# Stamp version -kubectl create configmap -n cozy-system cozystack-version \ - --from-literal=version=44 --dry-run=client -o yaml | kubectl apply -f- +# Stamp version. +# Mirror migration 42's labeled manifest. A label-less apply by the same field +# manager (kubectl create | kubectl apply) would strip the +# platform.cozystack.io/no-delete label migration 42 added, dropping +# cozystack-version out of the cozystack-no-delete-guardrail +# ValidatingAdmissionPolicy. templates/cozystack-version.yaml only re-renders the +# labeled ConfigMap on first install, so the label must be carried inline here. +kubectl apply --filename - <