Skip to content

Commit be0ecd7

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

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
@@ -117,22 +117,24 @@ If any private key under ~/.ssh is protected with a passphrase, you need to have
117117
if *a.instConfig.Plain {
118118
return req
119119
}
120-
req = append(req,
121-
requirement{
122-
description: "user session is ready for ssh",
123-
script: `#!/bin/bash
120+
if *a.y.VMType != limayaml.EXT {
121+
req = append(req,
122+
requirement{
123+
description: "user session is ready for ssh",
124+
script: `#!/bin/bash
124125
set -eux -o pipefail
125126
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
126127
echo >&2 "not ready to start persistent ssh session"
127128
exit 1
128129
fi
129130
`,
130-
debugHint: `The boot sequence will terminate any existing user session after updating
131+
debugHint: `The boot sequence will terminate any existing user session after updating
131132
/etc/environment to make sure the session includes the new values.
132133
Terminating the session will break the persistent SSH tunnel, so
133134
it must not be created until the session reset is done.
134135
`,
135-
})
136+
})
137+
}
136138

137139
if *a.instConfig.MountType == limayaml.REVSSHFS && len(a.instConfig.Mounts) > 0 {
138140
req = append(req, requirement{
@@ -214,20 +216,22 @@ Also see "/var/log/cloud-init-output.log" in the guest.
214216

215217
func (a *HostAgent) finalRequirements() []requirement {
216218
req := make([]requirement, 0)
217-
req = append(req,
218-
requirement{
219-
description: "boot scripts must have finished",
220-
script: `#!/bin/bash
219+
if *a.y.VMType != limayaml.EXT {
220+
req = append(req,
221+
requirement{
222+
description: "boot scripts must have finished",
223+
script: `#!/bin/bash
221224
set -eux -o pipefail
222225
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
223226
echo >&2 "boot scripts have not finished"
224227
exit 1
225228
fi
226229
`,
227-
debugHint: `All boot scripts, provisioning scripts, and readiness probes must
230+
debugHint: `All boot scripts, provisioning scripts, and readiness probes must
228231
finish before the instance is considered "ready".
229232
Check "/var/log/cloud-init-output.log" in the guest to see where the process is blocked!
230233
`,
231-
})
234+
})
235+
}
232236
return req
233237
}

0 commit comments

Comments
 (0)