Skip to content

TOML alternative #4370

@mikebrow

Description

@mikebrow

What is the problem you're trying to solve
Was trying to get the following to work:

// DefaultConfig returns default configurations of cri plugin.
func DefaultConfig() PluginConfig {
	opts := `
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
  [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
    runtime_type = "io.containerd.runc.v2"
    runtime_engine = ""
    runtime_root = ""
    privileged_without_host_devices = false
    base_runtime_spec = ""
    [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
      BinaryName = "runc"
`
	var runcRuntimeDefault Runtime
	m, err := toml.Decode(opts, &runcRuntimeDefault)
	if err != nil {
		panic(fmt.Sprintf("toml decode error %v %v", m, err))
	}

when I ran containerd config default I discovered that the toml code we are using can't encode what it decodes when wrt toml.Primitive (the type we use for said ^ options).. a quick search I found:
BurntSushi/toml#189 (minor note: I tried the PR and it didn't fix my problem more investigation required)

Then I discovered that the last merged PR in https://github.com/BurntSushi/toml/pulls?q=is%3Apr+is%3Aclosed
that was non license related, was June of 2017.

Mostly the license change consisted of this diff: BurntSushi/toml@4678bf2#diff-7116ef0705885343c9e1b2171a06be0e

Describe the solution you'd like
Discussion regarding what we'd like to do for config going forward.
A) host our own toml project
B) review consider moving to a different toml project, e.g. Pelletier appears to be supported... https://github.com/pelletier/go-toml
C) replace our toml config with a different model entirely

  1. json/yaml in conf files ... maybe use the CNI conf pattern

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions