Commit graph

1122 commits

Author SHA1 Message Date
Paul Holzinger
5004e99e3b
pkg/machine/hyperv: fix incorrect timeout
The timeout is simply to low, I don't know the previous numbers were
collected because they are simply wrong. A machine init takes around 50s
total. And while the ready timeout itself could be shorter there is
really no good reason to set such a low limit as it will cause wrong
failures.

This is currently flaking a lot in CI, I see it in most hyperV logs I
looked at[1]. While there is likely another problem with the boot
failures I think this added a ton of false positives as it errors out
early.

[1] https://github.com/podman-container-tools/podman/actions/runs/34146238887/job/101820830173

Fixes: dd28c14f8c ("hyperv: add timeout to vsock ready wait")

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:42:15 +02:00
Paul Holzinger
2e589e7465
pkg/machine/e2e: lower command timeout
Even on the slowest of CI systems a normal VM start does not seem to
take more than 1 minute.

Instead we seem to have flakes which cause our command to hang on
startup. In that case we thought waiting longer might help but instead
it just wastes 10 minutes.

Se the default command timeout to 3 minutes which should be plenty even
on the slowest of CI systems. Anything above will likely never finish
and we can just abort the test as failed.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:31:04 +02:00
Paul Holzinger
d42ad4aae3
pkg/machine/e2e: combine one --import-native-ca test
Combine the no volume and --import-native-ca test into one.

This removes one full machine init/start/stop cycle.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:24:17 +02:00
Paul Holzinger
ee7d3c534c
pkg/machine/e2e: combine build context test
Instead of creating a fresh machine which is slow reuse an existing
test for this test.

Also fix the test to actually check the file content properly, it was
using the wrong build output. And then just use one cat for both files
to make it a tiny bit faster.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:24:17 +02:00
Paul Holzinger
66a1bee8d5
pkg/machine/e2e: inline one remove test
Avoid another init/start cycle by reusing an existing test which has a
VM running already.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:24:17 +02:00
Paul Holzinger
f1f52763cb
pkg/machine/e2e: combine api test cases
Only start a machine once, not three times to safe time.

Also include stdout/err as part of the curl command so errors are
visible. And lastly the latest moby client code should support unix
sockets on windows so we can test it there as well.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:45 +02:00
Paul Holzinger
49aec99596
pkg/machine/e2e: inline stop running machine
Instead of having to start a new machine again here just drop the test
and do the stop check as part of another test which already has a
machine running.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:45 +02:00
Paul Holzinger
9002dce687
pkg/machine/e2e: use withFakeImage for excessive cpus test
The test should fail before booting a real VM so we can use the fake
image which should make the test a few seconds faster.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:45 +02:00
Paul Holzinger
1b6d77299e
pkg/machine/e2e: remove simple init with start
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:44 +02:00
Paul Holzinger
ccd3778087
pkg/machine/e2e: remove start simple machine
The test starts a machine 3 times taking almost 180 seconds in linux CI.

We have a lot of machine starts elsewhere already so we really do not
need a basic start and for the quiet/noinfo checks we can just add them
to another existing start command.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:44 +02:00
Paul Holzinger
d99f1d5564
pkg/machine/e2e: rename toQemuInspectInfo to toInspectInfo
There is nothing qemu specifc about this for a long time. Just drop it
from the name.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:44 +02:00
Paul Holzinger
3ffe582563
pkg/machine/e2e: combine machine set rootful tests
Each machine start/stop adds up in CI, combine several related tests to
reduce the machine init/start/stops cycles.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:44 +02:00
Paul Holzinger
d3f30f698e
pkg/machine/e2e: correctly handle set --rootful=false
On podman machine set we have three modes, not set (keep user),
--rootful (set user to root), --rootful=false (set to rootless user).

The later could not be passed at all before this.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:44 +02:00
Paul Holzinger
f4df65a859
pkg/machine/e2e: combine two restart machine tests
The restart tests are rather slow. On the linux CI 60 seconds for the
stopped case and almost 120 seconds for the restart running case.

Combine both cases into one so we only have to start a machine twice,
not three times and only need to init it once.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:43 +02:00
Paul Holzinger
53a9bcbe13
run golangci-lint --fix
In order to fix the new formatting issues reported.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-04 16:30:10 +02:00
Paul Holzinger
6c6eac3a5c
run modernize -fix ./...
Since I use go 1.26 the go fix does not have all the rules built in,
there are newer ones in modernize so run the explicitly to fix more code
for go 1.26.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-04 11:53:04 +02:00
Paul Holzinger
eb96a9d5b8
run go fix ./...
Plus manually deleting the left over inline functions because go fix
doesn't do that even though they are private functions.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-04 11:53:04 +02:00
Hugo Osvaldo Barrera
1f1c233202 Restrict tests to the same architectures as non-test code
ostree.go is limited to only amd64 and arm64, but its tests run on all
architectures and fail because all their symbols are missing.

Don't run tests on an architecture where the non-test code doesn't
exist.

References: https://github.com/podman-container-tools/podman/issues/29711
Signed-off-by: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
2026-09-03 14:19:47 +02:00
Ashley Cui
48dfbd2dd3 Vendor container-libs@main
Signed-off-by: Ashley Cui <acui@redhat.com>
2026-09-01 11:30:39 -04:00
Paul Holzinger
9c4cfaf7d9
Merge pull request #29590 from prabhat-kumar96/fix-windows-hyperv-9p-detach
pkg/machine/hyperv: detach 9p server from parent console
2026-08-31 15:57:11 +02:00
prabhat-kumar96
debcacc699 pkg/machine: detach helper processes from parent console on Windows
When starting a machine on Windows, background helper processes
(podman.exe machine server9p, gvproxy, and win-sshproxy) could be
terminated when the parent CMD/PowerShell session closed.

1. For podman.exe machine server9p (a console subsystem binary), set
   CreationFlags to CREATE_NO_WINDOW so it runs without attaching to
   the parent console.
2. For GUI binaries (gvproxy and win-sshproxy), configure
   DETACHED_PROCESS so they outlive the invoking console session.

Fixes: #29573
Signed-off-by: prabhat-kumar96 <prabhatmathur9927@gmail.com>
2026-08-27 18:11:12 +05:30
Matt Heon
de350af4b1
Merge pull request #28447 from jude-ruben/fix/machine-image-permissions
Some checks are pending
ci / int local rootless fedora-prior (push) Blocked by required conditions
ci / sys local rootless fedora-prior (push) Blocked by required conditions
ci / int remote root fedora-prior (push) Blocked by required conditions
ci / sys remote root fedora-prior (push) Blocked by required conditions
ci / int local root fedora-rawhide (push) Blocked by required conditions
ci / sys local root fedora-rawhide (push) Blocked by required conditions
ci / int local rootless fedora-rawhide (push) Blocked by required conditions
ci / sys local rootless fedora-rawhide (push) Blocked by required conditions
ci / int remote root fedora-rawhide (push) Blocked by required conditions
ci / sys remote root fedora-rawhide (push) Blocked by required conditions
ci / apiv2 root fedora-current (push) Blocked by required conditions
ci / bindings root fedora-current (push) Blocked by required conditions
ci / compose_v2 root fedora-current (push) Blocked by required conditions
ci / docker_py root fedora-current (push) Blocked by required conditions
ci / unit root fedora-current (push) Blocked by required conditions
ci / apiv2 rootless fedora-current (push) Blocked by required conditions
ci / compose_v2 rootless fedora-current (push) Blocked by required conditions
ci / farm rootless fedora-current (push) Blocked by required conditions
ci / unit rootless fedora-current (push) Blocked by required conditions
ci / upgrade v5.3.1 root fedora-current (push) Blocked by required conditions
ci / upgrade v5.6.2 root fedora-current (push) Blocked by required conditions
ci / machine linux amd64 (push) Blocked by required conditions
ci / windows unit (push) Blocked by required conditions
ci / windows e2e (push) Blocked by required conditions
ci / windows machine hyperv (push) Blocked by required conditions
ci / windows machine wsl (push) Blocked by required conditions
ci / macos machine applehv (push) Blocked by required conditions
ci / macos machine libkrun (push) Blocked by required conditions
ci / Total Success (push) Blocked by required conditions
zizmor: GitHub Actions Security Analysis / Zizmor (push) Waiting to run
machine: ensure disk image is writable before resize (fix read-only image init failure)
2026-08-24 15:07:36 -04:00
Jude Ruben Fernando
73657e9267 Fix machine init failure with read-only disk image
Fixes: #2756

Signed-off-by: Jude Ruben Fernando <rubenfdo@gmail.com>

machine: fix stdpull internal imports

Signed-off-by: Jude Ruben Fernando <rubenfdo@gmail.com>
2026-08-24 14:35:33 +00:00
ROKUMATE
724325b709 pkg/machine/vmconfigs: add tests for SplitVolume
Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
2026-08-24 15:15:20 +05:30
Matt Heon
f19c577355
Merge pull request #29505 from nXtCyberNet/issue/proxy
Some checks are pending
ci / int local rootless fedora-prior (push) Blocked by required conditions
ci / sys local rootless fedora-prior (push) Blocked by required conditions
ci / int remote root fedora-prior (push) Blocked by required conditions
ci / sys remote root fedora-prior (push) Blocked by required conditions
ci / int local root fedora-rawhide (push) Blocked by required conditions
ci / sys local root fedora-rawhide (push) Blocked by required conditions
ci / int local rootless fedora-rawhide (push) Blocked by required conditions
ci / sys local rootless fedora-rawhide (push) Blocked by required conditions
ci / int remote root fedora-rawhide (push) Blocked by required conditions
ci / sys remote root fedora-rawhide (push) Blocked by required conditions
ci / apiv2 root fedora-current (push) Blocked by required conditions
ci / bindings root fedora-current (push) Blocked by required conditions
ci / compose_v2 root fedora-current (push) Blocked by required conditions
ci / docker_py root fedora-current (push) Blocked by required conditions
ci / unit root fedora-current (push) Blocked by required conditions
ci / apiv2 rootless fedora-current (push) Blocked by required conditions
ci / compose_v2 rootless fedora-current (push) Blocked by required conditions
ci / farm rootless fedora-current (push) Blocked by required conditions
ci / unit rootless fedora-current (push) Blocked by required conditions
ci / upgrade v5.3.1 root fedora-current (push) Blocked by required conditions
ci / upgrade v5.6.2 root fedora-current (push) Blocked by required conditions
ci / machine linux amd64 (push) Blocked by required conditions
ci / windows unit (push) Blocked by required conditions
ci / windows e2e (push) Blocked by required conditions
ci / windows machine hyperv (push) Blocked by required conditions
ci / windows machine wsl (push) Blocked by required conditions
ci / macos machine applehv (push) Blocked by required conditions
ci / macos machine libkrun (push) Blocked by required conditions
ci / Total Success (push) Blocked by required conditions
zizmor: GitHub Actions Security Analysis / Zizmor (push) Waiting to run
made the error message more understandable
2026-08-20 15:50:09 -04:00
Matt Heon
f63cf24b00
Merge pull request #29460 from RudraDudhat2509/fix/hyperv-vsock-ready-timeout
hyperv: add timeout to vsock ready wait
2026-08-19 05:11:28 -04:00
nXtCyberNet
87ee2227b6 made the error message more understandable
Signed-off-by: nXtCyberNet <rohantech2005@gmail.com>
2026-08-19 12:06:57 +05:30
Danish Prakash
598920feef
Merge pull request #29322 from ROKUMATE/test-pkg-machine-env
pkg/machine/env: add tests for WithPodmanPrefix and dir prefixes
2026-08-18 10:08:39 +05:30
Jan Rodák
4b6873a5ef
Merge pull request #29527 from vishnukothakapu/perf-strings-equalfold
Performance: Replace strings.ToLower with strings.EqualFold
2026-08-17 21:59:25 +02:00
Paul Holzinger
5b366f4b34
Merge pull request #29511 from vishnukothakapu/perf-regexp-mustcompile
Performance: Hoist regexp.MustCompile out of functions
2026-08-17 12:53:04 +02:00
Vishnu Kothakapu
0a2350324a Performance: Replace strings.ToLower with strings.EqualFold
Replaces unnecessary heap allocations for case-insensitive equality
checks with standard library strings.EqualFold.

