Skip to content

Commit 884b2c6

Browse files
author
shucheng
committed
Merge tag 'v2.0.2' into release-v2.0
containerd 2.0.2 Welcome to the v2.0.2 release of containerd! The second patch release for containerd 2.0 includes a number of bug fixes and improvements. * Remove confusing warning in cri runtime config migration ([#11256](containerd/containerd#11256)) * Fix runtime platform loading in cri image plugin init ([#11248](containerd/containerd#11248)) * Update runc binary to v1.2.4 ([#11239](containerd/containerd#11239)) Please try out the release binaries and report any issues at https://github.com/containerd/containerd/issues. * Jin Dong * Derek McGowan * Akihiro Suda * Kazuyoshi Kato * Henry Wang * Krisztian Litkey * Phil Estes * Samuel Karp * Sebastiaan van Stijn * Akhil Mohan * Brian Goff * Chongyi Zheng * Maksym Pavlenko * Mike Brown * Pierre Gimalac * Wei Fu <details><summary>23 commits</summary> <p> * Prepare release notes for v2.0.2 ([#11245](containerd/containerd#11245)) * [`cdaf4dfb4`](containerd/containerd@cdaf4df) Prepare release notes for v2.0.2 * Update platforms to latest rc ([#11259](containerd/containerd#11259)) * [`eb125e1dd`](containerd/containerd@eb125e1) Update platforms to latest rc * Remove confusing warning in cri runtime config migration ([#11256](containerd/containerd#11256)) * [`468079c5c`](containerd/containerd@468079c) Remove confusing warning in cri runtime config migration * Fix runtime platform loading in cri image plugin init ([#11248](containerd/containerd#11248)) * [`a2d9d4fd5`](containerd/containerd@a2d9d4f) Fix runtime platform loading in cri image plugin init * make sure console master tty is closed on task exit ([#11246](containerd/containerd#11246)) * [`184ffad01`](containerd/containerd@184ffad) Add integ test to check tty leak * [`17181ed33`](containerd/containerd@17181ed) fix master tty leak due to leaking init container object * Bump up otelttrpc to 0.1.0 ([#11242](containerd/containerd#11242)) * [`8666e7422`](containerd/containerd@8666e74) Bump up otelttrpc to 0.1.0 * ctr: `ctr images import --all-platforms`: fix unpack ([#11236](containerd/containerd#11236)) * [`c4270430d`](containerd/containerd@c427043) ctr: `ctr images import --all-platforms`: fix unpack * Update runc binary to v1.2.4 ([#11239](containerd/containerd#11239)) * [`7373ddd70`](containerd/containerd@7373ddd) update runc binary to v1.2.4 * downgrade go-difflib and go-spew to tagged releases ([#11222](containerd/containerd#11222)) * [`f34147772`](containerd/containerd@f341477) downgrade go-difflib and go-spew to tagged releases * Add a build tag to disable std `plugin` import ([#11213](containerd/containerd#11213)) * [`dca769485`](containerd/containerd@dca7694) chore: add a build tag to disable containerd plugin import * Update golangci to 1.60.3 ([#11187](containerd/containerd#11187)) * [`5942b3fcb`](containerd/containerd@5942b3f) Update golangci to 1.60.3 </p> </details> <details><summary>6 commits</summary> <p> * Add dependabot and upgrade golang and dependency versions ([containerd/otelttrpc#3](containerd/otelttrpc#3)) * [`2d46141`](containerd/otelttrpc@2d46141) upgrade golang, deps, CI versions * [`64922e7`](containerd/otelttrpc@64922e7) Add dependabot CI * Fix concurrent map panic on metadata ([containerd/otelttrpc#2](containerd/otelttrpc#2)) * [`2ba3be1`](containerd/otelttrpc@2ba3be1) Fix concurrent map panic on inject metadata * [`f50a922`](containerd/otelttrpc@f50a922) UT for concurrent inject/extract metadata </p> </details> <details><summary>6 commits</summary> <p> * Move windows matcher logic so all platforms can use ([containerd/platforms#22](containerd/platforms#22)) * [`7c58292`](containerd/platforms@7c58292) Move windows matcher logic so all platforms can use * replace testify with stdlib in tests ([containerd/platforms#21](containerd/platforms#21)) * [`86a86b7`](containerd/platforms@86a86b7) replace testify with stdlib in tests * Replace arm64 minor variant logic with lookup table ([containerd/platforms#18](containerd/platforms#18)) * [`364665a`](containerd/platforms@364665a) Replace arm64 minor variant logic with lookup table </p> </details> <details><summary>5 commits</summary> <p> * Add MD.Clone function ([containerd/ttrpc#177](containerd/ttrpc#177)) * [`430f734`](containerd/ttrpc@430f734) Add MD.Clone * server: fix a Serve() vs. (immediate) Shutdown() race ([containerd/ttrpc#175](containerd/ttrpc#175)) * [`c4d96d5`](containerd/ttrpc@c4d96d5) server: fix Serve() vs. immediate Shutdown() race. * [`ed6c3ba`](containerd/ttrpc@ed6c3ba) server_test: add Serve()/Shutdown() race test. </p> </details> * **github.com/containerd/otelttrpc** ea5083fda723 -> v0.1.0 * **github.com/containerd/platforms** v1.0.0-rc.0 -> v1.0.0-rc.1 * **github.com/containerd/ttrpc** v1.2.6 -> v1.2.7 * **github.com/davecgh/go-spew** d8f796af33cc -> v1.1.1 * **github.com/pmezard/go-difflib** 5d4384ee4fb2 -> v1.0.0 * **github.com/stretchr/testify** v1.9.0 -> v1.10.0 Previous release can be found at [v2.0.1](https://github.com/containerd/containerd/releases/tag/v2.0.1) * `containerd-<VERSION>-<OS>-<ARCH>.tar.gz`: ✅Recommended. Dynamically linked with glibc 2.31 (Ubuntu 20.04). * `containerd-static-<VERSION>-<OS>-<ARCH>.tar.gz`: Statically linked. Expected to be used on non-glibc Linux distributions. Not position-independent. In addition to containerd, typically you will have to install [runc](https://github.com/opencontainers/runc/releases) and [CNI plugins](https://github.com/containernetworking/plugins/releases) from their official sites too. See also the [Getting Started](https://github.com/containerd/containerd/blob/main/docs/getting-started.md) documentation.
2 parents bbd9137 + c507a02 commit 884b2c6

38 files changed

+1226
-1935
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- uses: ./.github/actions/install-go
3434
- uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
3535
with:
36-
version: v1.60.1
36+
version: v1.60.3
3737
skip-cache: true
3838
args: --timeout=8m
3939

.golangci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
linters:
22
enable:
33
- depguard # Checks for dependencies that should not be (re)introduced. See "linter-settings" for further details.
4-
- exportloopref # Checks for pointers to enclosing loop variables
4+
# - copyloopvar # Checks for loop variable copies in Go 1.22+
55
- gofmt
66
- goimports
77
- gosec
@@ -73,6 +73,7 @@ linters-settings:
7373
- G306
7474
- G402
7575
- G404
76+
- G115
7677
nolintlint:
7778
allow-unused: true
7879

BUILDING.md

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ make generate
122122
> * `no_zfs`: A build tag disables building the ZFS snapshot driver.
123123
> * platform
124124
> * `no_systemd`: disables any systemd specific code
125+
> * `no_dynamic_plugins`: A build tag disables dynamic plugins.
125126
>
126127
> For example, adding `BUILDTAGS=no_btrfs` to your environment before calling the **binaries**
127128
> Makefile target will disable the btrfs driver within the containerd Go build.

cmd/containerd-shim-runc-v2/task/service.go

+3
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ func (s *service) Delete(ctx context.Context, r *taskAPI.DeleteRequest) (*taskAP
369369
ExitStatus: uint32(p.ExitStatus()),
370370
ExitedAt: protobuf.ToTimestamp(p.ExitedAt()),
371371
})
372+
s.lifecycleMu.Lock()
373+
delete(s.containerInitExit, container)
374+
s.lifecycleMu.Unlock()
372375
}
373376
return &taskAPI.DeleteResponse{
374377
ExitStatus: uint32(p.ExitStatus()),

cmd/containerd/server/server.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ import (
5151
ssapi "github.com/containerd/containerd/api/services/snapshots/v1"
5252
"github.com/containerd/platforms"
5353
"github.com/containerd/plugin"
54-
"github.com/containerd/plugin/dynamic"
5554
"github.com/containerd/plugin/registry"
5655

5756
srvconfig "github.com/containerd/containerd/v2/cmd/containerd/server/config"
@@ -476,7 +475,7 @@ func LoadPlugins(ctx context.Context, config *srvconfig.Config) ([]plugin.Regist
476475
if path == "" {
477476
path = filepath.Join(config.Root, "plugins")
478477
}
479-
if count, err := dynamic.Load(path); err != nil {
478+
if count, err := loadDynamic(path); err != nil {
480479
return nil, err
481480
} else if count > 0 || config.PluginDir != "" { //nolint:staticcheck
482481
config.PluginDir = path //nolint:staticcheck
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build no_dynamic_plugins
2+
13
/*
24
Copyright The containerd Authors.
35
@@ -14,21 +16,9 @@
1416
limitations under the License.
1517
*/
1618

17-
package platforms
18-
19-
import (
20-
specs "github.com/opencontainers/image-spec/specs-go/v1"
21-
)
19+
package server
2220

23-
// NewMatcher returns a Windows matcher that will match on osVersionPrefix if
24-
// the platform is Windows otherwise use the default matcher
25-
func newDefaultMatcher(platform specs.Platform) Matcher {
26-
prefix := prefix(platform.OSVersion)
27-
return windowsmatcher{
28-
Platform: platform,
29-
osVersionPrefix: prefix,
30-
defaultMatcher: &matcher{
31-
Platform: Normalize(platform),
32-
},
33-
}
21+
func loadDynamic(string) (loaded int, _ error) {
22+
// dynamic plugins disabled through no_dynamic_plugins build-tag
23+
return 0, nil
3424
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build !windows
1+
//go:build !no_dynamic_plugins
22

33
/*
44
Copyright The containerd Authors.
@@ -16,15 +16,10 @@
1616
limitations under the License.
1717
*/
1818

19-
package platforms
19+
package server
2020

21-
import (
22-
specs "github.com/opencontainers/image-spec/specs-go/v1"
23-
)
21+
import "github.com/containerd/plugin/dynamic"
2422

25-
// NewMatcher returns the default Matcher for containerd
26-
func newDefaultMatcher(platform specs.Platform) Matcher {
27-
return &matcher{
28-
Platform: Normalize(platform),
29-
}
23+
func loadDynamic(path string) (loaded int, _ error) {
24+
return dynamic.Load(path)
3025
}

cmd/ctr/commands/images/import.go

+9-17
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"os"
2424
"time"
2525

26-
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
2726
"github.com/urfave/cli/v2"
2827

2928
containerd "github.com/containerd/containerd/v2/client"
@@ -141,33 +140,26 @@ If foobar.tar contains an OCI ref named "latest" and anonymous ref "sha256:deadb
141140
opts = append(opts, image.WithNamedPrefix(prefix, overwrite))
142141
}
143142

144-
var platSpec ocispec.Platform
145-
// Only when all-platforms not specified, we will check platform value
146-
// Implicitly if the platforms is empty, it means all-platforms
143+
// Even with --all-platforms, only the default platform layers are unpacked,
144+
// for compatibility with --local.
145+
//
146+
// This is still not fully compatible with --local, which only unpacks
147+
// the strict-default platform layers.
148+
platUnpack := platforms.DefaultSpec()
147149
if !cliContext.Bool("all-platforms") {
148150
// If platform specified, use that one, if not use default
149151
if platform := cliContext.String("platform"); platform != "" {
150-
platSpec, err = platforms.Parse(platform)
152+
platUnpack, err = platforms.Parse(platform)
151153
if err != nil {
152154
return err
153155
}
154-
} else {
155-
platSpec = platforms.DefaultSpec()
156156
}
157-
opts = append(opts, image.WithPlatforms(platSpec))
157+
opts = append(opts, image.WithPlatforms(platUnpack))
158158
}
159159

160160
if !cliContext.Bool("no-unpack") {
161161
snapshotter := cliContext.String("snapshotter")
162-
// If OS field is not empty, it means platSpec was updated in the above block
163-
// i.e all-platforms was not specified
164-
if platSpec.OS != "" {
165-
opts = append(opts, image.WithUnpack(platSpec, snapshotter))
166-
} else {
167-
// Empty spec means all platforms
168-
var emptySpec ocispec.Platform
169-
opts = append(opts, image.WithUnpack(emptySpec, snapshotter))
170-
}
162+
opts = append(opts, image.WithUnpack(platUnpack, snapshotter))
171163
}
172164

173165
is := image.NewStore(cliContext.String("index-name"), opts...)

go.mod

+21-6
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ require (
2323
github.com/containerd/imgcrypt/v2 v2.0.0-rc.1
2424
github.com/containerd/log v0.1.0
2525
github.com/containerd/nri v0.8.0
26-
github.com/containerd/otelttrpc v0.0.0-20240305015340-ea5083fda723
27-
github.com/containerd/platforms v1.0.0-rc.0
26+
github.com/containerd/otelttrpc v0.1.0
27+
github.com/containerd/platforms v1.0.0-rc.1
2828
github.com/containerd/plugin v1.0.0
29-
github.com/containerd/ttrpc v1.2.6
29+
github.com/containerd/ttrpc v1.2.7
3030
github.com/containerd/typeurl/v2 v2.2.3
3131
github.com/containerd/zfs/v2 v2.0.0-rc.0
3232
github.com/containernetworking/cni v1.2.3
3333
github.com/containernetworking/plugins v1.5.1
3434
github.com/coreos/go-systemd/v22 v22.5.0
35-
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
35+
github.com/davecgh/go-spew v1.1.1
3636
github.com/distribution/reference v0.6.0
3737
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c
3838
github.com/docker/go-metrics v0.0.1
@@ -59,7 +59,7 @@ require (
5959
github.com/pelletier/go-toml/v2 v2.2.3
6060
github.com/prometheus/client_golang v1.20.5
6161
github.com/sirupsen/logrus v1.9.3
62-
github.com/stretchr/testify v1.9.0
62+
github.com/stretchr/testify v1.10.0
6363
github.com/tchap/go-patricia/v2 v2.3.1
6464
github.com/urfave/cli/v2 v2.27.5
6565
github.com/vishvananda/netlink v1.3.0
@@ -119,7 +119,7 @@ require (
119119
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
120120
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
121121
github.com/pkg/errors v0.9.1 // indirect
122-
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
122+
github.com/pmezard/go-difflib v1.0.0 // indirect
123123
github.com/prometheus/client_model v0.6.1 // indirect
124124
github.com/prometheus/common v0.55.0 // indirect
125125
github.com/prometheus/procfs v0.15.1 // indirect
@@ -151,3 +151,18 @@ require (
151151
sigs.k8s.io/yaml v1.4.0 // indirect
152152
tags.cncf.io/container-device-interface/specs-go v0.8.0 // indirect
153153
)
154+
155+
exclude (
156+
// These dependencies were updated to "master" in some modules we depend on,
157+
// but have no code-changes since their last release. Unfortunately, this also
158+
// causes a ripple effect, forcing all users of the containerd module to also
159+
// update these dependencies to an unrelease / un-tagged version.
160+
//
161+
// Both these dependencies will unlikely do a new release in the near future,
162+
// so exclude these versions so that we can downgrade to the current release.
163+
//
164+
// For additional details, see this PR and links mentioned in that PR:
165+
// https://github.com/kubernetes-sigs/kustomize/pull/5830#issuecomment-2569960859
166+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
167+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
168+
)

0 commit comments

Comments
 (0)