Skip to content

Commit

Permalink
Merge pull request #4589 from twz123/backport-4569-to-release-1.29
Browse files Browse the repository at this point in the history
[Backport release-1.29] Set correct version number in containerd CRI config
  • Loading branch information
twz123 authored Jun 12, 2024
2 parents 00b20c8 + f04fb5a commit 649ef96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/component/worker/containerd/criconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func escapedPath(s string) string {

// We need to use custom struct so we can unmarshal the CRI plugin config only
type config struct {
Version int
Version int `toml:"version"`
Plugins map[string]interface{} `toml:"plugins"`
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/component/worker/containerd/criconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
srvconfig "github.com/containerd/containerd/services/server/config"
"github.com/k0sproject/k0s/pkg/apis/k0s/v1beta1"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -84,6 +85,7 @@ func TestCRIConfigurer_HandleImports(t *testing.T) {
err = srvconfig.LoadConfig(criRuntimePath, containerdConfig)
require.NoError(t, err)

assert.Equal(t, 2, containerdConfig.Version)
criConfig := containerdConfig.Plugins["io.containerd.grpc.v1.cri"]
snapshotter := criConfig.GetPath([]string{"containerd", "snapshotter"})
require.Equal(t, "zfs", snapshotter)
Expand Down

0 comments on commit 649ef96

Please sign in to comment.