Skip to content

Commit

Permalink
Add support for {{ template "base" . }} in etc/containerd/config.to…
Browse files Browse the repository at this point in the history
…ml.tmpl (k3s-io#7991)

Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
  • Loading branch information
skirsten committed Jul 31, 2023
1 parent 6d360e6 commit 546dc24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/agent/templates/templates_linux.go
Expand Up @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions pkg/agent/templates/templates_windows.go
Expand Up @@ -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
}
Expand Down

0 comments on commit 546dc24

Please sign in to comment.