From 6e2bb3618291d664284a6680d9c336f08403ffc1 Mon Sep 17 00:00:00 2001 From: Jin Li Date: Mon, 29 May 2023 18:29:26 +0800 Subject: [PATCH 1/2] Specify 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..a101577e27e 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|string != "true" and value|string != "false" %} + {{ key }} = "{{ value }}" +{% else %} {{ key }} = {{ value }} +{% endif %} {% endfor %} {% endfor %} {% if kata_containers_enabled %} From fbead7c9abb7bf5e0b996961b3b1c3fd1cf3592e Mon Sep 17 00:00:00 2001 From: qlijin Date: Mon, 17 Jul 2023 06:31:31 +0000 Subject: [PATCH 2/2] Update roles/container-engine/containerd/templates/config.toml.j2 Co-authored-by: Arthur Outhenin-Chalandre --- roles/container-engine/containerd/templates/config.toml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/container-engine/containerd/templates/config.toml.j2 b/roles/container-engine/containerd/templates/config.toml.j2 index a101577e27e..cbc73d90fd4 100644 --- a/roles/container-engine/containerd/templates/config.toml.j2 +++ b/roles/container-engine/containerd/templates/config.toml.j2 @@ -35,7 +35,7 @@ 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|string != "true" and value|string != "false" %} +{% if value | string != "true" and value | string != "false" %} {{ key }} = "{{ value }}" {% else %} {{ key }} = {{ value }}