Skip to content

Commit af96e3d

Browse files
authored
[platform] Better migration for 0.36.2->0.37.2+ (#1521)
## What this PR does 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 ```release-note [platform] Improved migration script when skipping versions 0.37.0 and 0.37.1 during upgrades. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Automatically installs the lineage-controller webhook via Helm during setup, aligning its deployment with existing controller components. * **Chores** * Adds a temporary namespace for preflight validation of the webhook service to avoid cluster-wide side effects. * Replaces cluster-scoped dry-run checks with namespace-scoped dry-run and ensures cleanup and timeout-based waits for predictable installation. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents ea85856 + bf1ece5 commit af96e3d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • scripts/migrations

‎scripts/migrations/20‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,16 @@ cozypkg -n cozy-system -C packages/system/cozystack-resource-definition-crd appl
2626
cozypkg -n cozy-system -C packages/system/cozystack-resource-definitions apply cozystack-resource-definitions --plain
2727
cozypkg -n cozy-system -C packages/system/cozystack-api apply cozystack-api --plain
2828
helm upgrade --install -n cozy-system cozystack-controller ./packages/system/cozystack-controller/ --take-ownership
29+
helm upgrade --install -n cozy-system lineage-controller-webhook ./packages/system/lineage-controller-webhook/ --take-ownership
2930

3031
sleep 5
31-
timeout 60 sh -c 'until kubectl create service clusterip lineage-webhook-test --clusterip="None" --dry-run=server; do sleep 1; done'
32+
kubectl delete ns cozy-lineage-webhook-test --ignore-not-found && kubectl create ns cozy-lineage-webhook-test
33+
cleanup_test_ns() {
34+
kubectl delete ns cozy-lineage-webhook-test --ignore-not-found
35+
}
36+
trap cleanup_test_ns ERR
37+
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'
38+
cleanup_test_ns
3239

3340
kubectl wait deployment/cozystack-api -n cozy-system --timeout=4m --for=condition=available || exit 1
3441
kubectl wait deployment/cozystack-controller -n cozy-system --timeout=4m --for=condition=available || exit 1

0 commit comments

Comments
 (0)