Skip to content

Conversation

@bobsira
Copy link
Contributor

@bobsira bobsira commented Nov 4, 2025

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 mixed filepath.Join (producing \ on Windows) with path.Join (always /), creating hybrid paths like \home\user\.minikube\profiles\minikube/client.crt. The tests (TestUpdateIP and TestMissingContext) 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:

  • Only affects path formatting for newly written certificate/key/CA paths.
  • No change to embedded cert data or other kubeconfig fields.
  • Cross‑platform safe (forward slashes are valid in kubeconfig on all OSes).

func TestUpdateIP(t *testing.T) {

func TestMissingContext(t *testing.T) {

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: bobsira
Once this PR has been reviewed and has the lgtm label, please assign medyagh for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from nirs and prezha November 4, 2025 15:13
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 4, 2025
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 4, 2025
@minikube-bot
Copy link
Collaborator

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())
Copy link
Member

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 ?

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants