Commit Graph

996 Commits

Author SHA1 Message Date
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
Derek McGowan
76a877bb5c Add mount activation support to task service
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
Kohei Tokunaga
8112ca64f0 cri: remove copying of message structs
Copying of message structs is not allowed and results in the following
govet error. This commit fixes these errors by avoiding copying of the
messages.

> google.golang.org/protobuf/runtime/protoimpl.MessageState contains sync.Mutex (govet)

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2025-09-16 13:49:45 +09:00
Kohei Tokunaga
9d351805bc go.mod: Bump up k8s.io to 0.34.1
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2025-09-16 11:36:35 +09: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
Rodrigo Campos
f0ee598ff7 integration: Add test for directives with userns
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-08-26 16:28:59 +02:00
ningmingxiao
dc38aaf6c2 ci:fix TestSandboxRemoveWithoutIPLeakage failed
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2025-08-15 23:26:20 +08:00
Akihiro Suda
a92d8700bf Merge pull request #12085 from akhilerm/pause-3.10.1
update pause image to pause:3.10.1
2025-07-15 06:12:20 +00:00
Kirtana Ashok
117179ae1a Remove WS2025 from CIs due to regression
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2025-07-11 10:56:37 -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
Phil Estes
38e119814b Merge pull request #12008 from ningmingxiao/fix_ci3
ci:fix ci TestContainerExecLargeOutputWithTTY panic
2025-06-30 15:57:45 +00:00
Akihiro Suda
9300d03899 Merge pull request #11885 from ningmingxiao/fix_nerdctl_unknown
bugfix:close container io when runtime create failed
2025-06-22 01:00:09 +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
yashsingh74
b3eec6d8e9 fix: ST1005: error strings should not end with punctuation or newlines
Signed-off-by: yashsingh74 <yashsingh1774@gmail.com>
2025-06-18 14:16:41 +05:30
yashsingh74
1ff5900044 fix: QF1004: strings.ReplaceAll instead (staticcheck)
Signed-off-by: yashsingh74 <yashsingh1774@gmail.com>
2025-06-18 14:16:41 +05:30
yashsingh74
56516173d0 fix: QF1002: could use tagged switch on host (staticcheck)
Signed-off-by: yashsingh74 <yashsingh1774@gmail.com>
2025-06-18 14:16:40 +05:30
ningmingxiao
e6708bddfb bugfix:close container io when runtime create failed
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2025-06-15 11:35:25 +08:00
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
Fu Wei
eeb9065242 Merge pull request #11916 from fuweid/fix-11871
*: properly shutdown non-groupable shims to prevent resource leaks
2025-06-08 00:16:29 +00: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
Akihiro Suda
bcd000f443 Merge pull request #11578 from djdongjin/image-volume-subpath
[KEP-4639] Support image volume mount subpath
2025-06-04 04:11:09 +00:00
Jin Dong
cff8184ffb support image volume sub path
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2025-06-03 21:53:29 -04:00
Wei Fu
1ac97c2c13 *: properly shutdown non-groupable shims to prevent resource leaks
Previously, to address issue #11708, PR #11793 changed containerd to always
invoke the shim binary to establish shim connections, rather than reusing the
sandbox shim. However, this change did not ensure that the Shutdown API was
called to stop the shim process.

Starting with containerd v2.0.0, the Shutdown API is only invoked for sandbox
containers (when container.SandboxID is empty). This approach works for
groupable shims, where multiple containers share a single socket address and
only require a single Shutdown call. However, for non-groupable shims, each
container requires its own Shutdown call during cleanup to avoid leaking shim
processes.

Additionally, PR #11793 introduced a corner case during upgrades:
- T1: An old container-shim-runc-v2 (<=v1.7.X) is running for pod A.
- T2: containerd is upgraded to v2.X.Y.
- T3: A new container A-C1 is created in pod A using the new shim-runc-v2 binary.
- T4: bootstrap.json indicates version:3 protocol, but it is downgraded to version:2 in memory.
- T5: containerd is restarted.
- T6: containerd fails to connect to A-C1.
- T7: The A-C1 container is left in EXITED status in the CRI plugin.

To address this, ensure that loadShimTask downgrades to version:2 if necessary,
and always invoke the Shutdown API for each non-groupable shim during cleanup to
prevent resource leaks and handle upgrade scenarios correctly.

(Introduced by #11793)

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2025-06-02 00:01:08 -04: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
Mike Brown
d498e690eb clones k8s util exec used by streaming code removing k8s util dependencies
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2025-05-15 16:34:09 +00:00
Samuel Karp
0721b22c75 Merge pull request #11824 from ningmingxiao/fix_ci_timeout
ci:fix ci timeout on almalinux
2025-05-08 05:32:05 +00:00
ningmingxiao
2be7a7310a ci:fix ci timeout on almalinux
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2025-05-08 12:35:26 +08:00
Fu Wei
3a1c2db95a Merge pull request #11793 from fuweid/carry-on-11761
[carry-11761] core/runtime: should invoke shim binary if it doesn't support Sandbox API
2025-05-06 22:37:07 +00:00
Wei Fu
1c70f237cb integration: add testcase to recover ungroupable shim
Signed-off-by: Wei Fu <fuweid89@gmail.com>
Co-authored-by: yang yang <yang8518296@163.com>
2025-05-06 01:54:43 -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
Mike Brown
5f3f84f567 removes use of klog from containerd repo
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2025-05-02 13:34:46 +00:00
Mike Brown
bfd85405db clones k8s component-base logreduction for integration test
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2025-05-01 20:42:31 +00: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
Maksym Pavlenko
1e8955d8b7 Merge pull request #11547 from dmcgowan/upgrade-tests-1.7
Fix upgrade tests for 1.7
2025-04-21 21:30:16 +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
Derek McGowan
bca39a6f46 Add documentation for test for issue 10467
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-03-31 17:32:56 -07:00
Derek McGowan
713f753e5d Update release upgrade tests to test 1.7 and 2.0
Fix 1.7 config to match previous version which allowed upgrade to 2.x.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-03-31 17:32:55 -07:00
Derek McGowan
9d05ae03b7 Revert "Remove test for issue 10467"
This reverts commit 12762891d6.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-03-31 17:32:55 -07:00
Fu Wei
cac8b40dc4 Merge pull request #11569 from Iceber/fix_task_options
update taskOptions based on runtimeOptions when creating a task
2025-03-28 15:40:08 +00: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
Wei Fu
fe4703cde5 integration: check image volume snapshot after deleting pod
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2025-03-25 15:52:15 -04:00
Wei Fu
d141d6c3dd integration: run image volumes for linux platform only
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2025-03-25 15:23:47 -04:00