Skip to content

fix infra provider: add goroutine to handle remotemachine deletion when provisioning…#1303

Merged
apedriza merged 1 commit intok0sproject:mainfrom
apedriza:fix-rm-release
Nov 28, 2025
Merged

fix infra provider: add goroutine to handle remotemachine deletion when provisioning…#1303
apedriza merged 1 commit intok0sproject:mainfrom
apedriza:fix-rm-release

Conversation

@apedriza
Copy link
Contributor

@apedriza apedriza commented Nov 24, 2025

… hangs

If a provisioning command hangs, another reconcile cycle for the same resource cannot run (for example triggered by the MHC). This prevents to reconcile the deletion and thus to release back a VM to the pool.

Remediation e2e covers this case, I will try to add e2e working with k0smotron infra provider soon

@apedriza apedriza changed the title fix: add goroutine to handle remotemachine deletion when provisioning… fix infra provider: add goroutine to handle remotemachine deletion when provisioning… Nov 24, 2025
Comment on lines +143 to +145
// +kubebuilder:printcolumn:name="Address",type=string,JSONPath=".spec.machine.address",description="IP address or DNS name of the remote machine"
// +kubebuilder:printcolumn:name="Reserved",type=string,JSONPath=".status.reserved",description="Indicates if the machine is reserved"
// +kubebuilder:printcolumn:name="Remote Machine",type=string,JSONPath=".status.machineRef.name",description="Reference to the RemoteMachine"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is useful to display this info related to the pool for debugging propuses

@apedriza apedriza marked this pull request as ready for review November 25, 2025 09:11
@apedriza apedriza requested a review from a team as a code owner November 25, 2025 09:11
@apedriza apedriza marked this pull request as draft November 25, 2025 16:53
@apedriza apedriza marked this pull request as ready for review November 27, 2025 10:18
// the bootstrap process hangs and the controller needs to be able to delete the RemoteMachine. Controller-runtime
// only runs one Reconcile at a time per object, so we need to monitor deletion in a separate goroutine.
go func() {
for {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I would rather prefer time.Ticker since it's exactly for this purpose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed, thanks!

… hangs

Signed-off-by: apedriza <adripedriza@gmail.com>
@apedriza apedriza merged commit c42cb32 into k0sproject:main Nov 28, 2025
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants