Fix newline handling in file, softlink, and ImportLink template functions

Use state-based routing instead of sentinel strings, so whitespace-trimming
syntax (e.g. `{{- file "name" -}}`) correctly creates all named files and
symlinks.

Fixes: #2118

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Co-authored-by: Christian Goll <cgoll@suse.com>
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2026-04-17 15:57:19 -06:00
parent eaac55a97a
commit 2bad789f4f
28 changed files with 767 additions and 256 deletions

View File

@@ -46,7 +46,6 @@ nodes:
log: `backupFile: true
writeFile: true
Filename: ifcfg-default.conf
# This file is autogenerated by warewulf
TYPE=Ethernet
DEVICE=wwnet0
@@ -116,7 +115,6 @@ nodes:
log: `backupFile: true
writeFile: true
Filename: ifcfg-default.conf
# This file is autogenerated by warewulf
TYPE=Ethernet
NAME=default
@@ -210,7 +208,6 @@ nodes:
log: `backupFile: true
writeFile: true
Filename: ifcfg-tagged.conf
# This file is autogenerated by warewulf
VLAN=yes
DEVICE=eth0.902
@@ -263,7 +260,6 @@ nodes:
log: `backupFile: true
writeFile: true
Filename: ifcfg-bond0.conf
# This file is autogenerated by warewulf
TYPE=Bond
DEVICE=bond0
@@ -333,10 +329,8 @@ nodes:
log: `backupFile: true
writeFile: true
Filename: route-tagged.conf
# This file is autogenerated by warewulf
192.168.1.0/24 via 192.168.2.254
backupFile: true
writeFile: true
Filename: route-untagged.conf
@@ -363,7 +357,6 @@ nodes:
log: `backupFile: true
writeFile: true
Filename: ifcfg-tagged.conf
# This file is autogenerated by warewulf
VLAN=yes
DEVICE=eth0.902