Commit Graph

4206 Commits

Author SHA1 Message Date
openshift-merge-bot[bot] f188150c90 Merge pull request #2416 from kolyshkin/numa-count
pkg/sysinfo: rm unused code
2025-04-14 09:49:38 +00:00
openshift-merge-bot[bot] 530946ee9c Merge pull request #2418 from containers/renovate/golangci-golangci-lint-2.x
chore(deps): update dependency golangci/golangci-lint to v2.1.1
2025-04-13 10:15:30 +00:00
renovate[bot] 96a18090f4 chore(deps): update dependency golangci/golangci-lint to v2.1.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-12 22:23:24 +00:00
Kir Kolyshkin 343e8a3301 sysinfo: use bits.OnesCount64, drop popcnt
Slightly less code to maintain.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-04-11 13:37:14 -07:00
Kir Kolyshkin fa9de4d919 pkg/sysinfo: remove NUMANodeCount
Found a few issues in this code and went ahead to fix them one by one,
only to find out this function is not used anywhere in our codebase
or otherwise (see [1], [2]).

Remove it.

[1]: https://github.com/search?q=org%3Acontainers+NUMANodeCount&type=code
[2]: https://sourcegraph.com/search?q=context%3Aglobal+sysinfo.NUMANodeCount

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-04-11 12:47:57 -07:00
openshift-merge-bot[bot] 1f01f181b9 Merge pull request #2415 from Luap99/cgroups-flake
pkg/cgroups: do not log ENOENT for Stat()
2025-04-11 14:53:32 +00:00
Paul Holzinger 910fdac6f2 pkg/cgroups: do not log ENOENT for Stat()
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>
2025-04-11 16:28:46 +02:00
openshift-merge-bot[bot] 684909168b Merge pull request #2400 from Luap99/list-manifest
libimage: fix manifest race during listing
2025-04-09 18:55:57 +00:00
Paul Holzinger 02cdcc4a73 libimage/manifests: LoadFromImage() wrap all errors
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>
2025-04-09 13:54:30 +02:00
Paul Holzinger bd719bf41b libimage: fix manifest race during listing
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>
2025-04-09 13:54:30 +02:00
openshift-merge-bot[bot] ea3eb7865a Merge pull request #2414 from containers/renovate/github.com-containernetworking-cni-1.x
fix(deps): update module github.com/containernetworking/cni to v1.3.0
2025-04-09 10:12:36 +00:00
renovate[bot] 0aee30b0e2 fix(deps): update module github.com/containernetworking/cni to v1.3.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-07 18:45:08 +00:00
openshift-merge-bot[bot] 49c0f52f6f Merge pull request #2405 from containers/renovate/github.com-fsnotify-fsnotify-1.x
fix(deps): update module github.com/fsnotify/fsnotify to v1.9.0
2025-04-07 14:00:31 +00:00
renovate[bot] 16e5e465c7 fix(deps): update module github.com/fsnotify/fsnotify to v1.9.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-07 11:43:55 +00:00
openshift-merge-bot[bot] cdc5417174 Merge pull request #2412 from giuseppe/enable-fanotify-init
seccomp: allow fanotify_init without CAP_SYS_ADMIN
2025-04-07 11:42:48 +00:00
Giuseppe Scrivano b690083685 seccomp: allow fanotify_init without CAP_SYS_ADMIN
Closes: https://github.com/containers/common/issues/2411

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-04-07 12:49:20 +02:00
openshift-merge-bot[bot] f282f5e7c4 Merge pull request #2409 from containers/renovate/golang.org-x-crypto-0.x
fix(deps): update module golang.org/x/crypto to v0.37.0
2025-04-07 10:06:36 +00:00
renovate[bot] 3ca1435dc1 fix(deps): update module golang.org/x/crypto to v0.37.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-07 09:51:38 +00:00
openshift-merge-bot[bot] fd5c95ed92 Merge pull request #2410 from containers/renovate/github.com-onsi-ginkgo-v2-2.x
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.23.4
2025-04-07 09:50:04 +00:00
renovate[bot] c2a8da27e2 fix(deps): update module github.com/onsi/ginkgo/v2 to v2.23.4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-06 22:30:39 +00:00
openshift-merge-bot[bot] c3b44b3926 Merge pull request #2403 from containers/renovate/github.com-onsi-gomega-1.x
fix(deps): update module github.com/onsi/gomega to v1.37.0
2025-04-03 13:57:52 +00:00
renovate[bot] e994ff6ba2 fix(deps): update module github.com/onsi/gomega to v1.37.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-02 17:48:55 +00:00
openshift-merge-bot[bot] 3d45cac2f0 Merge pull request #2401 from flouthoc/refactor-pull
libimage: remove unnecessary reportResolvedReference from `NewCopier`
2025-04-01 16:54:12 +00:00
flouthoc 4b1b30ec19 libimage: remove unnecessary reportResolvedReference
After https://github.com/containers/common/pull/2339 there is no for
this argument so remove this.

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2025-04-01 07:04:10 -07:00
openshift-merge-bot[bot] 7127725085 Merge pull request #2399 from containers/renovate/github.com-opencontainers-runtime-tools-digest
fix(deps): update github.com/opencontainers/runtime-tools digest to 260e151
2025-04-01 09:25:24 +00:00
renovate[bot] a32fe19969 fix(deps): update github.com/opencontainers/runtime-tools digest to 260e151
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-01 08:56:24 +00:00
openshift-merge-bot[bot] e8db0510e0 Merge pull request #2398 from containers/renovate/github.com-containers-storage-digest
fix(deps): update github.com/containers/storage digest to 3fc5c23
2025-04-01 08:55:08 +00:00
renovate[bot] ec7b0cc096 fix(deps): update github.com/containers/storage digest to 3fc5c23
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-01 03:16:48 +00:00
openshift-merge-bot[bot] 66b165acd3 Merge pull request #2397 from Luap99/merge-back
Merge back v0.62.3 into main and update c/image to latest
2025-03-28 18:35:45 +00:00
openshift-merge-bot[bot] 50e11d2098 Merge pull request #2386 from mheon/update_contributing
Update CONTRIBUTING.md and split by language
2025-03-28 16:59:26 +00:00
Paul Holzinger 9317b6cd93 vendor: update c/image to latest
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-03-28 17:05:09 +01:00
Paul Holzinger a5770354bd Merge tag 'v0.62.3' into merge-back
Merge the tag back into main to make go modules aware that main is newer
than this tag.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-03-28 17:03:33 +01:00
Matt Heon afe2542665 Update CONTRIBUTING.md and split by language
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>
2025-03-28 09:55:58 -04:00
openshift-merge-bot[bot] 80640ebcf7 Merge pull request #2378 from Luap99/http-docker-err
pkg/retry: retry 50{2,3,4} server errors
2025-03-27 19:07:18 +00:00
tomsweeneyredhat 2733406e1c [v0.62] Bump c/common to v0.62.3
Bump to c/common to v0.62.3 to vendor in c/image v5.34.3.

