Skip to content

Commit 7c4c709

Browse files
committed
Don't wait for bootscripts for external
Signed-off-by: Anders F Björklund <[email protected]>
1 parent ac6b13c commit 7c4c709

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

pkg/hostagent/requirements.go

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -131,22 +131,24 @@ If any private key under ~/.ssh is protected with a passphrase, you need to have
131131
if *a.instConfig.Plain {
132132
return req
133133
}
134-
req = append(req,
135-
requirement{
136-
description: "user session is ready for ssh",
137-
script: `#!/bin/bash
134+
if *a.y.VMType != limayaml.EXT {
135+
req = append(req,
136+
requirement{
137+
description: "user session is ready for ssh",
138+
script: `#!/bin/bash
138139
set -eux -o pipefail
139140
if ! timeout 30s bash -c "until sudo diff -q /run/lima-ssh-ready /mnt/lima-cidata/meta-data 2>/dev/null; do sleep 3; done"; then
140141
echo >&2 "not ready to start persistent ssh session"
141142
exit 1
142143
fi
143144
`,
144-
debugHint: `The boot sequence will terminate any existing user session after updating
145+
debugHint: `The boot sequence will terminate any existing user session after updating
145146
/etc/environment to make sure the session includes the new values.
146147
Terminating the session will break the persistent SSH tunnel, so
147148
it must not be created until the session reset is done.
148149
`,
149-
})
150+
})
151+
}
150152

151153
if *a.instConfig.MountType == limayaml.REVSSHFS && len(a.instConfig.Mounts) > 0 {
152154
req = append(req, requirement{
@@ -228,20 +230,22 @@ Also see "/var/log/cloud-init-output.log" in the guest.
228230

229231
func (a *HostAgent) finalRequirements() []requirement {
230232
req := make([]requirement, 0)
231-
req = append(req,
232-
requirement{
233-
description: "boot scripts must have finished",
234-
script: `#!/bin/bash
233+
if *a.y.VMType != limayaml.EXT {
234+
req = append(req,
235+
requirement{
236+
description: "boot scripts must have finished",
237+
script: `#!/bin/bash
235238
set -eux -o pipefail
236239
if ! timeout 30s bash -c "until sudo diff -q /run/lima-boot-done /mnt/lima-cidata/meta-data 2>/dev/null; do sleep 3; done"; then
237240
echo >&2 "boot scripts have not finished"
238241
exit 1
239242
fi
240243
`,
241-
debugHint: `All boot scripts, provisioning scripts, and readiness probes must
244+
debugHint: `All boot scripts, provisioning scripts, and readiness probes must
242245
finish before the instance is considered "ready".
243246
Check "/var/log/cloud-init-output.log" in the guest to see where the process is blocked!
244247
`,
245-
})
248+
})
249+
}
246250
return req
247251
}

0 commit comments

Comments
 (0)