-
Notifications
You must be signed in to change notification settings - Fork 453
Enable "k0s status" on Windows workers #6719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
063218c to
a0d8253
Compare
C:\Users\Administrator> k0s status
Version: v1.34.1+k0s.0-272-gb9f57feaf
Process ID: 4028
Role: worker
Workloads: true
SingleNode: false
Kube-api probing successful: true
Kube-api probing last error: |
9bee0b9 to
0e285d5
Compare
|
Autopilot always uses the default socket path 🤔 ref: #6750 |
d3b08fd to
1353d86
Compare
1353d86 to
9242028
Compare
9242028 to
3f74aaa
Compare
Named pipes are now used for the status component on Windows. Autopilot has been changed to use the constant from the status package instead of defining a new constant. Note that autopilot currently breaks if you don't use the default status socket path, this needs to be fixed elsewhere. Signed-off-by: Kimmo Lehto <[email protected]>
The "k0s status" sub-command was not built into Windows binaries as the status compoennt did not yet run on windows. Signed-off-by: Kimmo Lehto <[email protected]>
3f74aaa to
95fa26f
Compare
twz123
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hot fuzz! 🌶️
| if cobraCmd != nil { | ||
| if val, err := cobraCmd.Flags().GetString("status-socket"); err == nil { | ||
| statusSocketPath = val | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not required, as it's done in WithCommand, which is being called later in this method?
| if cobraCmd != nil { | |
| if val, err := cobraCmd.Flags().GetString("status-socket"); err == nil { | |
| statusSocketPath = val | |
| } | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, looks like that, I followed what is done above with data-dir and kubelet-root-dir. I think the withCommand overwrites those too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it may be a larger can of worms and it could be better to fix separately as it applies to other flags too.
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
The client can be built universally, only the dialcontext needs to be different for linux/win. Co-authored-by: Tom Wieczorek <[email protected]> Signed-off-by: Kimmo Lehto <[email protected]>
Move listener creation from Init function to Start as Init is not supposed to create resources that need clean-up. Let httpserver.Shutdown handle closing of the listener. Signed-off-by: Kimmo Lehto <[email protected]>
The run-dir is forced to /run/k0s for root above so there's no need to re-check euid when building the socket path. Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
twz123
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
|
Successfully created backport PR for |
Description
Uses pipe based transport on Windows to serve and query the status component.
Fixes #2887
Type of change
How Has This Been Tested?
Checklist