-
Notifications
You must be signed in to change notification settings - Fork 715
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
windows: absolute paths do not work properly in config files #2419
Comments
/area windows |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
I'm also hitting this issue, you diff (https://gist.github.com/neolit123/1b7375c8a956155a2ca1cdd901336bce) looks good to me, can you help send it as a pull request? |
/remove-lifecycle stale |
have you tried the patch in your setup? |
I can pick up this. |
thanks for having a look. why is mutatePathsOnWindows panicing exactly? i recall this patch used to work for me and someone else who tested it, so i wonder what changed.
we should avoid adding OS specifics (GOOS checks) in the Default function. so perhaps there is another way to solve this. |
also might be best to send a PR for this (even if its failing in CI) and we can continue the discussion there, so that we have a better view of the DIFF. |
fixed in kubernetes/kubernetes#105992 |
Thanks for your help! |
on Windows there is a problem with the go standard library where the filepath.Abs() function
https://golang.org/pkg/path/filepath/#IsAbs
would return false for a path
/foo/bar
. this is by-design and is in a way correct, since absolute paths on Windows would normally need a drive letter - e.g.c:/foo/bar
. (note: \ vs / are interchangeable)yet, a path without a drive letter can still be considered absolute to the current drive.
this is hardcoded in client-go, kubelet and the rest of k8s where if you pass a path to a certificate in a kubeconfig file without a drive letter on windows it would assume a relative path and covert something like
/foo/bar/ca.crt
to/localpath/foo/bar/ca.crt
, causing errors.the problem was observed in KubeletConfiguration that kubeadm generates and shares between nodes, and the fix was in the lines of this:
https://gist.github.com/neolit123/1b7375c8a956155a2ca1cdd901336bce
but this has to be double checked.
a couple of more problems where this can happen are:
what kubeadm must do to properly support Windows paths without too much user interaction is to convert them by determining the local drive
/foo/bar/ca.crt
->c:/foo/bar/ca.crt
(example in the above gist)The text was updated successfully, but these errors were encountered: