tinkerbell / cluster-api-provider-tinkerbell

Cluster API Infrastructure Provider
Apache License 2.0
91 stars 35 forks source link

TinkerbellMachine's cannot be deleted when the bound Hardware doesn't exist #368

Open chrisdoherty4 opened 3 months ago

chrisdoherty4 commented 3 months ago

If you delete a Hardware object that's used by a TinkerbellMachine object the TinkerbellMachine controller errors out and never removes the finalizer preventing it from ever being deleted.

Expected Behaviour

Deleting a TinkerbellMachine object that's bound to a deleted Hardware object is removed.

Current Behaviour

When reconciling a deleted TinkerbellMachine resource CAPT retrieves the Hardware. If the hardware fails to be retrieved it will return an error and the TinkerbellMachine never has its finalizer removed, therefore is never deleted from Kubernetes and blocks deletion of all owning resources (e.g. CAPI Machine, CAPI Cluster etc).

Possible Solution

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Context

Your Environment