Files
cozystack/packages
IvanHunters 6ccd1ed8c4 fix(kubernetes-nodes): tolerate a missing KMT CRD in the pre-delete unpin hook
The unpin hook listed KubevirtMachineTemplates under set -eu with no
missing-CRD carve-out, unlike migration 54's list_kmts. During a
management-cluster CAPI teardown or an already-Terminating namespace the CRD
can be gone; the list then exits non-zero, the Job fails, and after
backoffLimit the HelmRelease finalizer wedges cluster deletion on a resource
type that no longer exists.

Distinguish a missing CRD (skip: nothing to unpin) from a real API/RBAC
failure (still exit 1) by kubectl's two deterministic RESTMapper messages,
mirroring list_kmts. stderr is folded into the captured output only because
the strict <BASE>-<6hex> grep cannot match a warning line.

Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2026-08-03 23:04:09 +03:00
..