Browse Source

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

Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
pull/8090/head
Simon Kirsten 1 year ago committed by GitHub
parent
commit
546dc247a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      pkg/agent/templates/templates_linux.go
  2. 1
      pkg/agent/templates/templates_windows.go

1
pkg/agent/templates/templates_linux.go

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

1
pkg/agent/templates/templates_windows.go

@ -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…
Cancel
Save