mirror of
https://github.com/k3s-io/k3s.git
synced 2026-04-09 03:16:13 -04:00
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
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>
21 lines
362 B
Go
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,
|
|
}
|