Commit Graph

51 Commits (master)

Author SHA1 Message Date
Nir Soffer 5d4d03623b
drivers: Extract drivers/common package (#21266)
Move all files and packages which are not a driver to the drivers/common
package. This helps to understand the structure of the code.

While moving, move the iso_test.iso into testdata/test.iso to separate
code and test data.

While fixing the test iso path fix few bugs in the tests using wrong iso
path. The test failed because the iso path was wrong instead of issue
with source or destination path.

New directory structure:

    % tree -L1 pkg/drivers
    pkg/drivers
    ├── common
    ├── hyperkit
    ├── kic
    ├── krunkit
    ├── kvm
    ├── none
    ├── qemu
    ├── ssh
    └── vfkit
2025-08-08 22:50:57 -07:00
Victor Ubahakwe 958ecac9d3
Refactor table rendering (#20893)
* Refactored table rendering codes to support updated tablewriter v1.0.7

This commit makes all necessary code changes to maintain compatibility
with the new tablewriter version. The update includes several required modifications across multiple files.

Files modified:
- cmd/minikube/cmd/config/images.go
- cmd/minikube/cmd/config/addons_list.go
- cmd/minikube/cmd/config/profile_list.go
- hack/benchmark/time-to-k8s/chart.go
- hack/benchmark/time-to-k8s/cpu.go
- pkg/minikube/audit/row.go
- pkg/minikube/machine/cache_images.go
- pkg/minikube/perf/result_manager.go
- pkg/minikube/service/service.go

Now #20878 can be merged.
Addresses #20879

* The tablewriter package v1.0.7 renamed SetHeaders to SetHeader

* updated go mod and table.SetColumnAlignment([]int{0, 0, 0, 0})

* Changed syntax and added vendor to gitignore

* simplified version of tablewriter

* removed vendor

* fix addon_list

* fix images tablewrtier

* bump tablewriter for profile list

* go mod tidy

* bump tablewriter for chart

* bump tablewriter for cpu chart

* bump tablewriter for row

* bump tablewriter cache images

* bump tablewriter

* bump tablewriter

* revert file

* bump tablewritter

* fix unit test

* fix lint issues

* fix the integration test pipe char

* convert all tables to new pipe instead of asci pipe

* convert all tables to new pipe instead of asci pipe

* go mod tidy

* go work sync

---------

Co-authored-by: Medya Ghazizadeh <medya@google.com>
2025-07-21 16:20:55 -07:00
Medya Ghazizadeh 97d8a293a9
ci: add smoke test to github action (#21095)
* smoke test

* add logic to detect nested VMs

* increase memory to 8gb for tesT

* use the network flag for both qemu and vfkit

* code review comments

* separate minikube download

* separate minikube download

* force cpu1

* add docker for smoke test

* exclude envs dont need in matrix

* change back to 3

* remove unused code

* add info block for linux as well
2025-07-19 18:29:44 -07:00
Nir Soffer c090344bb4
More robust MAC address matching (#19750)
On darwin bootp uses non-standard MAC address format[1]:
"8e:1:99:9c:54:b1" instead of "8e:01:99:9c:54:b1". We fixed this by
trimming leading "0" in the string before looking up the IP address.

There are several issues with the current code:
- Fragile, will break if bootp changes the format (unlikely)
- Fixing the wrong place, the drivers should not care about the MAC
  address format.
- The tests were confusing, showing that we can match standard MAC
  addresses while the actual code could match only non-standard bootp
  addresses.
- Logging wrong MAC address since we trimmed leading zeros before
  logging

This change replace trimming leading zeros with parsing MAC address
strings and comparing the bytes. The test includes now both standard and
non-standard MAC addresses.

[1] https://openradar.appspot.com/FB15382970
2024-10-14 10:21:04 -07:00
Anders F Björklund 8d17e2cbde Move ExtractFile from hyperkit to drivers
So that it can be used in other drivers too
2024-08-20 12:39:57 -07:00
Steven Powell 50e9147e4e fix lint errors 2023-03-20 12:43:07 -07:00
Steven Powell 8c12c40853 implement socket_vmnet 2022-10-03 15:14:36 -07:00
Steven Powell 1aa1f04e9b remove old build tags 2022-03-30 16:43:29 -07:00
Sharif Elgamal 8c3a3537c0 remove reference to nonexistent file for hyperkit driver 2022-01-20 15:03:00 -08:00
klaases 694c9cc0ef Bootloader ISO EFI Support 2021-12-07 15:56:07 -08:00
KallyDev 70022d9b2e
Move from deprecated ioutil to os and io packages 2021-10-08 08:57:19 +08:00
Steven Powell 145f9fc9ab run `go fmt` 2021-09-13 11:58:43 -07:00
Medya Gh ccf4af0997 change depricated golint to revive and fix lint issues 2021-08-12 18:11:16 -07:00
Blaine Gardner 8f05ee00e1
Add ability to create extra disks on hyperkit vms
Add the ability to create and attach extra disks to hyperkit vms.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-07-28 09:57:20 -06:00
Medya Gh 1207de734b bump golang lint ci to latest 2021-04-19 15:16:31 -07:00
Daehyeok Mun fae67405e9 Update outdated moby/hyperkit package in minikube code 2021-03-05 22:27:23 -08:00
Medya Gh 47ed4bc23c update lint version 2020-07-24 14:45:15 -07:00
Medya Gh 70c9304724 code review comments 2020-03-13 10:37:29 -07:00
Anders F Björklund 67c7a7a81c Reduce cyclometric complexity by refactoring
19 cmd generateCfgFromFlags cmd/minikube/cmd/start.go:711:1
19 cmd runStart cmd/minikube/cmd/start.go:257:1
18 hyperkit (*Driver).Start pkg/drivers/hyperkit/driver.go:202:1
17 cmd runDelete cmd/minikube/cmd/delete.go:53:1
16 registry TestRegistry pkg/minikube/registry/registry_test.go:39:1
2019-09-21 09:24:39 +02:00
Sharif Elgamal a817bffab1
Remove all minikube dependencies from drivers (#4933)
* Remove all minikube dependencies in driver code

* removing all default config

* okay we need some defaults

* code comments

* hyperkit builds now

* sleep for an appropriate amount of time

* remove constant in favor of string

* try goproxy for travis

* try goproxy for travis

* try goproxy for travis

* let's not try goproxy for now

* let's try goproxy once again

* maybe use the correct url for the proxy

* fix go mod
2019-08-12 14:42:11 -07:00
Medya Ghazizadeh 449c8781e1
Merge pull request #4595 from blueelvis/memory-size-sanity-check
Added validation for start memory size
2019-06-30 15:17:28 -07:00
Jose Donizetti 7fe2247692 Improve hyperkit vm stop 2019-06-28 16:36:36 -07:00
Jose Donizetti 6222e74267 Add hyperkit doc 2019-06-28 13:44:15 -07:00
Jituri, Pranav 380883dee3 Fix failing Hyperkit test 2019-06-26 01:45:12 +05:30
Medya Gh c7bf1ce7cd type check for drivers 2019-06-24 14:39:21 -07:00
Thomas Stromberg 6e693d22ee lint-a-geddon is here 2019-05-13 21:43:52 -07:00
Thomas Stromberg 07fc64fbe1 Warnf -> Debugf so that it doesn't interfere with output 2019-02-14 20:12:34 -08:00
Thomas Stromberg 7dd7e5417d glog, not golog 2019-02-14 14:43:22 -08:00
Thomas Stromberg 531e6b0f72 Use h.SetLogger 2019-02-14 14:40:32 -08:00
Thomas Stromberg 5c1a72f428 Switch Infof statements to Debugf/Warningf, as they go to stderr 2019-02-14 10:14:41 -08:00
Thomas Stromberg 473f5983cb Allow driver name to be com.docker.hyper, as seen in integration testing 2019-02-13 13:36:45 -08:00
Thomas Stromberg 888978c3a9 Improve VM re-use reliability: detect crashing and/or badly installed hyperkit 2019-02-12 13:58:18 -08:00
Thomas Stromberg d57d8d1a1e Fix broken tests: hyperkit driver format mismatch, console spacing mismatch 2019-02-08 13:58:02 -08:00
balopat 17c0244cf7 reverting unnecessary change 2019-01-28 17:28:57 -08:00
balopat 5af2f1eafc formatting / removed extra comment 2019-01-28 13:47:24 -08:00
balopat f70e6a0385 fixing review remarks 2019-01-28 13:42:43 -08:00
balopat 933356e477 lint 2019-01-25 17:20:57 -08:00
balopat 9b97a85a8f fix stale hyperkit.pid making minikube start hang 2019-01-25 17:08:31 -08:00
bpopovschi 0687fea66a Added defaultDiskSize setup to hyperkit driver
fmt fix
2019-01-14 17:04:07 +02:00
Thomas Stromberg 3706b3b8ac Fix dangling format issues. 2018-09-28 16:48:37 -07:00
Thomas Stromberg 055c8002b1 Replace %s format directives with %v for errors.
Previously we were mixed between the two forms. This commit picks %v,
which is consistent with the Kubernetes code base. They both effectively
do the same thing in this case, though %v works with any object, and %s
only with string objects.
2018-09-28 16:05:27 -07:00
seborama ee73cbde6b Added hyperkit options for enterprise VPN support
The purpose of these changes is to enhance Hyperkit support from the
minikube command line for better integration with enterprise networks
behind a VPN.

uuid: Provide VM UUID to restore MAC address (only supported with
      Hyperkit driver).
vpnkitSock: Location of the VPNKit socket used for networking. If empty,
            disables Hyperkit VPNKitSock, if 'auto' uses Docker for Mac
            VPNKit connection, otherwise uses the specified VSock."
vsockPorts: List of guest VSock ports that should be exposed as sockets
            on the host (Only supported on with hyperkit now).

Note:
tests pass but file:
`vendor/github.com/google/certificate-transparency/go/x509/root_darwin.go`
has to be edited to correct an issue - not committed since this is in
the vendor directory.
2018-06-04 09:46:20 -07:00
basp cebd704bd7 Issue #2416: Added UUID to hyperkit driver section in minikube configuration to be able to regenerate the same mac address for the machine after restarts to give DHCP a change of assigning the previously used IP address. 2018-01-11 09:41:35 -08:00
Hugues Alary bc55b8b8be Cleanup NFS Exports after stop and delete 2018-01-03 10:21:04 -08:00
dlorenc 59274b22da Code review feedback. 2018-01-02 16:18:54 -08:00
Mohit Gupta 7d9413ccd1 remove the hyperkit prefix so we can move this to other drivers as well with time and fix vendoring issue 2018-01-02 16:18:54 -08:00
Mohit Gupta e1903b7423 support NFS sharing with the hyperkit driver 2018-01-02 16:18:54 -08:00
dlorenc fdf906cf3b Add an error message when running hyperkit without permissions. 2017-11-26 17:31:01 -08:00
dlorenc bc20281f1e Update hyperkit go driver. 2017-11-20 11:52:20 -05:00
Matt Rickard 02f0d41c1d Split out hyperkit into CGO needed stub
This allows us to use the hyperkit Driver struct in minikube, without
needing CGO_ENABLED=1.  For the hyperkit driver binary, the
CGO_ENABLED=1 function will work.
2017-10-19 16:07:38 -04:00