diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 864fe7cc3..8baa3f855 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -427,8 +427,9 @@ jobs: BDIR="$(mktemp -d -p $PWD)" mkdir -p ${BDIR}/{root,state} cat > ${BDIR}/config.toml < ${BDIR}/containerd-cri.log & diff --git a/RELEASES.md b/RELEASES.md index e58a00ba8..133e4d1bd 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -294,7 +294,8 @@ The daemon's configuration file, commonly located in `/etc/containerd/config.tom is versioned and backwards compatible. The `version` field in the config file specifies the config's version. If no version number is specified inside the config file then it is assumed to be a version 1 config and parsed as such. -Use `version = 2` to enable version 2 config. +Please use `version = 2` to enable version 2 config as version 1 has been +deprecated. ### Not Covered @@ -324,3 +325,4 @@ The deprecated features are shown in the following table: |----------------------------------------------------------------------|---------------------|----------------------------| | Runtime V1 API and implementation (`io.containerd.runtime.v1.linux`) | containerd v1.4 | containerd v2.0 | | Runc V1 implementation of Runtime V2 (`io.containerd.runc.v1`) | containerd v1.4 | containerd v2.0 | +| config.toml `version = 1` | containerd v1.5 | containerd v2.0 | diff --git a/cmd/containerd/command/config.go b/cmd/containerd/command/config.go index 7282f476c..8ba6deef0 100644 --- a/cmd/containerd/command/config.go +++ b/cmd/containerd/command/config.go @@ -120,7 +120,7 @@ var configCommand = cli.Command{ func platformAgnosticDefaultConfig() *srvconfig.Config { return &srvconfig.Config{ - Version: 1, + Version: 2, Root: defaults.DefaultRootDir, State: defaults.DefaultStateDir, GRPC: srvconfig.GRPCConfig{ diff --git a/integration/client/client_test.go b/integration/client/client_test.go index 109ec3c7a..022669ae1 100644 --- a/integration/client/client_test.go +++ b/integration/client/client_test.go @@ -503,12 +503,12 @@ func createShimDebugConfig() string { os.Exit(1) } defer f.Close() - if _, err := f.WriteString("version = 1\n"); err != nil { + if _, err := f.WriteString("version = 2\n"); err != nil { fmt.Fprintf(os.Stderr, "Failed to write to config file %s: %s\n", f.Name(), err) os.Exit(1) } - if _, err := f.WriteString("[plugins.linux]\n\tshim_debug = true\n"); err != nil { + if _, err := f.WriteString("[plugins.\"io.containerd.runtime.v1.linux\"]\n\tshim_debug = true\n"); err != nil { fmt.Fprintf(os.Stderr, "Failed to write to config file %s: %s\n", f.Name(), err) os.Exit(1) } diff --git a/integration/client/daemon_config_linux_test.go b/integration/client/daemon_config_linux_test.go index 18d425e50..d62e93877 100644 --- a/integration/client/daemon_config_linux_test.go +++ b/integration/client/daemon_config_linux_test.go @@ -129,9 +129,9 @@ func TestDaemonRuntimeRoot(t *testing.T) { } }() configTOML := ` -version = 1 +version = 2 [plugins] - [plugins.cri] + [plugins."io.containerd.grpc.v1.cri"] stream_server_port = "0" ` @@ -227,7 +227,7 @@ func TestDaemonCustomCgroup(t *testing.T) { customCgroup := fmt.Sprintf("%d", time.Now().Nanosecond()) configTOML := ` -version = 1 +version = 2 [cgroup] path = "` + customCgroup + `"` diff --git a/script/test/utils.sh b/script/test/utils.sh index e2819d1f1..6093bf8be 100755 --- a/script/test/utils.sh +++ b/script/test/utils.sh @@ -30,14 +30,15 @@ if [ -z "${CONTAINERD_CONFIG_FILE}" ]; then truncate --size 0 "${config_file}" if command -v sestatus >/dev/null 2>&1; then cat >>${config_file} <>${config_file} <