Commit Graph

19 Commits

Author SHA1 Message Date
Kir Kolyshkin d9090645c3 pkg/machine: fix various linter warnings
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
Kir Kolyshkin f4f2580b0d ci: remove stylecheck linter
It is to be merged into staticcheck linter in golangci-lint v2.0.0.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00
Mario Loriedo 513b4aaceb Safer use of `filepath.EvalSymlinks()` on Windows
The behavior of function `path/filepath.EvalSymlinks()` has
changed in Go v1.23:

- https://go-review.googlesource.com/c/go/+/565136
- https://go.dev/doc/go1.23#minor_library_changes
- https://tip.golang.org/doc/godebug

As a consequences, starting with Podman 5.3.0, when installing
on Windows (WSL) using scoop, Podman fails to start because it
fails to find helper binaries. Scoop copies Podman binaries in
a folder of type Junction and `EvalSymlinks` returns an error.
The problem is described in #24557.

To address this problem we are checking if a path is a `Symlink`
before calling `EvalSymlinks` and, if it's not (hardlinks, mount
points or canonical files), we are calling `path/filepath.Clean`
for consistency. In fact `path/filepath.EvalSymlinks`, after
evaluating a symlink target, calls `Clean` too.

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2025-01-29 13:15:53 +01:00
Arthur Sengileyev 1732338630 Implement publishing API UNIX socket on Windows platforms
gvproxy and win-sshproxy have capabilities to serve this type of enpoint.
This change only adds one additional API enpoint publishing by appending
proxy command lines.

Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2024-08-31 17:27:05 +03:00
Paul Holzinger 666d839157
golangci-lint: make windows linting happy
It qemu cannot be compiled anyway so make sure we do not try to compile
parts where the typechecker complains about on windows.
Also all the e2e test files are only used on linux as well.
pkg/machine/wsl also reports some error but to many for me to fix them
now. One minor problem was fixed in pkg/machine/machine_windows.go.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-19 11:41:29 +02:00
Giuseppe Scrivano af24326133
pkg/machine: use fileutils.(Le|E)xists
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-04-19 09:52:14 +02:00
Jason T. Greene e58cb97de1 Change API socket to be machine name isolated
- Fixes conflicts such as removal of second machine deleting a socket of a
  the first machine while it's running
- Move API socket into runtime directory for consistency
- Add API and gvproxy sockets to removal list
- Cleanup related logic

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2024-03-13 13:28:14 -05:00
Jason T. Greene ef7727238a Refactor env dir and port functions into new leaf pkgs
[NO NEW TESTS NEEDED]

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2024-03-04 23:54:31 -06:00
Matt Heon ec68f07c04 Fix Lint on Windows and enable the job
[NO NEW TESTS NEEDED] Purely refactoring

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-20 08:06:18 -05:00
Jason T. Greene 09b86e26d1 Improve robustness of pipe checks
Improve error reporting on ssh readiness check

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2024-02-11 17:04:09 -06:00
Jason T. Greene 487219d809 Complete WSL implementation, refactor a few areas
Also addresses a number of issues:
- StopHostNetworking isn't plumbed, win-sshproxy leaks on hyperv
- Wait api and print output doesn't work properly on Windows
- API forwarding doesn't work on WSL
- Terminal corruption with after start/stop on Windows
- Gvproxy is forcefully killed vs gracefully quit
- Switching rootful/rootless does not update /var/run/docker.sock on the guest
- File already closed error on init
- HyperV backend is publishing Unix sockets when it should be named pipes
- User-mode networking doesn't always work
- Stop state outside of lock boundaries
- WSL blocks parallel machined (should be supported)

[NO NEW TESTS NEEDED]

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2024-02-11 12:58:11 -06:00
Brent Baude d7cb66492b wsl - wip
Signed-off-by: Brent Baude <bbaude@redhat.com>
2024-02-11 12:58:11 -06:00
Matt Heon 72f1617fac Bump Go module to v5
Moving from Go module v4 to v5 prepares us for public releases.

Move done using gomove [1] as with the v3 and v4 moves.

[1] https://github.com/KSubedi/gomove

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-08 09:35:39 -05:00
Brent Baude b1ce6ef9a8 podman machine 5 - hyperv
this pr represents the podman 5 maching refactoring for HyperV.  with
the exception of already skipped tests, all local tests pass.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2024-02-07 09:18:51 -06:00
Ashley Cui e3f167f770 Add API forwarding support for HyperV
Provides Docker API client access, allowing compose to work by default
for HyperV. Basically the HyperV equiv of the work done here by #12916.

[NO NEW TESTS NEEDED]

Signed-off-by: Ashley Cui <acui@redhat.com>
2024-01-05 11:45:28 -05:00
Oleksandr Redko 2a2d0b0e18 chore: delete obsolete // +build lines
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2024-01-04 11:53:38 +02:00
Matthew Heon 642fa98976 Initial addition of 9p code to Podman
This includes two new hidden commands: a 9p server,
`podman machine server9p`, and a 9p client,
`podman machine client9p` with `server9p` currently only
configured to run on Windows and serve 9p via HyperV vsock, and
`client9p` only configured to run on Linux. The server is run by
`podman machine start` and has the same lifespan as gvproxy
(waits for the gvproxy PID to die before shutting down). The
client is run inside the VM, also by `podman machine start`, and
mounts uses kernel 9p mount code to complete the mount. It's
unfortunately not possible to use mount directly without the
wrapper; we need to set up the vsock and pass it to mount as an
FD.

In theory this can be generalized so that the server can run
anywhere and over almost any transport, but I haven't done this
here as I don't think we have a usecase other than HyperV right
now.

[NO NEW TESTS NEEDED] This requires changes to Podman in the VM,
so we need to wait until a build with this lands in FCOS to test.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-10-31 10:14:02 -04:00
Arthur Sengileyev a909e2f2d5 Expose Podman named pipe in Inspect output
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2023-02-03 00:05:28 +02:00
Arthur Sengileyev c1480b39a9 Improved Windows compatibility for machine command
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2022-08-29 16:53:42 +03:00