This is the second SIC vendor dance step dance to resolve a DiffID
issue noted in https://issues.redhat.com/browse/RHEL-85218 and
https://issues.redhat.com/browse/RHEL-85219

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-03-27 14:02:43 -04:00
tomsweeneyredhat a255a0f012 [v0.62] Bump c/image to v5.34.3
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>
2025-03-27 14:01:11 -04:00
openshift-merge-bot[bot] 8d9cebf006 Merge pull request #2393 from dseomn/containers-conf-env
Clarify the documentation of containers.env
2025-03-27 09:08:09 +00:00
David Mandelberg 4af2f86f37 Clarify the documentation of containers.env
* 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>
2025-03-26 14:23:55 -04:00
openshift-merge-bot[bot] d093d6c769 Merge pull request #2389 from kolyshkin/golangci-v2
Switch to golangci-lint v2, cleanup config, fix new linter warnings
2025-03-26 18:08:46 +00:00
openshift-merge-bot[bot] d43b78a7ba Merge pull request #2390 from Luap99/copy-err
libimage: fix one copyToStorage error message
2025-03-26 16:37:55 +00:00
Kir Kolyshkin 670d57ae83 ci: switch to golangci-lint v2.0
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>
2025-03-26 09:37:44 -07:00
Kir Kolyshkin 702b726c21 pkg/retry: rm unused break
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>
2025-03-26 09:36:14 -07:00
Kir Kolyshkin 8b1718ffee pkg: do not capitalize error strings
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>
2025-03-26 09:36:14 -07:00
Kir Kolyshkin a25e5a56a8 libimage: silence a staticcheck warning
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-26 09:36:14 -07:00
Kir Kolyshkin 163ec20d8a pkg/cgroups: apply De Morgan's law
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>
2025-03-26 09:36:14 -07:00
Kir Kolyshkin 9da372fd2c libimage: apply De Morgan's law
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>
2025-03-26 09:36:14 -07:00
Kir Kolyshkin 566c24e784 pkg: apply De Morgan's law
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>
2025-03-26 09:36:14 -07:00
Kir Kolyshkin 2a6974f334 pkg/timetype: fix linter warning, improve comment
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>
2025-03-26 09:36:14 -07:00
Kir Kolyshkin 14c831e003 libnetwork/netavark: simplify isMacVlan init
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>
2025-03-26 09:36:14 -07:00
Kir Kolyshkin 555b817630 libnetwork/types: rename RegexError to ErrInvalidName
... 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>
2025-03-26 09:36:14 -07:00