This is flaking in podman for a while[1], likely ever since we enabled
parallel tests. The cgroups may be removed while we try to gather stats,
that is normal and expected and should not lead to warnings.
If no cgroup is found we still return ErrStatCgroup so a caller can then
match this. There was attempt to fix this in podman[2] but we missed that
the warning is printed here.
Example output from the test:
$ podman stats -a --no-stream --no-reset
time="2025-04-10T06:24:16-05:00" level=warning msg="Failed to retrieve cgroup stats: open /sys/fs/cgroup/user.slice/user-6259.slice/user@6259.service/user.slice/user-libpod_pod_6c6a40019844d59a70070655263388f2e81a04e2764a1cc138b37d8202e1fefe.slice/libpod-655275f1c204008257f81ebe2503557ffadaa210f988b2d15c1cc818160af72a.scope/memory.stat: no such file or directory"
time="2025-04-10T06:24:16-05:00" level=warning msg="Failed to retrieve cgroup stats: open /sys/fs/cgroup/user.slice/user-6259.slice/user@6259.service/user.slice/user-libpod_pod_6c6a40019844d59a70070655263388f2e81a04e2764a1cc138b37d8202e1fefe.slice/libpod-655275f1c204008257f81ebe2503557ffadaa210f988b2d15c1cc818160af72a.scope/pids.current: no such file or directory"
ID NAME CPU % MEM USAGE / LIMIT MEM % NET IO BLOCK IO PIDS CPU TIME AVG CPU %
812b76331dbb a8bc9aac52b7-service 3.99% 0B / 4.092GB 0.00% 0B / 0B 0B / 0B 1 7.311ms 3.99%
...
[1] https://api.cirrus-ci.com/v1/artifact/task/5931471380152320/html/sys-podman-fedora-41-rootless-host-sqlite.log.html
[2] 1f44d0f8b2
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
All other errors are returned wrapped with the image ID so do the same
when the manifest blobl decoding fails.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
I saw a flake in parallel podman testing, podman images can fail if the
manifest was removed at the right time. In general listing should never
be able to fail when another image or manifest is removed in parallel.
Change the logic to convert to manifest and only collect the digests in
the success case and ignore all other errors to make the listing more
robust.
I observed the following error from podman images:
Error: locating image "xxx" for loading instance list: locating image with ID "xxx": image not known
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This now includes separate files for Go and Rust, plus a central
file with generic information that applies to all contributions.
This will let us get Netavark and Aardvark onboarded onto the
standard containers/common Contributing docs.
Signed-off-by: Matt Heon <mheon@redhat.com>
As the title says. In preparation for RHEL 9.6/10.0 ZeroDay with the
c/image fix for tar.xz errors in DiffiD.
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
* Document that variables can be listed without a value. Experimentally,
this worked for me, and it's documented in podman's `--env`. I'm
guessing supporting this in containers.conf too was intentional?
* Document that this config setting is ignored by `podman exec`, see
https://github.com/containers/podman/issues/25685
Fixes: https://github.com/containers/podman/issues/25685
Signed-off-by: David Mandelberg <david@mandelberg.org>
The new configuration files were initially generated by
`golangci-lint migrate`, when tweaked to minimize and simplify.
golangci-lint v2 switches to a new version of staticcheck which shows
much more warnings. Some of them were fixed by a few previous commits,
and the rest of them are disabled.
Also, golangci-extra was modified to include ALL staticcheck linters.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This fixes the following linter warning:
> pkg/retry/retry.go:50:4: SA4011: ineffective break statement. Did you mean to break out of the outer loop? (staticcheck)
> break
> ^
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This fixes the following linter warnings:
> pkg/auth/auth.go:176:11: ST1005: error strings should not be capitalized (staticcheck)
> return errors.New("Can't specify both --password-stdin and --password")
> ^
> pkg/auth/auth.go:179:11: ST1005: error strings should not be capitalized (staticcheck)
> return errors.New("Must provide --username with --password-stdin")
> ^
> pkg/subscriptions/subscriptions.go:325:17: ST1005: error strings should not be capitalized (staticcheck)
> return false, fmt.Errorf("Container /etc resolution error: %w", err)
> ^
> pkg/subscriptions/subscriptions.go:325:17: ST1005: error strings should not be capitalized (staticcheck)
> return false, fmt.Errorf("Container /etc resolution error: %w", err)
> ^
> pkg/subscriptions/subscriptions.go:334:17: ST1005: error strings should not be capitalized (staticcheck)
> return false, fmt.Errorf("Container /etc/system-fips resolution error: %w", err)
> ^
> pkg/subscriptions/subscriptions.go:451:10: ST1005: error strings should not be capitalized (staticcheck)
> return fmt.Errorf("Could not expand %q in container: %w", srcPolicyConfig, err)
> ^
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This fixes the following staticcheck warning:
> pkg/cgroups/utils_linux.go:224:25: QF1001: could apply De Morgan's law (staticcheck)
> if parts[2] == "/" && !(unifiedMode && parts[1] == "") {
> ^
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This fixes the following staticcheck warnings:
> libimage/image.go:463:5: QF1001: could apply De Morgan's law (staticcheck)
> if !(referencedBy == "" || numNames == 1) {
> ^
> libimage/normalize.go:33:5: QF1001: could apply De Morgan's law (staticcheck)
> if !(strings.ContainsAny(registry, ".:") || registry == "localhost") {
> ^
> libimage/search.go:220:6: QF1001: could apply De Morgan's law (staticcheck)
> if !(filterMatchesAutomatedFilter(&options.Filter, results[i]) && filterMatchesOfficialFilter(&options.Filter, results[i]) && filterMatchesStarFilter(&options.Filter, results[i])) {
> ^
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This fixes the following staticcheck warnings:
> pkg/configmaps/configmaps.go:135:5: QF1001: could apply De Morgan's law (staticcheck)
> if !(len(data) > 0 && len(data) < maxConfigMapSize) {
> ^
> pkg/secrets/secrets.go:169:5: QF1001: could apply De Morgan's law (staticcheck)
> if !(len(data) > 0 && len(data) < maxSecretSize) {
> ^
as well as the subsequent gocritic warnings:
> pkg/configmaps/configmaps.go:135:5: sloppyLen: len(data) <= 0 can be len(data) == 0 (gocritic)
> if len(data) <= 0 || len(data) >= maxConfigMapSize {
> ^
> pkg/secrets/secrets.go:169:5: sloppyLen: len(data) <= 0 can be len(data) == 0 (gocritic)
> if len(data) <= 0 || len(data) >= maxSecretSize {
> ^
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Fix the following staticcheck warning:
> pkg/timetype/timestamp.go:35:21: QF1001: could apply De Morgan's law (staticcheck)
> parseInLocation := !(strings.ContainsAny(value, "zZ+") || strings.Count(value, "-") == 3)
> ^
While at it, improve the comment.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This fixes the following staticcheck warning:
> libnetwork/netavark/config.go:297:2: QF1007: could merge conditional assignment into variable declaration (staticcheck)
> isMacVlan := true
> ^
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
... and add a deprecated alias so backward compatibility is still
preserved (and users can gradually switch to the new name).
Done because this is now also reported by staticcheck
(in addition to revive) linter.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>