Skip to content

config dump: type map[string]interface {} is not assignable to type platforms.Matcher #8179

@hckuo

Description

@hckuo

Description

Go runtime panics when I try to call dump a configuration by contianerd config dump. Version 1.7.0-rc0.

Steps to reproduce the issue

  1. containerd config default > test.config
  2. containerd --config test.config config dump
  3. containerd --config test.config (this would also produce a similar error)

Describe the results you received and expected

sudo ./containerd --config ../default.config config dump
panic: reflect.Set: value of type map[string]interface {} is not assignable to type platforms.Matcher

goroutine 1 [running]:
reflect.Value.assignTo({0x560d6092d480?, 0xc0003da990?, 0x7ff7bc7211c8?}, {0x560d604e8c2c, 0xb}, 0x560d60969120, 0xc0005522a0)
        /usr/local/go/src/reflect/value.go:3245 +0x2a5
reflect.Value.Set({0x560d60969120?, 0xc0005522a0?, 0x560d60969120?}, {0x560d6092d480?, 0xc0003da990?, 0xc0005205d0?})
        /usr/local/go/src/reflect/value.go:2236 +0xeb
github.com/pelletier/go-toml.(*Decoder).valueFromTree(0xc0003f4490, {0x560d60bda000, 0x560d60ac7140}, 0xc0003da600, 0x0)
        /go/src/github.com/containerd/containerd/vendor/github.com/pelletier/go-toml/marshal.go:811 +0x1a88
github.com/pelletier/go-toml.(*Decoder).valueFromTreeSlice(0xc0003f4490, {0x560d60bda000, 0x560d608495e0}, {0xc0005221f8, 0x1, 0xc0003f3aa8?})
        /go/src/github.com/containerd/containerd/vendor/github.com/pelletier/go-toml/marshal.go:916 +0x1bf
github.com/pelletier/go-toml.(*Decoder).valueFromToml(0xc0003f4490, {0x560d60bda000, 0x560d608495e0}, {0x560d60842960?, 0xc0005208b8?}, 0xc0005205a0)
        /go/src/github.com/containerd/containerd/vendor/github.com/pelletier/go-toml/marshal.go:1007 +0x736
github.com/pelletier/go-toml.(*Decoder).valueFromTree(0xc0003f4490, {0x560d60bda000, 0x560d60ac6f40}, 0xc0003da930, 0xc0003f4370)
        /go/src/github.com/containerd/containerd/vendor/github.com/pelletier/go-toml/marshal.go:807 +0x1a25
github.com/pelletier/go-toml.(*Decoder).unmarshal(0xc0003f4490, {0x560d60820ac0?, 0xc0003006c0})
        /go/src/github.com/containerd/containerd/vendor/github.com/pelletier/go-toml/marshal.go:736 +0x39f
github.com/pelletier/go-toml.(*Tree).Unmarshal(...)
        /go/src/github.com/containerd/containerd/vendor/github.com/pelletier/go-toml/marshal.go:621
github.com/containerd/containerd/services/server/config.(*Config).Decode(0xc0003ab340, 0xc000300720)
        /go/src/github.com/containerd/containerd/services/server/config/config.go:181 +0x245
github.com/containerd/containerd/cmd/containerd/command.outputConfig(0xc0003ab340)
        /go/src/github.com/containerd/containerd/cmd/containerd/command/config.go:63 +0x116
github.com/containerd/containerd/cmd/containerd/command.glob..func2(0xc000367b80?)
        /go/src/github.com/containerd/containerd/cmd/containerd/command/config.go:119 +0x7f
github.com/urfave/cli.HandleAction({0x560d608a2320?, 0x560d60ba2238?}, 0x4?)
        /go/src/github.com/containerd/containerd/vendor/github.com/urfave/cli/app.go:524 +0x50
github.com/urfave/cli.Command.Run({{0x560d604dd1cc, 0x4}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x560d605610de, 0x48}, {0x0, ...}, ...}, ...)
        /go/src/github.com/containerd/containerd/vendor/github.com/urfave/cli/command.go:175 +0x67b
github.com/urfave/cli.(*App).RunAsSubcommand(0xc0003ab180, 0xc0003678c0)
        /go/src/github.com/containerd/containerd/vendor/github.com/urfave/cli/app.go:405 +0xe87
github.com/urfave/cli.Command.startApp({{0x560d604df709, 0x6}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x560d6051ef19, 0x24}, {0x0, ...}, ...}, ...)
        /go/src/github.com/containerd/containerd/vendor/github.com/urfave/cli/command.go:380 +0xb7f
github.com/urfave/cli.Command.Run({{0x560d604df709, 0x6}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x560d6051ef19, 0x24}, {0x0, ...}, ...}, ...)
        /go/src/github.com/containerd/containerd/vendor/github.com/urfave/cli/command.go:103 +0x845
github.com/urfave/cli.(*App).Run(0xc0003aafc0, {0xc0000520a0, 0x5, 0x5})
        /go/src/github.com/containerd/containerd/vendor/github.com/urfave/cli/app.go:277 +0xb87
main.main()
        github.com/containerd/containerd/cmd/containerd/main.go:39 +0x37
        ```

### What version of containerd are you using?

 containerd github.com/containerd/containerd v1.7.0-rc.0 2be87c1a75505ac066bec4a99e6c72aafd41d883

### Any other relevant information

runc --version
runc version 1.1.4
commit: v1.1.4-0-g5fd4c4d
spec: 1.0.2-dev
go: go1.19.6
libseccomp: 2.5.1

uname -a
Linux devbox 5.15.0-1030-aws #34~20.04.1-Ubuntu SMP Tue Jan 24 15:16:46 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux


### Show configuration if it is related to CRI plugin.

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions