Skip to content

Conversation

@medyagh
Copy link
Member

@medyagh medyagh commented Jan 15, 2026

part of Part of #21639

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh

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

@k8s-ci-robot k8s-ci-robot requested review from nirs and prezha January 15, 2026 12:48
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 15, 2026
@medyagh medyagh changed the title Get rid of semverlib deps: Replace blang/semver with Masterminds/semver/v3 Jan 15, 2026
@medyagh medyagh changed the title deps: Replace blang/semver with Masterminds/semver/v3 wip: deps: Replace blang/semver with Masterminds/semver/v3 Jan 15, 2026
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 15, 2026
@medyagh medyagh requested a review from Copilot January 15, 2026 12:49
@medyagh
Copy link
Member Author

medyagh commented Jan 15, 2026

/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 Jan 15, 2026
Copy link
Contributor

Copilot AI left a comment

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 migrates the minikube codebase from using blang/semver/v4 to Masterminds/semver/v3 as part of issue #21639. The migration updates all version comparison logic throughout the codebase to use the new library's API.

Changes:

  • Replaced all imports of github.com/blang/semver/v4 with github.com/Masterminds/semver/v3
  • Updated version comparison methods (GTE → GreaterThanEqual, LT → LessThan, GT → GreaterThan, EQ → Equal, NE → not Equal)
  • Changed version parsing from semver.Make/Parse/ParseTolerant to semver.NewVersion
  • Converted struct field access to method calls (Major → Major(), Minor → Minor(), Patch → Patch())
  • Updated return types from value types to pointer types (semver.Version*semver.Version)
  • Updated range-based version checking to use NewConstraint and Check methods
  • Added nil checks for version pointers where needed

Reviewed changes

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

