Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
This repository was archived by the owner on May 12, 2021. It is now read-only.

kata-deploy: error appending to containerd config #802

Closed
@wilsonianb

Description

@wilsonianb

Description of problem

curl -sfL https://get.k3s.io | sh -
kubectl apply -f https://raw.githubusercontent.com/kata-containers/packaging/master/kata-deploy/kata-rbac.yaml
kubectl apply -f https://raw.githubusercontent.com/wilsonianb/packaging/k3s-test/kata-deploy/kata-deploy.yaml

or I suspect installing kata containers via kata-deploy on any Kubernetes node with a containerd config similar to the k3s default.

Expected result

kata-deploy should produce a valid containerd config.toml

Actual result

In this case, appending an array of tables to the existing containerd config.toml (#797) produces an invalid configuration.


[plugins.opt]
  path = "/var/lib/rancher/k3s/agent/containerd"

[plugins.cri]
  stream_server_address = "127.0.0.1"
  stream_server_port = "10010"
[plugins.cri.cni]
  bin_dir = "/var/lib/rancher/k3s/data/89e07bdac6af146f1afb8d8b89f4c99d0a79ea4024f997bf37fb5a13aa44ebc5/bin"
  conf_dir = "/var/lib/rancher/k3s/agent/etc/cni/net.d"


[plugins.cri.containerd.runtimes.runc]
  runtime_type = "io.containerd.runc.v2"


[[plugins]]
  [[plugins.cri]]
   [[plugins.cri.containerd]]
     [plugins.cri.containerd.runtimes.kata]
        runtime_type = "io.containerd.kata.v2"
        [plugins.cri.containerd.runtimes.kata.options]
              ConfigPath = "/opt/kata/share/defaults/kata-containers/configuration.toml"
     [plugins.cri.containerd.runtimes.kata-fc]
        runtime_type = "io.containerd.kata-fc.v2"
        [plugins.cri.containerd.runtimes.kata-fc.options]
              ConfigPath = "/opt/kata/share/defaults/kata-containers/configuration-fc.toml"
     [plugins.cri.containerd.runtimes.kata-qemu]
        runtime_type = "io.containerd.kata-qemu.v2"
        [plugins.cri.containerd.runtimes.kata-qemu.options]
              ConfigPath = "/opt/kata/share/defaults/kata-containers/configuration-qemu.toml"
     [plugins.cri.containerd.runtimes.kata-qemu-virtiofs]
        runtime_type = "io.containerd.kata-qemu-virtiofs.v2"
        [plugins.cri.containerd.runtimes.kata-qemu-virtiofs.options]
              ConfigPath = "/opt/kata/share/defaults/kata-containers/configuration-qemu-virtiofs.toml"
     [plugins.cri.containerd.runtimes.kata-nemu]
        runtime_type = "io.containerd.kata-nemu.v2"
        [plugins.cri.containerd.runtimes.kata-nemu.options]
              ConfigPath = "/opt/kata/share/defaults/kata-containers/configuration-nemu.toml"

containerd: Near line 17 (last key parsed ''): Key '' was already created and cannot be used as an array.

From the TOML docs:

If the parent of a table or array of tables is an array element, that element must already have been defined before the child can be defined. Attempts to reverse that ordering must produce an error at parse time.

# INVALID TOML DOC
[fruit.physical]  # subtable, but to which parent element should it belong?
  color = "red"
  shape = "round"

[[fruit]]  # parser must throw an error upon discovering that "fruit" is
           # an array rather than a table
  name = "apple"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behaviourneeds-reviewNeeds to be assessed by the team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions