mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-02-22 06:43:41 +00:00
K3s docs (https://docs.k3s.io/advanced#configuring-containerd) say that the right way to customize containerd is to extend the base template with {{ template "base" . }} and append your own TOML blocks, rather than copying a prerendered config.toml into the template file. We were copying config.toml into config.toml.tmpl / config-v3.toml.tmpl, which meant we were replacing the K3s defaults with a snapshot that gets stale as soon as K3s is upgraded. Now we create the template files with just the base directive and let our regular set_toml_value code path append the Kata runtime configuration on top. To make that work, the TOML utils learned to handle files that start with a Go template line ({{ ... }}): strip it before parsing, put it back when writing. This keeps the K3s/RKE2 path identical to every other runtime -- no special append logic needed. refs: * k3s:: https://docs.k3s.io/advanced#configuring-containerd * rke2: https://docs.rke2.io/advanced?_highlight=conyainerd#configuring-containerd Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>