Show a summary per file
File Description
go.mod Added Masterminds/semver/v3 v3.4.0 as direct dependency, moved blang/semver/v4 to indirect
hack/go.mod Added Masterminds/semver/v3 as indirect dependency
pkg/util/utils.go Updated ParseKubernetesVersion to return pointer and use NewVersion
pkg/util/utils_test.go Updated test to use Equal method instead of NE
pkg/version/version.go Updated GetSemverVersion return type to pointer
pkg/minikube/cruntime/* Updated runtime version handling with pointer types and new comparison methods
pkg/minikube/bootstrapper/* Updated kubeadm configuration version checks
pkg/minikube/registry/drvs/* Updated driver version checks for docker, podman, qemu
pkg/minikube/node/* Updated node configuration version handling
pkg/minikube/machine/start.go Updated version comparisons for machine startup
pkg/minikube/driver/auxdriver/* Updated driver version management with pointer types
pkg/minikube/download/* Updated binary download URL generation based on versions
pkg/minikube/config/types.go Updated VersionedExtraOption fields to use pointer types
pkg/minikube/cni/* Updated CNI version checks
pkg/minikube/bootstrapper/images/* Updated image selection logic based on versions
pkg/minikube/notify/* Updated version notification logic
pkg/minikube/reason/k8s.go Updated K8s issue detection version parameter
pkg/drivers/kic/oci/* Updated OCI driver version handling
pkg/addons/addons.go Updated addon version checks
cmd/minikube/cmd/start*.go Updated Kubernetes version validation and comparison
test/integration/* Updated integration tests to use new comparison methods

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

func (r *Docker) Available() error {
// If Kubernetes version >= 1.24, require both cri-dockerd and dockerd.
if r.KubernetesVersion.GTE(semver.Version{Major: 1, Minor: 24}) {
if !r.KubernetesVersion.LessThan(semver.MustParse("1.24.0")) {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The PR uses two different patterns for checking if a version is greater than or equal to another: !version.LessThan(...) and version.GreaterThanEqual(...). Both are semantically correct, but for better code maintainability and readability, it would be more consistent to use version.GreaterThanEqual(...) throughout, as it more clearly expresses the intent.

Suggested change
if !r.KubernetesVersion.LessThan(semver.MustParse("1.24.0")) {
if r.KubernetesVersion.GreaterThanEqual(semver.MustParse("1.24.0")) {

Copilot uses AI. Check for mistakes.
// note: containerd supports 'enable_unprivileged_ports' option since v1.6.0-beta.3 (Nov 19, 2021) (ref: https://github.com/containerd/containerd/releases/tag/v1.6.0-beta.3; https://github.com/containerd/containerd/pull/6170)
// note: minikube bumped containerd version to greater than v1.6.0 on May 19, 2022 (ref: https://github.com/kubernetes/minikube/pull/14152)
if kv.GTE(semver.Version{Major: 1, Minor: 22}) {
if !kv.LessThan(semver.MustParse("1.22.0")) {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

For consistency and readability, consider using kv.GreaterThanEqual(semver.MustParse("1.22.0")) instead of !kv.LessThan(semver.MustParse("1.22.0")). Both are semantically correct, but the former more clearly expresses the intent.

Copilot uses AI. Check for mistakes.
// note: 'net.ipv4.ip_unprivileged_port_start' sysctl was marked as safe since Kubernetes v1.22 (Aug 4, 2021) (ref: https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.22.md#feature-9)
// note: cri-o supports 'default_sysctls' option since v1.12.0 (Oct 19, 2018) (ref: https://github.com/cri-o/cri-o/releases/tag/v1.12.0; https://github.com/cri-o/cri-o/pull/1721)
if kv.GTE(semver.Version{Major: 1, Minor: 22}) {
if !kv.LessThan(semver.MustParse("1.22.0")) {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

For consistency and readability, consider using kv.GreaterThanEqual(semver.MustParse("1.22.0")) instead of !kv.LessThan(semver.MustParse("1.22.0")). Both are semantically correct, but the former more clearly expresses the intent.

Copilot uses AI. Check for mistakes.
// ref: https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/#options
// ref: https://github.com/kubernetes/kubernetes/issues/118787
if version.GTE(semver.MustParse("1.27.0")) {
if !version.LessThan(semver.MustParse("1.27.0")) {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

For consistency and readability, consider using version.GreaterThanEqual(semver.MustParse("1.27.0")) instead of !version.LessThan(semver.MustParse("1.27.0")). Both are semantically correct, but the former more clearly expresses the intent.

Suggested change
if !version.LessThan(semver.MustParse("1.27.0")) {
if version.GreaterThanEqual(semver.MustParse("1.27.0")) {

Copilot uses AI. Check for mistakes.
// ref: https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/#options
// ref: https://github.com/kubernetes/kubernetes/issues/118787
if version.GTE(semver.MustParse("1.27.0")) {
if !version.LessThan(semver.MustParse("1.27.0")) {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

For consistency and readability, consider using version.GreaterThanEqual(semver.MustParse("1.27.0")) instead of !version.LessThan(semver.MustParse("1.27.0")). Both are semantically correct, but the former more clearly expresses the intent.

Suggested change
if !version.LessThan(semver.MustParse("1.27.0")) {
if version.GreaterThanEqual(semver.MustParse("1.27.0")) {

Copilot uses AI. Check for mistakes.
"NumCPU", // For "none" users who have too few CPUs
}
if ver.GE(semver.MustParse("1.20.0")) {
if !ver.LessThan(semver.MustParse("1.20.0")) {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

For consistency and readability, consider using ver.GreaterThanEqual(semver.MustParse("1.20.0")) instead of !ver.LessThan(semver.MustParse("1.20.0")). Both are semantically correct, but the former more clearly expresses the intent.

Suggested change
if !ver.LessThan(semver.MustParse("1.20.0")) {
if ver.GreaterThanEqual(semver.MustParse("1.20.0")) {

Copilot uses AI. Check for mistakes.
Comment on lines +2031 to +2037
if !ver.LessThan(semver.MustParse("1.18.0-beta.1")) {
if _, err := exec.LookPath("conntrack"); err != nil {
exit.Message(reason.GuestMissingConntrack, "Sorry, Kubernetes {{.k8sVersion}} requires conntrack to be installed in root's path", out.V{"k8sVersion": ver.String()})
}
}
// crictl is required starting with Kubernetes 1.24, for all runtimes since the removal of dockershim
if ver.GTE(semver.MustParse("1.24.0-alpha.0")) {
if !ver.LessThan(semver.MustParse("1.24.0-alpha.0")) {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

For consistency and readability, consider using ver.GreaterThanEqual(semver.MustParse("1.18.0-beta.1")) and ver.GreaterThanEqual(semver.MustParse("1.24.0-alpha.0")) instead of !ver.LessThan(...). Both are semantically correct, but the former more clearly expresses the intent.

Copilot uses AI. Check for mistakes.
… sysctl and extend Docker version command timeout.
@k8s-ci-robot
Copy link
Contributor

@medyagh: 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
integration-vfkit-docker-macos-arm 382d324 link false /test integration-vfkit-docker-macos-arm
integration-docker-containerd-linux-arm 382d324 link false /test integration-docker-containerd-linux-arm
integration-docker-crio-linux-x86 382d324 link false /test integration-docker-crio-linux-x86

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 commands that are listed here.

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 22462 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 37.6s    │ 36.8s                  │
│ enable ingress │ 15.8s    │ 15.7s                  │
└────────────────┴──────────┴────────────────────────┘
Details

Times for minikube ingress: 15.8s 15.3s 15.8s 16.3s 15.8s
Times for minikube (PR 22462) ingress: 15.2s 15.8s 15.8s 15.8s 15.8s

Times for minikube start: 36.9s 39.3s 38.0s 37.9s 36.0s
Times for minikube (PR 22462) start: 38.2s 36.4s 36.8s 37.2s 35.5s

docker driver with docker runtime

┌────────────────────┬──────────┬────────────────────────┐
│      COMMAND       │ MINIKUBE │ MINIKUBE  ( PR 22462 ) │
├────────────────────┼──────────┼────────────────────────┤
│ minikube start     │ 20.0s    │ 19.6s                  │
│ ⚠️  enable ingress │ 10.7s    │ 22.4s ⚠️               │
└────────────────────┴──────────┴────────────────────────┘
Details

Times for minikube start: 20.9s 18.5s 21.7s 20.9s 18.0s
Times for minikube (PR 22462) start: 18.3s 21.2s 18.1s 19.0s 21.3s

Times for minikube ingress: 10.6s 10.7s 10.7s 10.7s 10.6s
Times for minikube (PR 22462) ingress: 40.6s 10.7s 40.7s 10.6s 9.6s

docker driver with containerd runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 22462 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 18.0s    │ 18.8s                  │
│ enable ingress │ 21.5s    │ 21.5s                  │
└────────────────┴──────────┴────────────────────────┘
Details

Times for minikube start: 19.4s 16.1s 19.3s 16.2s 18.8s
Times for minikube (PR 22462) start: 20.0s 19.8s 19.5s 17.2s 17.4s

Times for minikube ingress: 22.1s 21.1s 21.1s 22.2s 21.1s
Times for minikube (PR 22462) ingress: 21.2s 21.1s 22.2s 22.1s 21.2s

@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 17, 2026
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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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.

3 participants