584 Commits

Author SHA1 Message Date
Samuel Karp
bc69a52680 Merge pull request #13167 from lauralorenz/10681-ctr-image-export-oci-ref-name
#10681 by-digest `ctr image export` of `org.opencontainers.image.ref.name`
2026-04-28 22:29:59 +00:00
Fu Wei
1aef5484c5 Merge pull request #12667 from dmcgowan/transfer-extrarefs-gc
Update transfer service to support automatically garbage collecting extra references
2026-04-24 16:11:21 +00:00
Derek McGowan
978c03f83a Update import tests to handle index and manifest digests
Signed-off-by: Derek McGowan <derek@mcg.dev>
2026-04-23 11:20:16 -07:00
Derek McGowan
5d8c1433a7 Update restart monitor test to not use deprecated address field
Signed-off-by: Derek McGowan <derek@mcg.dev>
2026-04-21 18:02:41 -07:00
Laura Lorenz
75d32fda0f Check for digest only when setting org.opencontainers.image.ref.name
On export, if the image is by-digest without any tag,
set the org.opencontainers.image.ref.name as the full name.
This prevents setting this field with a leading non-alphanum,
which is incorrect OCI grammar. Fixes #10681.

Signed-off-by: Laura Lorenz <lauralorenz@google.com>
2026-04-15 22:15:58 +00:00
Laura Lorenz
e62fd80ade Add test for org.opencontainers.image.ref.name grammar
Uses the definition of valid grammar for this field
from the OCI image annotations spec:
e72ae99d5f/annotations.md (pre-defined-annotation-keys)

On this commit the test will fail per the bug #10681
`manifest annotation org.opencontainers.image.ref.name
="@sha256:7b3ccabffc97de872a30dfd234fd972a66d247c8cfc69b0550f276481852627c"
 does not match required grammar`

Signed-off-by: Laura Lorenz <lauralorenz@google.com>
2026-04-10 15:59:55 +00:00
Maksym Pavlenko
73edc80451 Format code after cherry pick
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2026-04-08 08:29:28 -05:00
Sergey Kanzhelev
05d3b31586 pause image 3.10.1 -> 3.10.2 for add Windows Server 2025 (ltsc2025) support
Signed-off-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2026-04-03 16:17:39 +00:00
Ricardo Branco
2b7085767c Skip TestExportAndImportMultiLayer on s390x
The test image ghcr.io/containerd/volume-copy-up:2.1 does not include
a manifest for s390x, causing the test to fail with:
"no manifest found for platform: not found".

Signed-off-by: Ricardo Branco <rbranco@suse.de>
2026-04-02 18:46:20 +02:00
Sergey Kanzhelev
0130ae9aa8 Bump Go to 1.26.0
This change updates the Go version from 1.25.8 to 1.26.0 across the
repository, including CI configurations, build scripts, and development
environments.

It also fixes two linter issues discovered after upgrading the Go version:
- core/snapshots/storage/bolt.go: incorrect printf format for uint64
- plugins/transfer/plugin.go: incorrect printf format for int and unused variable

The golangci-lint version in script/setup/install-dev-tools is also updated to v2.9.0
to match CI.

Signed-off-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2026-03-31 22:58:42 +00:00
Samuel Karp
b7a467e4f3 Merge pull request #12175 from smira/fix/hide-go-cmp
fix: hide `go-cmp` library from the non-test code path
2026-03-30 20:21:10 +00:00
Henry Wang
68e128cf03 Add integration test for issue 13030
Signed-off-by: Henry Wang <henwang@amazon.com>
2026-03-24 18:03:26 +00:00
Sebastiaan van Stijn
22fd63994e *: modernize: stringscutprefix
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-17 13:36:17 +01:00
Sebastiaan van Stijn
9bdcacc45f *: modernize: waitgroup
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-17 13:36:17 +01:00
Sebastiaan van Stijn
4dd7c13ac4 *: modernize: stringscut, stringsseq
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-17 13:36:17 +01:00
Sebastiaan van Stijn
1ed2b15c08 *: modernize: minmax
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-17 13:36:16 +01:00
Andrey Smirnov
ea945443ac fix: hide go-cmp library from the non-test code path
The `go-cmp` library has issues with Go deadcode elimination:

```
github.com/google/go-cmp/cmp/internal/value.appendTypeName reachable from:
         github.com/google/go-cmp/cmp.pathStep.String
         type:github.com/google/go-cmp/cmp.pathStep
         type:github.com/google/go-cmp/cmp.structField
         type:*github.com/google/go-cmp/cmp.structField
         type:github.com/google/go-cmp/cmp.StructField
         go:itab.github.com/google/go-cmp/cmp.StructField,github.com/google/go-cmp/cmp.PathStep
         github.com/google/go-cmp/cmp.Path.String
         type:github.com/google/go-cmp/cmp.Path
         type:github.com/google/go-cmp/cmp.state
         type:*github.com/google/go-cmp/cmp.state
         type:func(*github.com/google/go-cmp/cmp.state, reflect.Type, reflect.Value, reflect.Value) github.com/google/go-cmp/cmp.applicableOption
         type:github.com/google/go-cmp/cmp.Option
         github.com/google/go-cmp/cmp.flattenOptions
         github.com/google/go-cmp/cmp.normalizeOption
         github.com/google/go-cmp/cmp.FilterValues
         github.com/containerd/containerd/v2/pkg/protobuf.init
         github.com/containerd/containerd/v2/pkg/protobuf..inittask
         go:main.inittasks
```

The `pkg/protobuf` is imported unconditionally is
`github.com/containerd/containerd` Go module is imported via init tasks,
so there is no way e.g. to use containerd client without triggering this
import.

It seems that within containerd itself this function is only used from
tests, so hiding it this way allows to import `containerd/client` while
keeping deadcode elimination.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2026-03-17 11:46:12 +04:00
Sebastiaan van Stijn
18c74abd56 *: modernize: slicescontains
go install golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest
    modernize -slicescontains -fix ./...

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-15 18:24:14 +01:00
Sebastiaan van Stijn
73e83de4b9 *: modernize: rangeint
go install golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest
    modernize -rangeint -fix ./...

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-15 14:56:49 +01:00
Danny Canter
d7d7b10f99 Use new filtered cgroup stats API
In some spots we can get away with only reading a subset of the cgroup
stats we are today. It would be reaaally nice for container stats in
the cri plugin, but they're requested via the task API and we have no
way to signify we only want a subset through this surface yet. We can
still get some benefit in the stats collector and the existing sandbox
stats where we only need mem and cpu.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2026-02-20 04:16:03 -08:00
Maksym Pavlenko
1e3446f24b Merge pull request #12666 from aadhar-agarwal/aadagarwal/fix-st1005
Fix ST1005 lint violations: lowercase error strings
2026-01-07 01:06:39 +00:00
Aadhar Agarwal
d6ee6f69b2 Fix ST1005 lint violations: lowercase error strings
Error strings should not be capitalized (unless beginning with proper
nouns or acronyms) or end with punctuation, per Go style guide and
staticcheck ST1005.

This change lowercases the first letter of error messages in fmt.Errorf
calls throughout the codebase, while preserving uppercase for acronyms
at the start of error strings (e.g., NRI, RDT, CDI, UID, GID, VHD, FUSE).

Also fixes typo 'faild' -> 'failed' in resolver_test.go.

Changes:
- core/metadata: target.Digest, target.Size, target.MediaType
- core/remotes/docker: fetcher.Seek, fetcherByDigest
- integration: various test error messages
- internal/cri/server: containerConfig
- plugins/snapshots: erofs

Fixes #12011

Signed-off-by: Aadhar Agarwal <aadagarwal@microsoft.com>
2026-01-07 00:26:28 +00:00
Maksym Pavlenko
253fbe756a Cleanup unit tests
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2026-01-06 10:52:49 -08:00
Henry Wang
0198b87fcf Implement parallel unpack
Signed-off-by: Henry Wang <henwang@amazon.com>
2025-10-24 17:54:26 +00: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
67f0970a54 Add mount activation integration test
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-09-29 17:08:35 -07:00
Henry Wang
5a00693e7f Fix integ-test: looking for sleep inf as longCommand
Signed-off-by: Henry Wang <henwang@amazon.com>
2025-09-29 19:44:33 +00: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
Akhil Mohan
222b2d3e72 update pause image to pause:3.10.1
Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
2025-07-11 11:29:02 +05:30
Derek McGowan
4d89721f23 Merge pull request #11623 from yashsingh74/update-golangci-v2
ci: bump golangci from 6.5.2 to 7.0.0
2025-07-01 18:06:14 +00:00
ningmingxiao
a79e791413 ci:fix ci TestContainerExecLargeOutputWithTTY panic
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2025-06-21 13:16:27 +08:00
yashsingh74
4ba81d4296 fix: ST1001: should not use dot imports (staticcheck)
Signed-off-by: yashsingh74 <yashsingh1774@gmail.com>
2025-06-18 14:16:41 +05:30
yylt
9de26f3150 [e2e] add case for shim wait interface
Signed-off-by: yang yang <yang8518296@163.com>
2025-06-10 23:05:44 +08:00
Kirtana Ashok
2f1948a503 Enable CIs to run on WS2022 and WS2025
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2025-06-05 15:25:03 -07:00
Jin Dong
213337ce4e Fetch image with default platform only in TestExportAndImportMultiLayer
`TestExportAndImportMultiLayer` has been very flaky due to upstream
registry throttling/unavailability. E.g.,

https://github.com/containerd/containerd/actions/runs/15168768477/job/42653479864

