Add support for {{ template "base" . }} in etc/containerd/config.toml.tmpl (#7991)

Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
This commit is contained in:
Simon Kirsten 2023-07-31 22:36:23 +02:00 committed by GitHub
parent 6d360e6473
commit 546dc247a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -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
}

View File

@ -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
}