-
Notifications
You must be signed in to change notification settings - Fork 767
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
I'm attempting to write a bootcmd that uses a bash heredoc to write some YAML to provide some config overrides to cloudinit before the network is initialized, but the problem is that lima strips whitespace when writing bootcmds to the bootcmd in the user-data:
Lines 491 to 499 in e21b634
| if f.Mode == limatype.ProvisionModeBoot { | |
| lines := []string{} | |
| for _, line := range strings.Split(*f.Script, "\n") { | |
| if line == "" { | |
| continue | |
| } | |
| lines = append(lines, strings.TrimSpace(line)) | |
| } | |
| bootCmds = append(bootCmds, BootCmds{Lines: lines}) |
Here's the relevant portion of my lima.yaml:
provision:
- mode: boot
script: |
cat <<EOF > /etc/cloud/cloud.cfg.d/99-lima1-disable-route.cfg
ethernets:
lima1:
dhcp4-overrides:
use-routes: false
EOF
And here's what gets rendered in user-data:
bootcmd:
- |
# We need to embed the params.env as a here-doc because /mnt/lima-cidata is not yet mounted
while read -r line; do [ -n "$line" ] && export "$line"; done <<'EOF'
EOF
cat <<EOF > /etc/cloud/cloud.cfg.d/99-lima1-disable-route.cfg
ethernets:
lima1:
dhcp4-overrides:
use-routes: false
EOF
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working