fix: Report error if machine's associated node is not found during termination #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In gpu-provisioner, it takes quite a while for populating the provider id back the machine CR. If we delete the machine CR before node is shown up, the current code will remove the finializer even when the node is stilling being created.
In this change, we report error if machine's associated node is not found during termination so the terminiation will be reconciled until the node is shown up so that we will not leave any dangling node.
One caveat is that if the createAgentPool call fails, the machine also has no provider id. We leverage GC controller to remove the finalizer of the to-be-deleted machine if it has not been lanched for more than 10 minutes (mostly never succeed with retires).
Manual test