mirror of https://github.com/k3s-io/k3s
Add support for `{{ template "base" . }}` in etc/containerd/config.toml.tmpl (#7991)
Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>pull/8090/head
parent
6d360e6473
commit
546dc247a0
|
@ -131,6 +131,7 @@ enable_keychain = true
|
|||
func ParseTemplateFromConfig(templateBuffer string, config interface{}) (string, error) {
|
||||
out := new(bytes.Buffer)
|
||||
t := template.Must(template.New("compiled_template").Parse(templateBuffer))
|
||||
template.Must(t.New("base").Parse(ContainerdConfigTemplate))
|
||||
if err := t.Execute(out, config); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
|
@ -179,6 +179,7 @@ func ParseTemplateFromConfig(templateBuffer string, config interface{}) (string,
|
|||
},
|
||||
}
|
||||
t := template.Must(template.New("compiled_template").Funcs(funcs).Parse(templateBuffer))
|
||||
template.Must(t.New("base").Parse(ContainerdConfigTemplate))
|
||||
if err := t.Execute(out, config); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue