mirror of
https://github.com/kubernetes-sigs/kind.git
synced 2025-11-30 23:16:04 +07:00
update containerd to v2.0.2
Fix issue 3768 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
@@ -122,7 +122,7 @@ RUN eval "$(gimme "${GO_VERSION}")" \
|
|||||||
# stage for building containerd
|
# stage for building containerd
|
||||||
FROM go-build AS build-containerd
|
FROM go-build AS build-containerd
|
||||||
ARG TARGETARCH GO_VERSION
|
ARG TARGETARCH GO_VERSION
|
||||||
ARG CONTAINERD_VERSION="v1.7.24"
|
ARG CONTAINERD_VERSION="v2.0.2"
|
||||||
ARG CONTAINERD_CLONE_URL="https://github.com/containerd/containerd"
|
ARG CONTAINERD_CLONE_URL="https://github.com/containerd/containerd"
|
||||||
# we don't build with optional snapshotters, we never select any of these
|
# we don't build with optional snapshotters, we never select any of these
|
||||||
# they're not ideal inside kind anyhow, and we save some disk space
|
# they're not ideal inside kind anyhow, and we save some disk space
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package nodeutils
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -102,9 +103,24 @@ func parseSnapshotter(config string) (string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrap(err, "failed to detect containerd snapshotter")
|
return "", errors.Wrap(err, "failed to detect containerd snapshotter")
|
||||||
}
|
}
|
||||||
snapshotter, ok := parsed.GetPath([]string{"plugins", "io.containerd.grpc.v1.cri", "containerd", "snapshotter"}).(string)
|
configVersion, ok := parsed.Get("version").(int64)
|
||||||
if !ok {
|
if !ok {
|
||||||
return "", errors.New("failed to detect containerd snapshotter")
|
return "", errors.New("failed to detect containerd config version")
|
||||||
|
}
|
||||||
|
var snapshotter string
|
||||||
|
switch configVersion {
|
||||||
|
case 2: // Introduced in containerd v1.3. Still supported in containerd v2.
|
||||||
|
snapshotter, ok = parsed.GetPath([]string{"plugins", "io.containerd.grpc.v1.cri", "containerd", "snapshotter"}).(string)
|
||||||
|
if !ok {
|
||||||
|
return "", errors.New("failed to detect containerd snapshotter (config version 2)")
|
||||||
|
}
|
||||||
|
case 3: // Introduced in containerd v2.0.
|
||||||
|
snapshotter, ok = parsed.GetPath([]string{"plugins", "io.containerd.cri.v1.images", "snapshotter"}).(string)
|
||||||
|
if !ok {
|
||||||
|
return "", errors.New("failed to detect containerd snapshotter (config version 3)")
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return "", fmt.Errorf("unknown containerd config version: %d (supported versions: 2 and 3)", configVersion)
|
||||||
}
|
}
|
||||||
return snapshotter, nil
|
return snapshotter, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user