8000 vmnet: Fix brew install path on Intel Macs and support brew bin path by nirs · Pull Request #23039 · kubernetes/minikube · GitHub
[go: up one dir, main page]

Skip to content

vmnet: Fix brew install path on Intel Macs and support brew bin path - #23039

Merged
nirs merged 4 commits into
kubernetes:masterfrom
nirs:vmnet-brew-bin
Jun 13, 2026
Merged

nirs merged 4 commits into
kubernetes:masterfrom
nirs:vmnet-brew-bin

Conversation

@nirs
@nirs nirs commented May 24, 2026
Copy link
Copy Markdown
Member

Fix brew path on Intel Macs and support brew bin path for vmnet-helper v1.0.0.

  • Fix brew install path on Intel Macs: the brew path was hardcoded to
    /opt/homebrew which is only correct on Apple Silicon. Add
    detect.BrewPrefix() returning the correct Homebrew prefix for the
    current architecture.

  • Search brew install path only on macOS 26+: Homebrew is the
    recommended install method only on macOS 26 and later. On older macOS
    versions only the legacy install path is searched.

  • Support vmnet-helper brew install in bin: vmnet-helper >= 1.0 will
    install to the brew bin directory instead of libexec. Search the new
    bin path first, falling back to the current libexec path for older
    versions.

Fixes #23038
Fixes #22915

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nirs

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@nirs
nirs removed the request for review from ComradeProgrammer May 24, 2026 15:19
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 24, 2026
@nirs
nirs requested a review from afbjorklund May 24, 2026 15:20
@nirs
nirs commented May 24, 2026
Copy link
Copy Markdown
Member Author

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label May 24, 2026
@minikube-pr-bot

This comment has been minimized.

Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates vmnet-helper discovery on macOS to support Homebrew installs on both Intel and Apple Silicon, and to handle vmnet-helper v1.0.0 moving from libexec to bin. It also limits Homebrew-path probing to macOS 26+ where Homebrew is the recommended install method.

Changes:

  • Add detect.BrewPrefix() to choose the default Homebrew prefix based on architecture.
  • Update vmnet-helper lookup to (on macOS 26+) prefer <brewPrefix>/bin/vmnet-helper, then fall back to <brewPrefix>/opt/vmnet-helper/libexec/vmnet-helper, and finally the legacy /opt/vmnet-helper/bin/vmnet-helper.
  • Parse macOS version once and pass a semver.Version through helper selection and sudo-requirement logic; update unit tests accordingly.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
pkg/minikube/detect/detect.go Adds BrewPrefix() for Homebrew prefix selection.
pkg/drivers/common/vmnet/vmnet.go Updates vmnet-helper path discovery to support Intel prefix + bin/libexec locations and gates Homebrew probing on macOS 26+.
pkg/drivers/common/vmnet/vmnet_test.go Adjusts tests to match the new semver.Version macOS version plumbing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/drivers/common/vmnet/vmnet.go Resolved
Comment thread pkg/minikube/detect/detect.go Resolved
Comment thread pkg/drivers/common/vmnet/vmnet.go Resolved
@medyagh medyagh left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I noticed we used homebrew in other parts of code like qemu
for example qemuFirmwarePath

is that possible or should we use it there too ?

Comment thread pkg/drivers/common/vmnet/vmnet.go Resolved
@nirs
8000
nirs commented May 29, 2026
Copy link
Copy Markdown
Member Author

I noticed we used homebrew in other parts of code like qemu for example qemuFirmwarePath

is that possible or should we use it there too ?

We can use this for qemu firmware path and socket_vment. I can do a followup after we finish with 1.39.

@nirs
nirs force-pushed the vmnet-brew-bin branch from 1a68bb8 to 31b7163 Compare May 29, 2026 23:28
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 29, 2026
@nirs
nirs requested a review from medyagh May 29, 2026 23:30
@nirs
nirs commented May 29, 2026
Copy link
Copy Markdown
Member Author

@medyagh Copilot comments addressed

nirs added 4 commits May 30, 2026 03:44
The brew install path was hardcoded to /opt/homebrew which is only
correct on Apple Silicon. On Intel Macs Homebrew uses /usr/local.

Add detect.BrewPrefix() returning the default Homebrew prefix for the
current OS and architecture. Returns an empty string on unsupported
platforms (e.g. Windows). Use it to build the vmnet-helper brew path.
Homebrew is the recommended install method only on macOS 26 and later.
On older macOS versions only the legacy install path should be searched.

Parse the macOS version once in getHelperInfo() and pass the parsed
semver.Version to both findHelper() and helperNeedsSudo(), avoiding
redundant parsing.
vmnet-helper >= 1.0 will install to the brew bin directory instead of
libexec. Search the new bin path first, falling back to the current
libexec path for older versions.
Split vmnet-helper path construction from findHelper() into
helperSearchPaths(). findHelper() now only searches the returned paths
in order; helperSearchPaths() builds the list based on macOS version
and Homebrew prefix.

This makes the expected search order explicit and testable without
touching the filesystem or requiring vmnet-helper to be installed.

Add TestHelperSearchPaths with static expected paths for:
- macOS 15: legacy install path only
- macOS 26: brew bin and libexec paths, then legacy fallback

Intel and Apple Silicon brew prefixes are covered via runtime.GOARCH
in the test expectations.
@nirs
nirs force-pushed the vmnet-brew-bin branch from 31b7163 to a9c608c Compare May 30, 2026 00:44
@minikube-pr-bot
Copy link
Copy Markdown

kvm2 driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 23039 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 40.0s    │ 39.5s                  │
│ enable ingress │ 19.4s    │ 19.9s                  │
└────────────────┴──────────┴────────────────────────┘
Details

Times for minikube start: 41.9s 40.0s 40.1s 39.1s 39.1s
Times for minikube (PR 23039) start: 39.4s 38.4s 40.7s 39.4s 39.6s

Times for minikube ingress: 19.3s 19.3s 19.3s 18.8s 20.4s
Times for minikube (PR 23039) ingress: 19.4s 19.3s 20.3s 20.3s 20.3s

docker driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 23039 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 20.6s    │ 19.7s                  │
│ enable ingress │ 12.2s    │ 13.3s                  │
└────────────────┴──────────┴────────────────────────┘
Details

Times for minikube start: 22.4s 19.1s 21.5s 18.5s 21.4s
Times for minikube (PR 23039) start: 19.3s 18.2s 18.3s 21.5s 21.4s

Times for minikube ingress: 10.7s 12.7s 12.7s 12.6s 12.6s
Times for minikube (PR 23039) ingress: 15.7s 12.7s 12.6s 12.6s 12.7s

docker driver with containerd runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 23039 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 17.7s    │ 17.0s                  │
│ enable ingress │ 23.7s    │ 23.4s                  │
└────────────────┴──────────┴────────────────────────┘
Details

Times for minikube start: 19.2s 16.6s 19.9s 16.2s 16.8s
Times for minikube (PR 23039) start: 17.1s 16.5s 19.6s 16.1s 15.9s

Times for minikube ingress: 23.7s 23.6s 23.7s 23.7s 23.6s
Times for minikube (PR 23039) ingress: 22.2s 23.7s 23.7s 23.6s 23.6s

@nirs
nirs commented May 30, 2026
Copy link
Copy Markdown
Member Author

/retest-required

@nirs
nirs commented Jun 1, 2026
Copy link
Copy Markdown
Member Author

/test pull-minikube-vfkit-docker-macos-arm

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@nirs: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-minikube-docker-crio-linux-x86 a9c608c link false /test pull-minikube-docker-crio-linux-x86
pull-minikube-vfkit-docker-macos-arm a9c608c link false /test pull-minikube-vfkit-docker-macos-arm

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

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. I understand the 8BD0 commands that are listed here.

@nirs
nirs merged commit 6a1f0fd into kubernetes:master Jun 13, 2026
42 of 54 checks passed
@nirs
nirs deleted the vmnet-brew-bin branch June 13, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vfkit, krunkit: Wrong brew install path on Intel Macs vfkit, krunkit: Support vmnet-helper brew install in bin

5 participants

0