This prevents k0s from hanging on idle network connections, such as random glitches, badly behaving load balancers, and so on.
Add a context to the JoinClient methods and call them with a context that times out after 10 seconds when joining a controller. This has the side effect that joining will also be interruptible by SIGTERM and Ctrl+C.
Fixes #4557.
Type of change
[x] 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?
[x] Manual test
[x] Auto test added
Checklist:
[x] My code follows the style guidelines of this project
Description
This prevents k0s from hanging on idle network connections, such as random glitches, badly behaving load balancers, and so on.
Add a context to the
JoinClient
methods and call them with a context that times out after 10 seconds when joining a controller. This has the side effect that joining will also be interruptible by SIGTERM and Ctrl+C.Fixes #4557.
Type of change
How Has This Been Tested?
Checklist: