os.Exit(1) kills the process without ginkgo getting a chance to report
anything, so a failure here shows up as a suite that just stopped with
no output. All six sites run inside ginkgo, three in a SynchronizedBefore
Suite and a helper and three inside It blocks, so Expect works and prints
the error and the location.
The os.Exit(m.Run()) in TestMain stays, that one is correct.
Part of #18540.
Signed-off-by: Tushar Verma <tusharmyself06@gmail.com>
A bool assert on the parsed repo/tag map says nothing about the actual
images output when it fails. Match the line with a regex instead, the
failure then prints every line and the pattern. This also removes
tagOutputToMap which had no other user.
Part of #18540.
Signed-off-by: Tushar Verma <tusharmyself06@gmail.com>
Both users are plain if conditions, strings.Contains on the output
does the same without a helper.
Part of #18540.
Signed-off-by: Tushar Verma <tusharmyself06@gmail.com>
Matching a bool and then indexing into the returned lines gives no
useful output when it fails. Use gomega matchers on the output array
instead, they print the array and the expected match on failure.
Part of #18540.
Signed-off-by: Tushar Verma <tusharmyself06@gmail.com>
bs=1G means "read 1GB into memory at a time"; we really
don't need that.
On a system with 6GB physical memory (while our test VM is
configured to have 8 GB of virtual RAM), this seems to result
in trashing and exceeding the 30s timeout, while with a
smaller block size, the copy happens in <13 seconds. (dd itself
reports 11 s vs. 27 s).
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Imported volumes now get ownership and permissions matching the
container's mount tareget.
Previously, permission adjustment was skipped for imported volumes as
they were already non-empty when mounted.
Fixes: #25442
Signed-off-by: Jiwoo Ahn <ikwydls1314@gmail.com>
Problem: podman artifact ls has no way to print just artifact
identifiers. Scripts that want to act on artifacts (e.g. remove them)
have to parse table output or use --format {{.Digest}}. Every other
listing command in podman (images, ps, artifact push/pull) already
supports -q/--quiet for this.
Impact: users can now run `podman artifact ls --quiet` to get one
digest per line, no header, suitable for piping into other podman
commands.
Change: adds a --quiet/-q bool flag to the list command. When set (and
--format is not also given), output.Digest is printed for each
artifact instead of the table.
Signed-off-by: umar11b <uzaman2018@gmail.com>
strings.Split(output, "\n") on empty output returns [""], not []. so
ErrorToStringArray() reported empty stderr as one line of empty output
instead of no output, and any caller checking len() got a wrong count.
volume_ls_test.go had to carry HaveLen(1) just to tolerate that on
empty stderr, updated to BeEmpty() now that the length is actually
correct.
filter out empty lines when building the result.
Signed-off-by: Atishyy27 <142108881+Atishyy27@users.noreply.github.com>
The 'podman artifact ls' command supports a --format flag accepting a go template string. Some commands (eg 'podman image ls') accept a --format=json parameter, and export pure json object to stdout.
This change adds a --format=json output mode to artifact lists too.
Includes simple documentation mention of --format=json option alongside go template description.
Signed-off-by: ellieayla <1447600+me@users.noreply.github.com>
An emptyDir with "medium: Memory" was translated into a per-container
tmpfs mount, so every container in the pod received its own empty
filesystem. Data written by an init container was therefore invisible to
the regular containers, while Kubernetes specifies that an emptyDir is
shared by all containers in the pod and outlives the init container.
Create an anonymous named volume backed by tmpfs instead. Every
container in the pod refers to the same volume name, so the mount is
shared, and the volume is still removed together with the pod. The
emptyDir sizeLimit is passed through as the tmpfs size option, which was
previously ignored.
Fixes: #29555
Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
The farm command is helpful when it comes to building
multi-architecture container images, with a build out on various
different CPU architecture machines (e.g. amd64, arm64 etc). This
produces a multi-architecture image usable on many different kinds
of machines. Once those farms are built, we can list them out (ls)
in a human readable format.
Currently, podman farm list prints out every field (name,
connections, default, etc). The --quiet/-q flags cut the noise by
only printing the names of the farms, rather than all the other
farm list metadata.
The benefit of having this feature is for automation and scripts to
pull just the farm names from the list, which is mostly important
for CI pipelines to loop over.
Signed-off-by: umar11b <uzaman2018@gmail.com>
The "podman kube --quiet with error" test hardcoded
quay.io/libpod/alpine_nginx:latest directly inside a YAML string instead of
using the NGINX_IMAGE constant, which is already defined per architecture.
This instance was missed in commit cd2f122, which fixed the same pattern in
five other tests in this file, because it used a raw inline literal rather
than the variable.
Signed-off-by: Aryan Nishad <157164036+aryannishad-86@users.noreply.github.com>
The Pod key of a .container unit accepts systemd specifiers, but handlePod
looked the referenced pod up in the units map using the raw value, so
"Pod=%N.pod" failed with "quadlet pod unit %N.pod does not exist" instead
of resolving to the pod named after the container's service.
Expand %N to the container's service name before the lookup, matching the
existing handling in GetContainerResourceName. Since %N is the service
name, setting ServiceName= lets the container and pod unit files use
different names.
Add e2e cases for both combinations: a pod named after the container
file, and a pod named after a ServiceName that differs from the file
name.
Fixes: #29108
Signed-off-by: Salih Muhammed <root@lr0.org>
ignore warn and strict modes for unknown yaml fields and kinds
ignore is the default and skips them warn reports them strict fails
warnings are returned in the play report so they show up in the cli and over the api for tools like podman desktop
Closes#18332
Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
Docker now reserves alias specfically for user-defined aliases, and uses another field, dnsnames, to hold all aliases, including container ID and name.
Part of docker v1.45 compat work, but this touches the cli too, since they updated it there too.
Signed-off-by: Ashley Cui <acui@redhat.com>
runc doesn't support --tcp-close, so this test always failed there
once the flag hit the runtime. Skip it entirely for non-crun since
since --tcp-established already covers runc above.
Signed-off-by: Ricardo Branco <rbranco@suse.de>
Both the tcp-established and tcp-close checkpoint/restore tests expect
a restore rejected due to an established TCP connection to fail with
"runc: criu failed: type NOTIFY errno 0". criu's RPC server actually
reports this failure as type RESTORE, not NOTIFY. Widen the regex in
both tests to accept RESTORE while still tolerating NOTIFY.
Signed-off-by: Ricardo Branco <rbranco@suse.de>
The 'podman healthcheck on valid container' test was skipped since 2019 due to a consistent flake. The root cause was a brittle manual 5-second polling loop that failed on heavily loaded CI runners before the healthcheck daemon could initialize.
This commit modernizes the polling logic by replacing the manual loop with Ginkgo's robust Eventually block with a 30-second timeout, allowing the test to run reliably on all environments, and removes the Skip directive.
Signed-off-by: Aryanbhargava18 <aryanbhargava644@gmail.com>
pasta's IPv6 local-mode forwarding requires an unreleased upstream
patch. Skip the affected E2E tests until the fix ships in a pasta
release.
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
The cgroups=split e2e test wraps podman in systemd-run --scope but does not request cgroup delegation. Without Delegate=yes, systemd does not guarantee that controllers like pids are written to cgroup.subtree_control for child cgroups. Whether they appear depends on the systemd session state at that moment, causing flaky crun failures when it tries to use unavailable controllers.
Fixes: #28944
Signed-off-by: Satwik Sai Prakash Sahoo <sahoospsatwik@gmail.com>
With the new config work we expect policy.json to be shipped under
/usr/share/containers/policy.json. However the CI VMs and local users
might still have it in /etc so instead of assuming any host path lets
just create our own files for the --signature-policy tests.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
The SELinux volume-permissions NOTE only applies to unprivileged,
rootless containers on an SELinux-enabled host. Emit it only when
both conditions hold, instead of on every volume-bearing object.
Add an e2e case generating from a standalone container with a volume,
asserting the NOTE appears only when rootless and SELinux is enabled.
Fixes: #17743
Signed-off-by: i-OmSharma <sharmaom1201@gmail.com>
Docker-compatible inspect templates using `{{.HostIp}}` fail in Podman
because Go templates resolve by struct field name (`HostIP`), not JSON
tag (`HostIp`). Add a `HostIp()` method so both notations work.
Note: this does not address the struct-vs-map difference that prevents
`range` over individual port bindings (would require an API break).
Relates: https://github.com/podman-container-tools/podman/issues/29164
Signed-off-by: Jan Rodák <hony.com@seznam.cz>