```shell
    log_hook.go:47: time="2025-05-21T17:42:37.345336659Z" level=debug msg="fetch failed" func=docker.dockerFetcher.open file="/home/runner/work/containerd/containerd/core/remotes/docker/fetcher.go:470" digest="sha256:5178da1ca6af8a14a235f58eb31955ca5f4c72f950d35f9bb67a8bd20232d840" error="unexpected status code https://mcr.microsoft.com/v2/windows/nanoserver/blobs/sha256:5178da1ca6af8a14a235f58eb31955ca5f4c72f950d35f9bb67a8bd20232d840: 503 Service Unavailable" mediatype=application/vnd.docker.image.rootfs.foreign.diff.tar.gzip size=116254563 testcase=TestExportAndImportMultiLayer url="https://mcr.microsoft.com/v2/windows/nanoserver/blobs/sha256:5178da1ca6af8a14a235f58eb31955ca5f4c72f950d35f9bb67a8bd20232d840"
```

Notice this test fetches all platform images which is
unnecessary I think. E.g., the 503 from mcr above caused Linux test failures.
This change should reduce requests to `mcr.microsoft.com`.

Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2025-05-21 16:08:39 -04:00
Danny Canter
33ee060a35 Use Go 1.19 atomic wrappers everywhere
We've long been able to use these and they have a couple
great benefits:

1. Forces you to always access them atomically. With the pointer
variants it's completely valid to access the regular ol' int64/uint32
etc. without using the atomic.* methods. These wrappers don't provide
access to the underlying value so it forces correct usage always.

2. Conveys intent much better. Seeing the type be atomic.Int32 immediately
lets the reader know that this var will be used in a concurrent context,
and we no longer need comments like "this MUST be accessed atomically"
or similar.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2025-05-03 03:46:20 -07:00
Derek McGowan
ee7189d1df Add retries for flaky Windows test
Partially addressing issue #8422
This does not fix an underlying race in the output

Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-04-30 16:16:39 -07:00
Adrien Delorme
72c8c7708c only keep one setting: concurrent_layer_fetch_buffer
Signed-off-by: Adrien Delorme <azr@users.noreply.github.com>
2025-04-24 11:41:33 +02:00
Adrien Delorme
024775dab1 set dl options on resolver
Signed-off-by: Adrien Delorme <azr@users.noreply.github.com>
2025-04-24 11:41:33 +02:00
Adrien Delorme
f9af08820b perf(pull): multipart layer fetch
Signed-off-by: Adrien Delorme <azr@users.noreply.github.com>
Co-Authored-By: Corentin REGAL <143578+co42@users.noreply.github.com>
2025-04-24 11:39:42 +02:00
Tony Fang
b694be29a0 Update CRI image service to pull using transfer service
- adds a transfer service progress reporter to handle timeouts. Also other test fixes
- fallback to local image pull when configuration conflict

Signed-off-by: Tony Fang <nhfang@amazon.com>

Co-authored-by: Swagat Bora <sbora@amazon.com>
2025-04-23 18:18:27 +00: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
Iceber Gu
450038a28b integration/client: add tests for TaskOptions is not empty
Co-authored-by: Wei Fu <fuweid89@gmail.com>
Signed-off-by: Iceber Gu <caiwei95@hotmail.com>
2025-03-26 15:00:11 +08:00
Derek McGowan
20812afa9f Merge pull request #11512 from alingse/fix-repeat-args
fix: repeat args from sub-func call
2025-03-14 18:21:21 +00:00
ningmingxiao
531adbf065 config:fix config migrate lost timeout config
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2025-03-12 23:34:58 +08:00
alingse
b947e05663 fix: repeat args from sub-func call
Signed-off-by: alingse <alingse@foxmail.com>
2025-03-09 14:53:44 +08:00
Phil Estes
98af40b752 Merge pull request #10722 from henry118/uidmap2
Support multiple uid/gid mappings [2/2]
2025-01-17 18:34:40 +00:00
Jin Dong
b7a117b464 Fix fuzz integration tests
Fuzz integration tests on Github Action
panics because it cannot find the containerd
PATH.

```
failed to start daemon: failed to start daemon: exec: "containerd": executable file not found in $PATH:
panic: fatal [recovered]
	panic: fatal
```

It's because in Action the `OUT` env var (/github/workspace/build-out)
is different compared to oss-fuzz.

Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2025-01-11 03:12:10 +00:00
Kazuyoshi Kato
5ad6a150b6 Merge pull request #11189 from djdongjin/move-to-go-native-fuzz
Move fuzz tests to go native fuzz [part1]
2025-01-10 01:27:14 +00:00
Jin Dong
a550830078 Remove github.com/AdamKorcz/go-118-fuzz-build in go.mod
We can add the dependency in oss_fuzz_build.sh, since
it's only used for oss-fuzz

change os.MkdirTemp to t.TempDir in fuzz tests

Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2024-12-25 01:25:48 +00:00