Problem
deleteIfExists treats an accepted delete request as completed teardown. The ClusterInstance controller can then remove its finalizer while backing resources with their own finalizers still exist. The pool reuses deterministic instance names, so a replacement can encounter the old HostedCluster, VM, or disk while deletion is still in progress.
This can cause stale readiness, name conflicts, or incorrect resource reuse between lease cycles.
References
internal/controller/helpers.go:42-54
internal/controller/clusterinstance_controller.go:613-627
internal/controller/clusterinstance_hypershift.go:411-435
internal/controller/clusterpool_controller.go:531-547
Suggested direction
Make teardown distinguish complete deletion from a delete request that is still pending. Keep the ClusterInstance finalizer and requeue until backing objects whose names will be reused are absent.
Tests
Add a backing object with a finalizer and verify that the ClusterInstance remains until the object is gone.
Problem
deleteIfExiststreats an accepted delete request as completed teardown. The ClusterInstance controller can then remove its finalizer while backing resources with their own finalizers still exist. The pool reuses deterministic instance names, so a replacement can encounter the old HostedCluster, VM, or disk while deletion is still in progress.This can cause stale readiness, name conflicts, or incorrect resource reuse between lease cycles.
References
internal/controller/helpers.go:42-54internal/controller/clusterinstance_controller.go:613-627internal/controller/clusterinstance_hypershift.go:411-435internal/controller/clusterpool_controller.go:531-547Suggested direction
Make teardown distinguish complete deletion from a delete request that is still pending. Keep the ClusterInstance finalizer and requeue until backing objects whose names will be reused are absent.
Tests
Add a backing object with a finalizer and verify that the ClusterInstance remains until the object is gone.