Migrate current TOML code to github.com/pelletier/go-toml

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2021-03-25 13:13:33 -07:00
parent 499c2f7d4a
commit ddd4298a10
8 changed files with 34 additions and 21 deletions

View File

@@ -21,9 +21,9 @@ import (
"net/url"
"time"
"github.com/BurntSushi/toml"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/plugin"
"github.com/pelletier/go-toml"
"github.com/pkg/errors"
)
@@ -49,7 +49,7 @@ type Runtime struct {
Root string `toml:"runtime_root" json:"runtimeRoot"`
// Options are config options for the runtime. If options is loaded
// from toml config, it will be toml.Primitive.
Options *toml.Primitive `toml:"options" json:"options"`
Options *toml.Tree `toml:"options" json:"options"`
// PrivilegedWithoutHostDevices overloads the default behaviour for adding host devices to the
// runtime spec when the container is privileged. Defaults to false.
PrivilegedWithoutHostDevices bool `toml:"privileged_without_host_devices" json:"privileged_without_host_devices"`

View File

@@ -19,7 +19,6 @@
package config
import (
"github.com/BurntSushi/toml"
"github.com/containerd/containerd"
"github.com/containerd/containerd/pkg/cri/streaming"
)
@@ -39,8 +38,7 @@ func DefaultConfig() PluginConfig {
NoPivot: false,
Runtimes: map[string]Runtime{
"runc": {
Type: "io.containerd.runc.v2",
Options: new(toml.Primitive),
Type: "io.containerd.runc.v2",
},
},
DisableSnapshotAnnotations: true,