From 1c059b3ba31998fd511b76470aa85f032ec3d31c Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Wed, 20 May 2026 16:33:10 +0200 Subject: [PATCH] chore(platform): drop dashboard.cozystack.io CRDs via migration 40 Existing clusters still have the legacy dashboard.cozystack.io CRDs installed even after the dashboard controller has been removed. Add a platform migration that deletes them and bump targetVersion to 41. Co-Authored-By: Claude Signed-off-by: Andrei Kvapil --- .../platform/images/migrations/migrations/40 | 42 +++++++++++++++++++ packages/core/platform/values.yaml | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100755 packages/core/platform/images/migrations/migrations/40 diff --git a/packages/core/platform/images/migrations/migrations/40 b/packages/core/platform/images/migrations/migrations/40 new file mode 100755 index 000000000..9421c64cb --- /dev/null +++ b/packages/core/platform/images/migrations/migrations/40 @@ -0,0 +1,42 @@ +#!/bin/sh +# Migration 40 --> 41 +# Remove obsolete dashboard.cozystack.io CRDs left over from the dashboard +# controller, which is no longer part of Cozystack. +# +# The dashboard controller used to project ApplicationDefinitions into a set +# of dashboard.cozystack.io CRs (Sidebar, Factory, Navigation, Breadcrumb, +# CustomFormsOverride, CustomFormsPrefill, CustomColumnsOverride, +# MarketplacePanel, TableUriMapping, CFOMapping, BreadcrumbInside) consumed +# by the legacy UI. cozystack-ui now reads ApplicationDefinitions directly, +# so both the controller and the CRDs are dead. The chart no longer ships +# these CRDs, but existing clusters still have them installed — delete them +# explicitly here so they do not stay around as orphans. + +set -euo pipefail + +CRDS=" +breadcrumbs.dashboard.cozystack.io +breadcrumbsinside.dashboard.cozystack.io +cfomappings.dashboard.cozystack.io +customcolumnsoverrides.dashboard.cozystack.io +customformsoverrides.dashboard.cozystack.io +customformsprefills.dashboard.cozystack.io +factories.dashboard.cozystack.io +marketplacepanels.dashboard.cozystack.io +navigations.dashboard.cozystack.io +sidebars.dashboard.cozystack.io +tableurimappings.dashboard.cozystack.io +" + +for CRD in $CRDS; do + if kubectl get crd "$CRD" >/dev/null 2>&1; then + echo "Deleting CRD $CRD" + kubectl delete crd "$CRD" --ignore-not-found=true --wait=false + else + echo "CRD $CRD not found, skipping" + fi +done + +# Stamp version +kubectl create configmap -n cozy-system cozystack-version \ + --from-literal=version=41 --dry-run=client -o yaml | kubectl apply -f- diff --git a/packages/core/platform/values.yaml b/packages/core/platform/values.yaml index 229392907..e7877a4cf 100644 --- a/packages/core/platform/values.yaml +++ b/packages/core/platform/values.yaml @@ -6,7 +6,7 @@ sourceRef: migrations: enabled: false image: ghcr.io/cozystack/cozystack/platform-migrations:v1.4.0-rc.2@sha256:17390197a9b11d76a8dd1b24c6d1512adb7d3226b28b5bcba8551b14b1ec4be0 - targetVersion: 40 + targetVersion: 41 # Bundle deployment configuration bundles: system: