k3s/pkg/agent/templates/templates_linux.go
Fabiano Fidêncio b51167a996
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
config: add default imports to containerd base templates
Add imports to the generated containerd config so containerd loads
drop-in TOML files: config.toml.d for v2, config-v3.toml.d for v3
(e.g. /var/lib/rancher/k3s/agent/etc/containerd/config.toml.d and
/var/lib/rancher/k3s/agent/etc/containerd/config-v3.toml.d).

Also fix the v3 header comment to say config-v3.toml.tmpl instead
of config.toml.tmpl.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2026-03-02 14:20:29 -08:00

21 lines
362 B
Go

//go:build linux
package templates
import (
"encoding/json"
"path/filepath"
"text/template"
)
// Linux config templates do not need fixups
var templateFuncs = template.FuncMap{
"deschemify": func(s string) string {
return s
},
"toJson": func(v any) string {
output, _ := json.Marshal(v)
return string(output)
},
"filepathjoin": filepath.Join,
}