Skip to content

Commit

Permalink
Add log output for template rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Thor77 committed Nov 14, 2022
1 parent 807b493 commit 42ebdcf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ func main() {
var templateContent []byte
if cfg.Flatcar.TemplateCommand == "" {
ignitionTemplate := cfg.Flatcar.ConfigTemplate
log.Printf("rendering ignition config using native template at %s\n", ignitionTemplate)
buffer := &bytes.Buffer{}
tmpl, err := template.New(filepath.Base(ignitionTemplate)).ParseFiles(ignitionTemplate)
if err != nil {
Expand Down Expand Up @@ -239,6 +240,8 @@ func main() {

templateContent, _ = ioutil.ReadAll(buffer)
} else {
log.Printf("rendering ignition config using command '%s'\n", cfg.Flatcar.TemplateCommand)

// marshal template data for passing it to the custom command
templateData := customTemplateData{
Hetzner: customTemplateDataHetzner{
Expand Down

0 comments on commit 42ebdcf

Please sign in to comment.