Fixes: #29526
Signed-off-by: Vishnu Kothakapu <vishnukothakapu27@gmail.com>
2026-08-15 02:17:47 +05:30
Vishnu Kothakapu
e3797d95b1 Performance: Use delayed regex compilation
Replaces regexp.MustCompile with regexp.Delayed from go.podman.io/storage/pkg/regexp
for global regular expressions. This avoids compiling regular expressions
during the global init scope, improving startup performance for all commands.

Tests are kept using regexp.MustCompile where applicable.

Fixes: #29510
Signed-off-by: Vishnu Kothakapu <vishnukothakapu27@gmail.com>
2026-08-14 21:14:17 +05:30
Jan Rodák
b4aadcdd1a
Merge pull request #29502 from vishnukothakapu/refactor-err-error
Refactor: Remove redundant err.Error() in pkg/machine
2026-08-14 16:06:58 +02:00
ROKUMATE
4a7be9e307 pkg/machine/env: add tests for WithPodmanPrefix
Fixes: #29314
Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
2026-08-14 17:28:31 +05:30
nXtCyberNet
f76d9de01a added errorlint
Fixes: #29488
Signed-off-by: nXtCyberNet <rohantech2005@gmail.com>
2026-08-14 01:35:03 +05:30
Vishnu Kothakapu
d5f84c7167 Refactor: Remove redundant err.Error() in pkg/machine
When passing an error to fmt.Errorf or logrus with formatting verbs like
%v or %w, it is not necessary to explicitly call err.Error(). The format
functions will automatically call the Error() method because the value
implements the error interface. Removing these explicit calls makes the
code cleaner and more idiomatic.

Fixes: #29501
Signed-off-by: Vishnu Kothakapu <vishnukothakapu27@gmail.com>
2026-08-14 01:09:08 +05:30
Matt Heon
b85a2c7f39
Merge pull request #29459 from vishnukothakapu/refactor-machine-error-wrap
Refactor: use %w for error wrapping in pkg/machine
2026-08-12 06:27:23 -04:00
Rudra Dudhat
dd28c14f8c hyperv: add timeout to vsock ready wait
ListenSetupWait() waited on errChan with no timeout, so podman machine
init/start could hang forever if the guest never signaled ready. Added
waitForReady(errChan, timeout) with a 30 second bound. Full details in
the issue.

Fixes: #29455

Signed-off-by: Rudra Dudhat <contact.rdudhat@gmail.com>
2026-08-12 14:28:26 +05:30
Matt Heon
0d43350b9c
Merge pull request #29466 from ROKUMATE/fix-machine-volume-unknown-opt-log
Some checks are pending
ci / sys local root fedora-prior (push) Blocked by required conditions
ci / int local rootless fedora-prior (push) Blocked by required conditions
ci / sys local rootless fedora-prior (push) Blocked by required conditions
ci / int remote root fedora-prior (push) Blocked by required conditions
ci / sys remote root fedora-prior (push) Blocked by required conditions
ci / int local root fedora-rawhide (push) Blocked by required conditions
ci / sys local root fedora-rawhide (push) Blocked by required conditions
ci / int local rootless fedora-rawhide (push) Blocked by required conditions
ci / sys local rootless fedora-rawhide (push) Blocked by required conditions
ci / int remote root fedora-rawhide (push) Blocked by required conditions
ci / sys remote root fedora-rawhide (push) Blocked by required conditions
ci / apiv2 root fedora-current (push) Blocked by required conditions
ci / bindings root fedora-current (push) Blocked by required conditions
ci / compose_v2 root fedora-current (push) Blocked by required conditions
ci / docker_py root fedora-current (push) Blocked by required conditions
ci / unit root fedora-current (push) Blocked by required conditions
ci / apiv2 rootless fedora-current (push) Blocked by required conditions
ci / compose_v2 rootless fedora-current (push) Blocked by required conditions
ci / unit rootless fedora-current (push) Blocked by required conditions
ci / upgrade v5.3.1 root fedora-current (push) Blocked by required conditions
ci / upgrade v5.6.2 root fedora-current (push) Blocked by required conditions
ci / machine linux amd64 (push) Blocked by required conditions
ci / windows unit (push) Blocked by required conditions
ci / windows e2e (push) Blocked by required conditions
ci / windows machine hyperv (push) Blocked by required conditions
ci / windows machine wsl (push) Blocked by required conditions
ci / macos machine applehv (push) Blocked by required conditions
ci / macos machine libkrun (push) Blocked by required conditions
ci / Total Success (push) Blocked by required conditions
zizmor: GitHub Actions Security Analysis / Zizmor (push) Waiting to run
pkg/machine/vmconfigs: log unknown volume option instead of printing to stdout
2026-08-11 19:27:13 -04:00
ROKUMATE
d591b83fce pkg/machine/vmconfigs: log unknown volume option instead of printing to stdout
Fixes: #29465
Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
2026-08-12 03:41:19 +05:30
Vishnu Kothakapu
2dac3a97fb Refactor: use %w for error wrapping in pkg/machine
Signed-off-by: Vishnu Kothakapu <vishnukothakapu27@gmail.com>
2026-08-12 02:23:44 +05:30
Aryanbhargava18
c8e8cb23cc pkg/machine: remove unused provider functions
The InstalledProviders and SupportedProviders functions were only
used in their own tests and were otherwise dead code. Removing them
entirely cleans up the API surface.

Signed-off-by: Aryanbhargava18 <aryanbhargava644@gmail.com>
2026-08-04 15:09:41 +05:30
Danish Prakash
e121ed6264
Merge pull request #28687 from jaitjacob/add-podman-machine-restart-command
Add `podman machine restart` subcommand
2026-07-22 09:53:10 +05:30
Jait Jacob
eb26516dba
make return explicit so CleanIfErr runs as expectd
Signed-off-by: Jait Jacob <jai8.jacob@gmail.com>
2026-07-21 23:30:29 +05:30
Jait Jacob
2ad3a79631
Add podman machine restart subcommand
Signed-off-by: Jait Jacob <jai8.jacob@gmail.com>
2026-07-16 21:51:11 +05:30
Mario Loriedo
452c40a1b6 Add machine e2e test for host.containers.internal
Add one more test to the basic podman commands e2e tests:
- starts an HTTP server on the host
- verify HTTP requests from a container, using
`host.containers.internal` or `host.docker.internal`, are routed
successfully to the server running on the host

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>

test

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2026-07-16 14:33:18 +02:00
Mario Loriedo
48f21de496 Fixing machine e2e gvproxy test
The lookup for the gvproxy process was broken on Windows:
- We looked for gvproxy, not gvproxy.exe, and `tasklist` was always
failing
- But `pgrep` wasn't failing because we looked for the wrong `tasklist`
error message (the correct error message on my laptop is "INFO: No tasks
are running which match the specified criteria.")
- WSL uses win-sshproxy.exe, not gvproxy.exe

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2026-07-15 11:42:11 +02:00
Mario Loriedo
d20b363e02 Always unprovision if the WSL machine init fail
Remove the just provisioned WSL distribution if one of the post install
scripts fail.

Fixes #27036

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2026-07-13 14:07:17 +02:00
Mario Loriedo
bec840d716 Fix lookup of HyperV VMs with matching name
Fixes https://github.com/podman-container-tools/podman/issues/29138

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2026-07-07 23:40:18 +02:00
Brent Baude
9ac9834a50
Merge pull request #29100 from afbjorklund/machine-cache
Restore caching of the default machine image
2026-07-02 10:05:27 -05:00