-
Notifications
You must be signed in to change notification settings - Fork 5.1k
kubeconfig: normalize generated cert paths to forward slashes #21845
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
base: master
Are you sure you want to change the base?
kubeconfig: normalize generated cert paths to forward slashes #21845
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: bobsira The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Hi @bobsira. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Can one of the admins verify this patch? |
| func populateCerts(kcs *Settings, cfg api.Config, contextName string) { | ||
| lp := localpath.Profile(contextName) | ||
| gp := localpath.MiniPath() | ||
| gp := filepath.ToSlash(localpath.MiniPath()) |
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.
@bobsira I am curious have you explored or investigated that if we can just add filepath.ToSlash to the "localpath" funcs ? would that break anything ?
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 have no exlopred this but I believe adding filepath.ToSlash inside the localpath functions would introduce new mixed‑separator paths elsewhere and could re‑break the kubeconfig tests.
This PR normalizes generated kubeconfig certificate paths by converting any Windows backslashes to forward slashes when building new entries in
populateCerts (kubeconfig.go). Prior logic mixedfilepath.Join(producing \ on Windows) withpath.Join(always /), creating hybrid paths like\home\user\.minikube\profiles\minikube/client.crt. The tests (TestUpdateIPandTestMissingContext) compare kubeconfig objects via raw string equality (configEquals), so those mixed separators caused mismatches only on Windows.It Fixes These Two Tests:
TestUpdateIP: When adding or updating the minikube cluster/user entries, normalized paths now match the forward‑slash fixtures (kubeConfigWithoutHTTPSUpdated, etc.), eliminating false diffs.TestMissingContext: Rewriting the missing context also regenerates cluster/user entries; normalized paths prevent separator differences from triggering a failure.Scope:
minikube/pkg/minikube/kubeconfig/kubeconfig_test.go
Line 399 in 87ccec3
minikube/pkg/minikube/kubeconfig/kubeconfig_test.go
Line 494 in 87ccec3