mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-08-03 23:19:55 +00:00
Ref: https://github.com/containerd/containerd/blob/release/2.0/docs/cri/config.md
Since this is a breaking change, add support for a new v3 template file. If no v3 template is present, fall back to checking for the legacy v2 template and render the old structure.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit bc45972398)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
20 lines
321 B
Go
20 lines
321 B
Go
//go:build linux
|
|
|
|
package templates
|
|
|
|
import (
|
|
"encoding/json"
|
|
"text/template"
|
|
)
|
|
|
|
// Linux config templates do not need fixups
|
|
var templateFuncs = template.FuncMap{
|
|
"deschemify": func(s string) string {
|
|
return s
|
|
},
|
|
"toJson": func(v interface{}) string {
|
|
output, _ := json.Marshal(v)
|
|
return string(output)
|
|
},
|
|
}
|