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>
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>
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>
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>
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>
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>
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>
The current systemd service to mount /etc/containers is not working
right. The Before=podman.socket causes a ordering conflict which causes
the socket to be disabled and thus all podman remote connections fail.
The problem is the unit is wanted by the default.target while the socket
is wanted by sockets.target which can be before the default.target is
triggered. That means that the Before= line cannot be fulfilled and
sometimes systemd thus seems to not start the socket. It is unclear to
me why this is racy as it is sometimes also works.
This was reported by Vladimir Lazar from the PD team, our CI did not
caught this as we use rootless machines by default and the problem only
happens for the rootful socket so we do not see connection failures.
To fix this add at least one rootful socket check.
We do however have a different CI flake that was also caused by the
incorrect mount dependencies. The mount could happen after sshd or other
programs run. So to fix this we must hook the podman-mnt-config.service
into the local-fs.target which runs much earlier and is used for all the
mounts.
Fixes: #29003
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
It was removed, with the hardcoded image reference.
So cache was always off, even for the default image.
Fixes: #29090
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
When the command output is logged we do not need an extra pipe and
scanner to read the output line by line, we can just log it directly via
a writer.
Now this of course does loose the line by line parsing of the scanner
but IMO this is better as it is simpler and less code to worry about.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
When WSL wasn't installed, the lookup erroneously reported that
a VM with the same name existed. Instead, in this case, the lookup
should return zero matching VMs.
Fixes https://github.com/podman-container-tools/podman/issues/29053
Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
I think this should work fine with the defaults. Since we mount the
/etc/containers dir always we should no longer write to /etc/containers.
If we still need this it should be moved into the image and not done at
init time.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
FCOS symlinks /home to var/home. systemd rejects a mount unit whose
Where= path traverses a symlink, breaking default home dir mounts.
Resolve known FCOS symlinks before writing the ignition unit.
Fixes: #28911
Signed-off-by: Chanhyeok Seo <chanhyeok.seo@datadoghq.com>
systemd interprets % as specifier characters in unit configuration files
(e.g. %H, %u, %40). Proxy environment variable values that contain
percent-encoded URL characters (such as %40 for @ in usernames) cause
systemd to emit warnings and fail to parse the generated
/etc/systemd/system.conf.d/default-env.conf:
system.conf.d/default-env.conf:2: Failed to resolve specifiers in
HTTP_PROXY=http://user%40example.com@proxy:3128
Fix by adding a bash variable substitution that doubles every % to %%
before writing to the systemd unit conf files. The profile.d and
environment.d destinations do not need this escaping and continue to
use the original value.
Fixes#28698
Signed-off-by: crawfordxx <crawfordxx@users.noreply.github.com>
We are seeing frequent flakes in hyperV machine tests. The machine start
fails with an ssh handshake failure:
ssh: handshake failed: read tcp 127.0.0.1:56425->127.0.0.1:56377:
wsarecv: An existing connection was forcibly closed by the remote host.
Normally we do the ssh probe in conductVMReadinessCheck() with a retry
mechanism, however because the hyperV mount code already used ssh in
PostStartNetworking() we never got there and failed early.
PostStartNetworking seems the wrong place to mount anyway so move this
to MountVolumesToVM() instead which is placed after the ready check
already so it should have a working ssh by then.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Change isHyperVAdminMember from returning a bool to returning an error so that callers surface the specific failure reason — particularly distinguishing "not in the group" from "in the group but session not updated" (new ErrHypervUserSessionNotUpdated sentinel). This gives users actionable guidance instead of a generic permission error.
Signed-off-by: lstocchi <lstocchi@redhat.com>