Files
cozystack/packages
Myasnikov Daniil c7227bc666 feat(platform): migration 42 backfills no-delete label on cozystack-version
Address review feedback from coderabbitai on
packages/core/platform/templates/cozystack-version.yaml:10:
existing clusters skipped the label because the template's
`lookup`+`if not $configMap` guard never re-renders the ConfigMap on
upgrade (the skip is intentional — it prevents helm from clobbering the
data.version that the migration controller writes from its pre-upgrade
hook).

A one-shot migration is the correct mechanism here:

  - Migration 42 in packages/core/platform/images/migrations/migrations/42
    runs `kubectl label --overwrite configmap cozystack-version
    platform.cozystack.io/no-delete=true` and stamps version=43. Slot 42
    rather than 40 because main already occupies 40 (dashboard CRD
    cleanup) and 41 (kubernetes ephemeralStorage→diskSize rename).
  - Bump migrations.targetVersion 42 -> 43 so the hook fires on the
    next platform upgrade.

Idempotent: --overwrite is a no-op when the label is already at the
target value, MIGRATION_DRY_RUN=1 prints without applying, and the
script aborts before stamping if the kubectl label call fails.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-05-26 15:12:52 +05:00
..