Skip to content

Conversation

@twz123
Copy link
Member

@twz123 twz123 commented Oct 31, 2025

Description

The k0s api subcommand didn't have any context handling or graceful shutdown logic in general. Since k0s now has a global shutdown context, the join API process no longer terminates on the first SIGTERM. Fortunately, the signal handler is unregistered after the first received signal, so a subsequent signal finally terminates the process forcefully.

Implement a proper graceful termination process for the join API HTTP server.

Fixes:

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Manual test
  • Auto test added

Checklist

  • My code follows the style guidelines of this project
  • My commit messages are signed-off
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

The k0s api subcommand didn't have any context handling or graceful
shutdown logic in general. Since k0s now has a global shutdown
context, the join API process no longer terminates on the first
SIGTERM. Fortunately, the signal handler is unregistered after the first
received signal, so a subsequent signal finally terminates the process
forcefully.

Implement a proper graceful termination process for the join API HTTP
server.

Fixes: 65f92d9 ("Use a global context that reacts to OS shutdown requests")
Signed-off-by: Tom Wieczorek <[email protected]>
@twz123 twz123 added bug Something isn't working area/controlplane backport/release-1.34 PR that needs to be backported/cherrypicked to the release-1.34 branch labels Oct 31, 2025
@twz123 twz123 marked this pull request as ready for review October 31, 2025 14:30
@twz123 twz123 requested review from a team as code owners October 31, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/controlplane backport/release-1.34 PR that needs to be backported/cherrypicked to the release-1.34 branch bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant