From a07ab472212a9126bba01c95f19afaf72778c77e Mon Sep 17 00:00:00 2001 From: Jin Li Date: Mon, 29 May 2023 18:29:26 +0800 Subject: [PATCH] Spicify the runc path when we use the containerd container engine and change the bin_dir path. Signed-off-by: Jin Li --- roles/container-engine/containerd/defaults/main.yml | 1 + roles/container-engine/containerd/templates/config.toml.j2 | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/roles/container-engine/containerd/defaults/main.yml b/roles/container-engine/containerd/defaults/main.yml index e763d91b106..944a857534d 100644 --- a/roles/container-engine/containerd/defaults/main.yml +++ b/roles/container-engine/containerd/defaults/main.yml @@ -18,6 +18,7 @@ containerd_runc_runtime: base_runtime_spec: cri-base.json options: systemdCgroup: "{{ containerd_use_systemd_cgroup | ternary('true', 'false') }}" + binaryName: "{{ bin_dir }}/runc" containerd_additional_runtimes: [] # Example for Kata Containers as additional runtime: diff --git a/roles/container-engine/containerd/templates/config.toml.j2 b/roles/container-engine/containerd/templates/config.toml.j2 index e47069ecb3e..a0749880fe4 100644 --- a/roles/container-engine/containerd/templates/config.toml.j2 +++ b/roles/container-engine/containerd/templates/config.toml.j2 @@ -35,7 +35,11 @@ oom_score = {{ containerd_oom_score }} [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.{{ runtime.name }}.options] {% for key, value in runtime.options.items() %} +{% if value|bool %} {{ key }} = {{ value }} +{% else %} + {{ key }} = "{{ value }}" +{% endif %} {% endfor %} {% endfor %} {% if kata_containers_enabled %}