Commit Graph

26 Commits (9ebf9fd03f8f1c205c8646fc8e66a36aebdbbde8)

Author SHA1 Message Date
Nir Soffer 6fbe84c7d2
test: Initial support for virtiofs mounts (#21272)
* test: Add findmnt package

When testing mounts we can use findmnt --json output to parse the output
cleanly. The package provides only ParseOutput() now, but it can be
extended later to run the findmnt command.

* test: Support virtiofs mounts

Use findmnt command to get the mounted filesystem details cleanly.

We use the actual mount fstype instead of driver name check so we can
switch drivers to virtiofs without changing the test.

For virtiofs mount we skip options validation since we don't support
setting virtiofs options yet, and the options are not the same as 9p
options.

For 9p mounts the uid= and gid= flags were fixed to match the real flags
(dfltuid=,dfltgid=). The issue was hidden by imprecise string matching.
2025-08-18 12:54:03 -07:00
Nir Soffer a82e25af0e
start: Simpler and safer mount on start (#21250)
The --mount-string argument defaults to `/Users` on darwin, and
homedir.Homedir() on other platforms (e.g. $HOME on unix).

This is wrong in many ways:

- `/Users` is not HOME on darwin (the right path is `/Users/$USER`).
  Using the default mount we cannot access anything inside the guest in
  the user home directory.  We can access the special `/Users/Shared`
  directory, but this should not be a default mount.

- Mounting the user home directory inside the guest in read-write mode
  is a horrible default. This exposes the users private keys in .ssh/ to
  the guest, any sensitive files in the user home directory, and allows
  the guest to change any file on the host.

- Using the `--mount` option mount the default mount directory silently.
  This is unexpected, surprising, and not documented in the minikube
  handbook[1].

Example access to user private key from the guest with the default
mount:

    $ minikube start --mount

    $ minikube ssh cat /minikube-host/.ssh/id_ed25519
    -----BEGIN OPENSSH PRIVATE KEY-----
    ...
    -----END OPENSSH PRIVATE KEY-----

Fixed by removing the default mount directory and changing mount logic
to check for non-empty mount-string instead of the mount flag.

The mount flag is kept for backward compatibility, but its value is
ignored. In the next release we want to use this flag for supporting
multiple mounts.

Example usage before:

    minikube start --mount --mount-string ~/models:/mnt/models

Example usage after:

    minikube start --mount-string ~/models:/mnt/models

Breaking changes:

User depending the default mount will have to replace the command:

    minikube start --mount

With:

    minikube start  --mount-string $HOME:/minikube-host

[1] https://minikube.sigs.k8s.io/docs/handbook/mount/
2025-08-11 11:38:58 -07:00
Predrag Rogic 4da3cedc84
Fix KVM driver (tests) timeouts (#20852)
* Fix KVM driver tests timeouts

Rewrite KVM driver waiting logic for domain start, getting ip address
and shutting domain down. Add more config/state outputs to aid future
debugging.

Bump go/libvirt to v1.11002.0 and set the minimum memory required for
running all tests to 3GB to avoid some really weird system behaviour.

* revert reduction of timelimit for TestCert tests run

* set memory and debug output in TestNoKubernetes tests

* extend kvm waitForStaticIP timeout

* add console log to debug output

* Updating ISO to v1.36.0-1748823857-20852

---------

Co-authored-by: minikube-bot <minikube-bot@google.com>
2025-06-03 15:07:48 -07:00
Steven Powell 1aa1f04e9b remove old build tags 2022-03-30 16:43:29 -07:00
Steven Powell 4c24c61ef9 add small timeout to give time for mount to come up 2021-12-22 11:40:01 -08:00
Steven Powell 645d9f38dc give small timeout to allow mount to come up 2021-12-21 13:31:01 -08:00
Steven Powell 2f29154ac1 run --no-kubernetes in mount start test 2021-12-20 11:28:03 -08:00
Steven Powell de38e0e42b fix mount test failing due to duplicate port 2021-12-16 14:44:10 -08:00
Medya Ghazizadeh 0fa8747da5
Merge pull request #13160 from spowelljr/stopSerialTestsOnFailure
Stop dependent test from continuing after failure
2021-12-14 10:29:49 -08:00
Steven Powell 54c615bd36 remove --mode flag from mount 2021-12-13 15:32:20 -08:00
Steven Powell 4234241bcf stop dependent test from continuing after failure 2021-12-13 14:59:20 -08:00
Steven Powell 3ad2f8d851 skip checking mode on macOS 2021-12-10 15:12:00 -08:00
Steven Powell f8028bcb72 added const 2021-12-10 12:16:16 -08:00
Steven Powell 874a1d965a fixed test error message 2021-12-10 11:54:16 -08:00
Steven Powell 7b3377e95b format 2021-12-10 11:43:50 -08:00
Steven Powell 331034f9ee skip Hyper-V mount details check 2021-12-10 11:43:50 -08:00
Steven Powell 2910ecf8cd added missing import 2021-12-10 11:43:50 -08:00
Steven Powell 8927e2e647 give timeout for 9P mount check 2021-12-10 11:43:50 -08:00
Steven Powell 7a015687e1 skip checking mounting flags with Docker 2021-12-10 11:43:50 -08:00
Steven Powell ed14104f91 use octal 2021-12-10 11:43:50 -08:00
Steven Powell 0d33b6f173 fix ssh 2021-12-10 11:43:50 -08:00
Steven Powell 4369ccc2ca add tests for new start mount flags 2021-12-10 11:43:50 -08:00
Steven Powell ecebde8bf2 remove parallel 2021-10-18 15:40:48 -07:00
Steven Powell d7decc2a8d persist mount settings after stop 2021-10-18 15:40:48 -07:00
Steven Powell 0623f34e99 skip test on none driver 2021-10-14 17:27:06 -07:00
Steven Powell 2a489bf7e1 fix mounting on non-default profile & make mounting processes cluster independent 2021-10-14 14:44:51 -07:00