fix: thread StatusSocketPath through autopilot controllers#7605
fix: thread StatusSocketPath through autopilot controllers#7605kimjune01 wants to merge 2 commits into
Conversation
Autopilot hardcoded status.DefaultSocketPath in multiple controllers, breaking --status-socket and custom --run-dir configurations. Thread StatusSocketPath from CfgVars through RootConfig into signal controllers (restart, restarted, version handler), and the cron updater. Fall back to DefaultSocketPath when StatusSocketPath is empty. Fixes k0sproject#6750 Signed-off-by: June Kim <kimjune01@gmail.com>
|
Thanks! Were you able to test this? |
|
No runtime testing yet. The verification was through manual code inspection of the call chain. I can set up a test configuration with --status-socket if that would be helpful for validating the fix. |
|
Yes, I've now run the full autopilot unit test suite locally against this branch:
What I haven't tested: running an actual k0s cluster with |
You could parameterize one of the existing integration tests to use a custom run dir and a custom status socket. Not sure if it even has to be a multi-node cluster that gets updated? At least for the status socket, the code looks like it should fail for a single node cluster, as well, AFAICT. I'd try to add a variant for, say, the |
… run-dir Adds a K0S_INTTEST_TARGET=ap-single-custom-socket variant to the existing ap-single integration test. When invoked under that target, the controller is launched with --status-socket=/run/k0s/custom/status.sock and --data-dir=/var/lib/k0s-custom, exercising the StatusSocketPath plumbing that the parent commit threads through the autopilot signal controllers. After the k0supdate Plan completes, the test cross-checks (defense against known issue k0sproject#3719) that the custom socket file exists and the default /run/k0s/status.sock does not. With the previous hardcoded-default-socket behavior, autopilot's post-restart status probe would have created or contacted the default path. The new check target reuses the ap-single test package and is wired into the smoketests list so CI picks it up. Refs k0sproject#6750 Signed-off-by: June Kim <kimjune01@gmail.com>
|
Pushed 6a6574c parameterizing Verified locally: |
|
This pull request has merge conflicts that need to be resolved. |
Description
Autopilot hardcoded
status.DefaultSocketPathin multiple controllers, breaking--status-socketand custom--run-dirconfigurations. The socket path configured viaCfgVars.StatusSocketPathwas never threaded through to autopilot's signal controllers or the cron updater.This adds
StatusSocketPathtoRootConfigand passes it through:signal.RegisterControllers→k0s.RegisterControllersrestart/restartedreconcilers (version check and PID lookup)updates.RegisterControllers→newCronUpdater(status info fetch)Falls back to
status.DefaultSocketPathwhenStatusSocketPathis empty, preserving existing behavior for default configurations.Fixes #6750
Type of change
How Has This Been Tested?
Verified the
StatusSocketPathpropagation manually by tracing the call chain fromcomponent/controller/autopilot.goandcomponent/worker/autopilot.gothrough to each consumer. All previously hardcodedstatus.DefaultSocketPathreferences are replaced with the threaded value.Checklist: