Skip to content

Fix minikube image load on windows (#20529) #20921

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

james-world
Copy link

fixes #20529

getWindowsVolumeNameCmd uses the deprecated wmic.exe, this breaks minikube image load on newer installs of windows. Whilst wmic.exe can be added, it will be removed from Windows 11 soon.

See here for details.

This fix replaces the use of wmic.exe with a call to the Powershell equivalent.

Copy link

linux-foundation-easycla bot commented Jun 10, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: james-world / name: James World (e17b3f4)

@k8s-ci-robot k8s-ci-robot requested a review from medyagh June 10, 2025 09:55
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: james-world
Once this PR has been reviewed and has the lgtm label, please assign spowelljr 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 a review from spowelljr June 10, 2025 09:55
@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jun 10, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @james-world!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 10, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @james-world. Thanks for your PR.

I'm waiting for a kubernetes 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/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 10, 2025
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 10, 2025
@james-world james-world changed the title Fix minikube load on windows (#20529) Fix minikube image load on windows (#20529) Jun 10, 2025
@james-world james-world force-pushed the fix-20529 branch 2 times, most recently from 7a66934 to 211296e Compare June 12, 2025 10:27
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 12, 2025
@james-world james-world requested a review from medyagh June 12, 2025 20:44
@gabrielgbs97
Copy link

If powershell.exe is not available in PATH (it should be...) it can be discovered via SystemRoot env variable:
'%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

@spowelljr spowelljr removed their request for review June 26, 2025 23:50
@james-world
Copy link
Author

OK, sorry for the hiatus - been busy at work. @medyagh I've removed the fallback as discussed and added code to robustly discover Powershell.exe, using the cited approaches.

@medyagh
Copy link
Member

medyagh commented Jul 9, 2025

thank you @james-world, let me ask @bobsira for last approve and then we can merge it
@bobsira can you plz test this on windows and see if it fixes the issue?

Copy link

@bobsira bobsira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this on Windows machine, works fine! Approved @medyagh

Had a successful run with the changes,

`C:\dev\minikube\out>minikube.exe image load nginx:latest --alsologtostderr I0714 02:30:21.918732 24816 out.go:345] Setting OutFile to fd 96 ... I0714 02:30:21.949424 24816 out.go:392] TERM=,COLORTERM=, which probably does not support color I0714 02:30:21.949424 24816 out.go:358] Setting ErrFile to fd 100... I0714 02:30:21.950091 24816 out.go:392] TERM=,COLORTERM=, which probably does not support color I0714 02:30:21.969639 24816 config.go:182] Loaded profile config "minikube": Driver=hyperv, ContainerRuntime=docker,
KubernetesVersion=v1.33.2

=== some of the logs removed to have this fit in the comment

I0714 02:30:36.438734 24816 cache_images.go:123] Successfully loaded all cached images I0714 02:30:36.438734 24816 cache_images.go:92] duration metric: took 5.9631078s to LoadCachedImages I0714 02:30:36.439366 24816 cache_images.go:262] succeeded pushing to: minikube `

@medyagh
Copy link
Member

medyagh commented Jul 14, 2025

@james-world plz see last comments and then we can merge this

getWindowsVolumeNameCmd uses the deprecated wmic.exe.

See https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmic for
details.

Replace the implementation with a call to the Powershell equivalent.

Look in path and system environment vars to locate Powershell.

Improve Powershell discovery
@james-world
Copy link
Author

@medyagh Added the requested comment.

@james-world james-world requested a review from medyagh July 16, 2025 01:42
@medyagh
Copy link
Member

medyagh commented Jul 21, 2025

thank you @james-world

@medyagh
Copy link
Member

medyagh commented Jul 21, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 21, 2025
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20921 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 49.5s    │ 50.5s                  │
│ enable ingress │ 15.0s    │ 15.3s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 49.2s 50.9s 48.2s 48.4s 50.8s
Times for minikube (PR 20921) start: 49.3s 48.8s 49.4s 52.7s 52.3s

Times for minikube ingress: 15.0s 15.0s 15.0s 14.9s 14.9s
Times for minikube (PR 20921) ingress: 15.1s 15.0s 15.5s 15.9s 15.0s

docker driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20921 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 23.9s    │ 23.2s                  │
│ enable ingress │ 12.3s    │ 12.5s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 25.2s 22.3s 21.8s 26.9s 23.1s
Times for minikube (PR 20921) start: 23.0s 24.3s 25.2s 21.4s 22.2s

Times for minikube ingress: 10.7s 12.7s 12.7s 12.7s 12.7s
Times for minikube (PR 20921) ingress: 12.2s 12.7s 11.2s 13.8s 12.7s

docker driver with containerd runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20921 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 23.4s    │ 22.4s                  │
│ enable ingress │ 29.2s    │ 24.4s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 24.1s 24.1s 23.5s 21.0s 24.1s
Times for minikube (PR 20921) start: 20.6s 25.2s 21.2s 22.9s 22.2s

Times for minikube ingress: 22.7s 38.8s 38.7s 23.3s 22.7s
Times for minikube (PR 20921) ingress: 22.7s 22.7s 22.7s 31.2s 22.7s

@rata
Copy link
Member

rata commented Jul 23, 2025

The failures seem unrelated to this PR (failed to pull an image)

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

minikube image load my-local-image:latest ❌ Exiting due to GUEST_IMAGE_LOAD
8 participants