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 (#7991)

Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
(cherry picked from commit 546dc24)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
  • Loading branch information
skirsten authored and brandond committed Aug 4, 2023
1 parent 3b650c9 commit 5122700
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 5122700

Please sign in to comment.