mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-22 12:43:32 +09:00
Follow-up to the KCP normalize commit: Helm-controller's SSA-based apply also does not delete namespaced Secrets and cozy-realm Keycloak resources when the new manifest omits them — the resources stay as ghost owner-labeled-by-Helm objects. The dashboard picks them up (via the cozyrds `secrets.include` list) and shows the placeholder kubeconfig even for clusters where OIDC was explicitly turned off. Extend the `mode=None` normalize path to also `kubectl delete`: - `<release>-oidc-kubeconfig` Secret - `<release>-oidc-authn-config` Secret - `<namespace>-<release>` KeycloakClient in the cozy realm - `<namespace>-<release>-audience` KeycloakClientScope The delete verbs are added to the release-owned Role scoped to the specific resourceNames (Secrets) and the API group (Keycloak — the EDP operator does not support resourceNames on cluster-scoped-ish CRDs). No new privileges beyond what the chart itself would need to render these objects. Together with the previous KCP-normalize commit, `mode=System → mode=None` now leaves ZERO chart-owned OIDC leftovers. Signed-off-by: Ivan Okhotnikov <ivan.okhotnikov@aenix.io>
How to test packages local
cd packages/core/installer
make image-cozystack REGISTRY=YOUR_CUSTOM_REGISTRY
make apply
kubectl delete po -l app=source-controller -n cozy-fluxcd