From bf1ece5f7c4b8259d8be664607e64a52b07a501d Mon Sep 17 00:00:00 2001 From: Timofei Larkin Date: Wed, 15 Oct 2025 11:37:24 +0300 Subject: [PATCH] [platform] Better migration for 0.36.2->0.37.2+ For users upgrading from 0.36.2 directly to 0.37.2+, where the lineage-controller-webhook is broken out of the Cozystack controller into a separate daemonset, the existing migration script of 0.36->0.37.0 is insufficient. This patch ensures the presence of the new version of the lineage webhook and fixes a bug in the migration script where the readiness of the webhook was not appropriately verified. ```release-note [platform] Improved migration script when skipping versions 0.37.0 and 0.37.1 during upgrades. ``` Signed-off-by: Timofei Larkin --- scripts/migrations/20 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/migrations/20 b/scripts/migrations/20 index 7e306126..1a262ea7 100755 --- a/scripts/migrations/20 +++ b/scripts/migrations/20 @@ -26,9 +26,16 @@ cozypkg -n cozy-system -C packages/system/cozystack-resource-definition-crd appl cozypkg -n cozy-system -C packages/system/cozystack-resource-definitions apply cozystack-resource-definitions --plain cozypkg -n cozy-system -C packages/system/cozystack-api apply cozystack-api --plain helm upgrade --install -n cozy-system cozystack-controller ./packages/system/cozystack-controller/ --take-ownership +helm upgrade --install -n cozy-system lineage-controller-webhook ./packages/system/lineage-controller-webhook/ --take-ownership sleep 5 -timeout 60 sh -c 'until kubectl create service clusterip lineage-webhook-test --clusterip="None" --dry-run=server; do sleep 1; done' +kubectl delete ns cozy-lineage-webhook-test --ignore-not-found && kubectl create ns cozy-lineage-webhook-test +cleanup_test_ns() { + kubectl delete ns cozy-lineage-webhook-test --ignore-not-found +} +trap cleanup_test_ns ERR +timeout 60 sh -c 'until kubectl -n cozy-lineage-webhook-test create service clusterip lineage-webhook-test --clusterip="None" --dry-run=server; do sleep 1; done' +cleanup_test_ns kubectl wait deployment/cozystack-api -n cozy-system --timeout=4m --for=condition=available || exit 1 kubectl wait deployment/cozystack-controller -n cozy-system --timeout=4m --for=condition=available || exit 1