mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-22 20:53:52 +09:00
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>