1929 Commits
Author SHA1 Message Date
Sebastiaan van Stijn 58d23ab638 pkg/tracing: HTTPStatusCodeAttributes: remove use of deprecated SemConv const
The "http.status_code" attribute was deprecated in [SemConv v1.21] in favor
of "http.response.status_code", and the `HTTPStatusCodeKey` const was deprecated
in [SemConv v1.22].

The `HTTPStatusCodeAttributes` utility doesn't appear to be used currently, but
let's update it to use both the old and new variants in case someone still uses
it.

[SemConv v1.21]: https://github.com/open-telemetry/opentelemetry-go/blob/v1.38.0/semconv/v1.21.0/attribute_group.go#L106-L114
[SemConv v1.22]: https://github.com/open-telemetry/opentelemetry-go/blob/v1.38.0/semconv/v1.22.0/attribute_group.go#L1444-L1452

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0d27fceeed)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-17 09:59:37 +01:00
dependabot[bot] 50d0e4fd4c build(deps): bump github.com/containerd/cgroups/v3 from 3.1.0 to 3.1.1
Bumps [github.com/containerd/cgroups/v3](https://github.com/containerd/cgroups) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/containerd/cgroups/releases)
- [Commits](https://github.com/containerd/cgroups/compare/v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: github.com/containerd/cgroups/v3
  dependency-version: 3.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit 13b1f43712)
2025-12-02 06:50:22 +05:30
Akihiro Suda 2e0e47c472 Deprecate cgroup v1
For issue 12443

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-10-31 19:34:16 +09:00
Akihiro Suda 04d8ae1d6f Postpone v2.2 deprecation items to v2.3
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-10-28 00:08:57 +09:00
suranmiao 9e9620dd68 chore: fix some function names in comment
Signed-off-by: suranmiao <solsui@outlook.com>
2025-10-17 09:54:21 -07:00
Fu Wei 61ddcd5372 Merge pull request #12063 from dmcgowan/mount-manager
Add mount manager
2025-10-03 14:01:38 +00:00
Derek McGowan 069cbfe8f0 Use mount manager for temp mounts
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-09-29 17:08:37 -07:00
Osama Abdelkader 739821fc5d pkg/display: use platforms.Format for platform display
Replace manual platform formatting with containerd's platforms.Format()
function to ensure consistent platform string formatting across the
codebase. This removes the TODO comment and handles platform variants
properly.

Fixes the TODO in manifest_printer.go line 124.

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
2025-09-29 18:15:34 +03:00
Enji Cooper f45716efed Clean up issues cited by usetesting package with golangci
This commit makes all of the recommended changes to use the `testing`
package helper functions instead of doing the equivalent longhand
versions of the same thing.

This change was needed in order to properly detect errors, as the code
would previously skip running `tenv` stating that it had been deprecated
in favor of `usetesting`.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
2025-09-07 14:07:40 -07:00
Sebastiaan van Stijn c77b708525 pkg/cio: Close(): use errors.Join to return all errors
Preserve all errors encountered, instead of only the last one.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 09:55:56 +02:00
Derek McGowan cc2a52ca8f Update pkg/oci to use FS interface
Switch to use fs.FS interface over directly requiring path string.
Use os.OpenRoot over continuity RootPath.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-08-29 12:59:35 -07:00
Mike Brown 9aebe599ec Merge pull request #12217 from klihub/devel/main/update-nri
nri: update NRI to v0.10.0.
2025-08-22 17:37:09 +00:00
Krisztian LitkeyandChris Henzie b7a401f1d2 cri: warn about deprecated v0.1.0-style NRI plugins.
Co-authored-by: Chris Henzie <chrishenzie@google.com>
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
2025-08-21 21:37:56 +03:00
Maksym Pavlenko a5390cda20 Merge pull request #11966 from zouyee/master
fix: preserve nsPath on mount failure to ensure cleanup
2025-08-20 03:02:28 +00:00
Maksym Pavlenko c5372ac8b1 Merge pull request #11942 from thaJeztah/oci_test_WithParentCgroupDevices
pkg/oci: add basic test for WithParentCgroupDevices
2025-08-18 20:51:21 +00:00
Wei Fu 6ce7f6d87a pkg/sys: check SupportsPidFD first
Checking this earlier and bailing is preferable to checking this to after we
try to StartProcess.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2025-08-12 14:53:29 -04:00
Jose Fernandez 45e02e1dc1 sys: fix pidfd leak in UnshareAfterEnterUserns
UnshareAfterEnterUserns() creates a pidfd via os.StartProcess() with
CLONE_PIDFD but fails to close the file descriptor in any code path,
resulting in a file descriptor leak for every container that uses user
namespace isolation.

The leak occurs because:
- The pidfd is created when PidFD field is set in SysProcAttr
- The original defer block only calls PidfdSendSignal() and
  pidfdWaitid()
- No code path calls unix.Close(pidfd) to release the file descriptor

This causes one pidfd leak per container launch when user namespace
isolation is enabled (e.g., Kubernetes pods with hostUsers: false). In
production environments with high container churn, this can exhaust the
system's file descriptor limit.

Fix the leak by adding a defer statement immediately after process
creation that ensures unix.Close(pidfd) is always called, regardless of
which code path is taken. This guarantees cleanup even if the function
returns early due to errors or lack of pidfd support.

This follows the same cleanup pattern already established in
core/mount/mount_idmapped_utils_linux.go:getUsernsFD() which properly
closes its pidfd.

Closes: #12166
Signed-off-by: Jose Fernandez <josef@netflix.com>
2025-08-06 20:26:48 -06:00
Fu Wei 87742bd35f Merge pull request #11857 from djdongjin/remove-go-version-specific-code
chore: remove go version specific code
2025-07-06 19:02:31 +00:00
yashsingh74 03a44a2d7c fix: Used nolint to ignore the static checks
Signed-off-by: yashsingh74 <yashsingh1774@gmail.com>
2025-06-18 14:16:41 +05:30
yashsingh74 403f86ecc2 fix: QF1012: Use of fmt.Fprintln(...)
Signed-off-by: yashsingh74 <yashsingh1774@gmail.com>
2025-06-18 14:16:41 +05:30
yashsingh74 d93d18c857 fix: QF1001: could apply De Morgan's law (staticcheck)
Signed-off-by: yashsingh74 <yashsingh1774@gmail.com>
2025-06-18 14:16:41 +05:30
Jin Dong 734d52c39c chore: remove specific go version code
Now that we have 1.24.x as go min version, I think
we can remove this go code specific to a lower
version.

Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2025-06-12 21:35:09 -04:00
zouyee 04ce9f884d feat: preserve nsPath on mount failure to ensure cleanup
Signed-off-by: zouyee <zouyee1989@gmail.com>
2025-06-12 14:59:10 +08:00
Mike Brown 4bcd549f74 Merge pull request #11946 from thaJeztah/oci_privileged_no_var
pkg/oci: don't use var for WithPrivileged
2025-06-09 02:00:28 +00:00
Akihiro Suda cd0f2cc23a Merge pull request #11945 from thaJeztah/oci_no_vars_for_funcs
pkg/oci: don't use vars for WithAllKnownCapabilities, WithAllCurrentCapabilities
2025-06-08 06:19:37 +00:00
Maksym Pavlenko a6c250ed77 Merge pull request #11938 from thaJeztah/oci_linting
pkg/oci: fix minor linting issues
2025-06-06 22:21:33 +00:00
Phil Estes 0bf07cd5c6 Merge pull request #11939 from thaJeztah/oci_rm_go116
pkg/oci: remove compatibility code for go1.16 and older
2025-06-04 15:02:30 +00:00
Sebastiaan van Stijn 8de612020e pkg/oci: don't use var for WithPrivileged
This variable was introduced in 062c3a00ef,
which didn't describe it as intentional to be able to override the option.

Based on the above, I assume the use of a variable was purely convenience,
the there's no intent for packages to be able to override them, so this
patch changes these to be a regular function.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-04 16:35:13 +02:00
Sebastiaan van Stijn cf667aa7ee pkg/oci: add basic test for WithParentCgroupDevices
It was not used in the code, and had no coverage, so adding some
basic unit-tests.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-04 16:19:00 +02:00
Sebastiaan van Stijn d72c21450f pkg/oci: don't use vars for WithAllKnownCapabilities, WithAllCurrentCapabilities
These were introduced in c818a6b13d, refactored
in 808b223536 and bdd84abf05,
and moved in a2d1a8a865, but none provided
a motivation for using a variable / alias for these.

Based on the above, I assume the use of a variable was purely convenience,
the there's no intent for packages to be able to override them, so this
patch changes these to be a regular function.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-04 16:10:41 +02:00
Sebastiaan van Stijn ac3c3ad5da pkg/oci: cleanup some tests
- Use testify for asserting
- Fix various unhandled errors
- Use native t.TempDir() for temporary files

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-04 13:42:09 +02:00
Sebastiaan van Stijn 4de598d94b pkg/oci: remove compatibility code for go1.16 and older
These were added as part of b7f673790f,
to provide backward compatibility with go1.16, which we no longer
supports, so we can remove this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-04 12:52:40 +02:00
Sebastiaan van Stijn 17c632e785 pkg/oci: fix minor linting issues
- remove redundant aliases for imports
- rename variables that shadowed imports
- use errors.Is instead of straight error comparing

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-04 12:45:57 +02:00
Derek McGowan aa9c17c692 Add symlink breakout test for overriden path
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-05-20 16:58:12 -07:00
Akihiro Suda f209a82ca9 Merge pull request #11860 from thaJeztah/oci_no_panic
pkg/oci: prevent panic for some platform-specific options
2025-05-20 16:53:38 +00:00
Sebastiaan van Stijn b0052d94a6 pkg/oci: prevent panic for some platform-specific options
Some of these options are designed to be a no-op when used on a Spec
that doesn't match the platform for the option. However, if the given
plaform was not present, they would panic.

This patch:

- Adds an early-return for options that are only applied on a
  specific platform.
- Update the GoDoc for these functions to describe they're a
  no-op on other platforms.
- Adds some rudimentary unit-tests to verify their behavior.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-15 00:44:45 +02:00
Samuel Karp 38c9bb93a3 Revert "perf(applyNaive): avoid walking the tree for each file in the same directory"
This reverts commit d8063c30dd.

Signed-off-by: Samuel Karp <samuelkarp@google.com>
2025-05-12 16:36:10 -07:00
Derek McGowan 7360c739fc Fix image inspect skip over missing content
Rather than exiting early with an error, just output that the content
does not exist locally and continue. This is helpful for displaying
multiplatform images when the content for every platform was not pulled.
If a platform that did not exist locally showed up before one that did,
the inspect would error out before even showing the content.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-05-05 16:13:39 -07:00
Derek McGowan ae9b003d24 Merge pull request #10762 from mxpv/dbg
Enable HTTP debug and trace for transfer based puller
2025-04-24 16:22:02 +00:00
Maksym Pavlenko 17b6e1ef85 Allow streaming to client
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2025-04-23 18:03:29 -07:00
Maksym Pavlenko bd8e6c727d Enable http debug and tracing for non local puller
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2025-04-23 17:39:57 -07:00
Maksym Pavlenko 27e6c117d9 Move HTTP debug code to pkg
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2025-04-23 17:38:47 -07:00
Sebastiaan van Stijn 1477874494 use lazyregexp to compile regexes on first use
- internal/cri/bandwidth: use lazyregexp to compile regexes on first use
- pkg/identifiers: use lazyregexp to compile regexes on first use
- pkg/progress: use lazyregexp to compile regexes on first use
- pkg/reference: use lazyregexp to compile regexes on first use
- pkg/sys: use lazyregexp to compile regexes on first use

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-22 20:29:14 +02:00
Phil Estes 250593568f Merge pull request #11684 from AkihiroSuda/postpone-deprecation-2.1
config: postpone planned v2.1 deprecations to v2.2
2025-04-17 02:02:48 +00:00
Akihiro Suda 764dcf77a8 config: postpone planned v2.1 deprecations to v2.2
We going to release v2.1 earlier than we have once expected at that time,
so extend the grace period for migration.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-04-17 09:14:15 +09:00
Akihiro Suda 499238a52a Remove deprecated dynamic library plugins
Dynamic library plugins have been deprecated since v2.0 (PR 9238)

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-04-17 09:12:46 +09:00
Akihiro Suda d9c889568e Remove the support for Schema 1 images
Schema 1 (`application/vnd.docker.distribution.manifest.v1+prettyjws`) has been
officially deprecated since containerd v1.7 (PR 6884), and disabled since v2.0 (PR 9765).

Users who have been seeing warnings like `conversion from schema 1 images is deprecated`
now have to rebuild the image with Schema 2 or OCI.

Schema 2 was introduced in Docker 1.10 (Feb 2016), so most users should have been already
using Schema 2 or OCI.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-04-11 09:03:26 +09:00
QiPing Wan be9ca11a14 fix call fmt.Errorf with wrong error
Signed-off-by: QiPing Wan <alingse@foxmail.com>
2025-04-08 09:09:40 +08:00
ningmingxiao 1dbb7f2ae3 pkg/sys: improve GetLocalListener/CreateUnixSocket error message
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2025-04-01 12:53:41 +08:00
Jin Dong 42effa3b91 Mark NetworkPluginBinDir as DEPRECATED
To make it as DEPRECATED, this PR does the following:

1. Changes config default to use `NetworkPluginBinDirs`;
2. Mark `NetworkPluginBinDir` as deprecated (in config version 3);
3. Add config migration from 2 to 3, which migrates `bin_dir`
  in version 2 to `bin_dirs` in version 3.

Signed-off-by: Jin Dong <djdongjin95@gmail.com>

[wip] add deprecation warning

Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2025-03-21 16:59:32 +00:00