Testing shows that we need changes changes:
- x86_64 cpu
- Ubuntu 22.04
- docker is required even if building without docker
- python2 instead of python
- genisoimage (for mkisofs)
- Installing Go manually (Ubuntu 22.04 have only Go 1.18)
- Target should be minikube-iso-aarch64 or minikube-iso-x86_64. Using
arm64 and amd64 fails.
I also cleaned up a little bit the formatting to make it easier to
maintain (one package per line).
Tested building:
- minikube-iso-aarch64
- minikube-iso-x86_64
I did not test the built iso images.
* fix QF1011: could omit type *os.File from declaration; it will be inferred from the right-hand side
* fix QF1012: Use fmt.Fprintf(x, ...) instead of x.Write(fmt.Sprintf(...))
* fix QF1001: could apply De Morgan's law
* fix QF1003: could use tagged switch
* fix weakCond: suspicious ; nil check may not be enough, check for len (gocritic)
* fix docStub: silencing go lint doc-comment warnings is unadvised
* fix builtinShadow: shadowing of predeclared identifier: error
* fix importShadow: shadow of imported package
* fix nestingReduce: invert if cond, replace body with , move old body after the statement
* useless-break: useless break in case clause (revive)
* Clear the redundant content in golangci.yaml file
* vfkit: Fix help text for --extra-disks
vfkit can use extra disks but we forgot to mention it in the help text.
* vfkit: Remove stale tap
vfkit in cfergeau/crc will no longer be updated now that it’s in the main repo.
* vfkit: Fix status in index
The vfkit driver is preferred now.
vfkit is using the native virtualization framework, provides good best
performance and all the features needed by minikube. It is also well
maintained and used by other projects like podman.
This fixes the automatic driver selection. When we start minikube on a
system with both vfkit and qemu, vfkit is selected:
% minikube start
😄 minikube v1.35.0 on Darwin 15.5 (arm64)
✨ Automatically selected the vfkit driver. Other choices: qemu2, ssh, podman (experimental)
👍 Starting "minikube" primary control-plane node in "minikube" cluster
🔥 Creating vfkit VM (CPUs=2, Memory=6000MB, Disk=20000MB) ...
🐳 Preparing Kubernetes v1.33.1 on Docker 28.0.4 ...
▪ Generating certificates and keys ...
▪ Booting up control plane ...
▪ Configuring RBAC rules ...
🔗 Configuring bridge CNI (Container Networking Interface) ...
🔎 Verifying Kubernetes components...
▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟 Enabled addons: default-storageclass, storage-provisioner
🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
* Prevent Unnecessary Version Bumps in `go.mod` During Go Version Updates
This PR addresses issue #20770, where the minikube automation (triggered by make `update-golang-version`) unnecessarily bumped minor or patch versions in `go.mod` when updating the Go version. Following Kubernetes' practice, which avoids such bumps in `go.mod`, this change ensures only the go directive is updated to the stable Go version.
**Changes:**
- Added `go.mod` to the schema map in `hack/update/golang_version/update_golang_version.go` with a regex (go 1\.\d+\.\d+) to update the go directive to {{.StableVersion}} (e.g., go 1.24.2).
- This ensures the automation updates only the go directive without modifying module dependencies, aligning with Kubernetes' `go.mod` behavior.
**Impact:**
- Running make `update-golang-version` now updates the go directive (e.g., from go 1.22.3 to go 1.24.2) without unintended dependency version bumps.
- Tested by setting go 1.22.3 in go.mod, running go mod tidy and make update-golang-version, and verifying only the go directive and toolchain changed.
fixes: #20773
* Pin `go.mod` to Major.Minor Go Version (e.g., `1.24.0`)
**Description**:
Fixes#20773 by updating the automation to pin the `go` directive in `go.mod` to the major.minor Go version (e.g., `1.24.0`) instead of the full version (e.g., `1.24.2`), aligning with Kubernetes’ `go.mod`. This prevents breaking users relying on minikube packages.
**Changes**:
- Modified `hack/update/golang_version/update_golang_version.go` to compute `MajorMinor` version (e.g., `1.24.0`) from `StableVersion`.
- Updated `schema` to set `go.mod`’s `go` directive to `{{.MajorMinor}}`.
- Tested by setting `go 1.23.4`, running `make update-golang-version`, and verifying `go 1.24.0` with no dependency bumps.
**Closes**: #20773
* Reverted all 66 files to upstream master except update_golang_version.go
* Kicbase/ISO: Update cni-plugins from v1.6.2 to v1.7.1
* Updating kicbase image to v0.0.46-1747341282-20771
* Updating ISO to v1.35.0-1747341198-20771
* Update service tests to use-
discoveryv1.EndpointSlice instead of deprecated core.Endpoints
This PR addresses the deprecation warnings for core.Endpoints which is deprecated in Kubernetes v1.33+ in favor of discoveryv1.EndpointSlice.
Changes:
- Replaced all core.Endpoints references with discoveryv1.EndpointSlice
- Updated mock interfaces and test data structures to use the new API
- Maintained all existing test functionality and assertions
- No behavioral changes - just API modernization
Fixes#20677
* fixed lint issue
- make lint now runs without error
* Fix multiple panics in pkg/minikube/service tests by improving mock client initialization
This commit addresses a series of nil pointer dereference panics in the test suite for pkg/minikube/service, ensuring all tests pass reliably. The changes focus on improving the initialization of mock Kubernetes clients to prevent nil pointer dereferences in the fake client's `Invokes` method. The fixes include:
1. **TestPrintURLsForService/throw_error_without_template Panic**:
- Issue: A panic occurred due to an uninitialized `FakeCoreV1` field in `MockCoreClient`, causing a nil pointer dereference when `Services().Get` was called.
- Fix: Initialized `FakeCoreV1` with `Fake: &testing_fake.Fake{}` in the `TestPrintURLsForService` setup, ensuring the fake client is properly configured.
2. **TestGetServiceURLs/correctly_return_serviceURLs Panic**:
- Issue: A similar panic occurred in `GetServiceURLs` due to the `FakeCoreV1` field not being initialized in `MockCoreClient` returned by `MockClientGetter`.
- Fix: Updated `MockClientGetter.GetCoreClient` to initialize `FakeCoreV1` with `Fake: &testing_fake.Fake{}`, ensuring all tests using `MockClientGetter` have a properly initialized client.
3. **TestDeleteSecret/ok Panic**:
- Issue: A panic occurred in `DeleteSecret` when calling `secrets.Delete` for the `foo` namespace, as `secretsNamespaces` lacked an entry for `foo`, returning a nil interface.
- Fix: Added a `MockSecretInterface` for the `foo` namespace to `secretsNamespaces`, ensuring `client.Secrets("foo")` returns a valid interface. Updated `initializeMockObjects` to verify the `Fake` field for the new entry.
Additional improvements:
- Ensured `initializeMockObjects` consistently initializes `Fake` fields across all mock interfaces (`serviceNamespaces`, `serviceNamespaceOther`, `endpointSliceNamespaces`, and `secretsNamespaces`).
- Verified that all test setups align with mock configurations, preventing similar issues in other tests (e.g., `TestCreateSecret`, `TestWaitAndMaybeOpenService`).
- Confirmed no linting issues with `make lint` and validated all tests pass with `go test -v ./pkg/minikube/service/...`.