forked from filanov/cluster-api-provider-agent
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MGMT-10968: Replace agentmachine finalizer with machine pre-delete ho…
…ok (#54) * Update assisted-service api and models to latest * Watch for updates to machines related to an agentmachine * Return machine from newAgentMachine test helper * Replace agentmachine finalizer with machine pre-delete hook Previously when a machine was deleted CAPI would cordon/drain the node, then wait on the finalizer for our agentmachine resource. This chain of events doesn't allow assisted-service time to run a pod on the node to reboot it into discovery. This commit adds a PreTerminateDeleteHook to the machine resource instead of a finalizer on the agent machine. When the agentmachine controller sees that the machine is waiting on the hook, it unbinds the agent and waits for the assisted-service to complete the reclaim work. Once the reclaim has completed or failed, the agentmachine controller removes the hook annotation. This requires specifically the PreTerminateDeleteHook rather than the PreDrain one because once we start the agent on the cluster we won't get a chance to drain the node before it is rebooted into discovery. https://issues.redhat.com/browse/MGMT-10968
- Loading branch information
Showing
47 changed files
with
2,236 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.