Skip to content

Commit

Permalink
Merge pull request #4568 from twz123/containerd-toml-lowercase-version
Browse files Browse the repository at this point in the history
Set correct version number in containerd CRI config
  • Loading branch information
twz123 authored Jun 7, 2024
2 parents 9d82f80 + 15b0427 commit 4d24f74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/component/worker/containerd/configurer.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func generateDefaultCRIConfig(sandboxContainerImage string) ([]byte, error) {
}
// We need to use custom struct so we can unmarshal the CRI plugin config only
containerdConfig := struct {
Version int
Version int `toml:"version"`
Plugins map[string]interface{} `toml:"plugins"`
}{
Version: 2,
Expand Down
1 change: 1 addition & 0 deletions pkg/component/worker/containerd/configurer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func TestConfigurer_HandleImports(t *testing.T) {
var containerdConfig serverconfig.Config
require.NoError(t, serverconfig.LoadConfig(criConfigPath, &containerdConfig))

assert.Equal(t, 2, containerdConfig.Version)
criPluginConfig := containerdConfig.Plugins["io.containerd.grpc.v1.cri"]
require.NotNil(t, criPluginConfig, "No CRI plugin configuration section found")
snapshotter := criPluginConfig.GetPath([]string{"containerd", "snapshotter"})
Expand Down

0 comments on commit 4d24f74

Please sign in to comment.