Skip to content

Commit eac9e92

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

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
@@ -74,22 +74,24 @@ If any private key under ~/.ssh is protected with a passphrase, you need to have
7474
if *a.y.Plain {
7575
return req
7676
}
77-
req = append(req,
78-
requirement{
79-
description: "user session is ready for ssh",
80-
script: `#!/bin/bash
77+
if *a.y.VMType != limayaml.EXT {
78+
req = append(req,
79+
requirement{
80+
description: "user session is ready for ssh",
81+
script: `#!/bin/bash
8182
set -eux -o pipefail
8283
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
8384
echo >&2 "not ready to start persistent ssh session"
8485
exit 1
8586
fi
8687
`,
87-
debugHint: `The boot sequence will terminate any existing user session after updating
88+
debugHint: `The boot sequence will terminate any existing user session after updating
8889
/etc/environment to make sure the session includes the new values.
8990
Terminating the session will break the persistent SSH tunnel, so
9091
it must not be created until the session reset is done.
9192
`,
92-
})
93+
})
94+
}
9395

9496
if *a.y.MountType == limayaml.REVSSHFS && len(a.y.Mounts) > 0 {
9597
req = append(req, requirement{
@@ -171,20 +173,22 @@ Also see "/var/log/cloud-init-output.log" in the guest.
171173

172174
func (a *HostAgent) finalRequirements() []requirement {
173175
req := make([]requirement, 0)
174-
req = append(req,
175-
requirement{
176-
description: "boot scripts must have finished",
177-
script: `#!/bin/bash
176+
if *a.y.VMType != limayaml.EXT {
177+
req = append(req,
178+
requirement{
179+
description: "boot scripts must have finished",
180+
script: `#!/bin/bash
178181
set -eux -o pipefail
179182
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
180183
echo >&2 "boot scripts have not finished"
181184
exit 1
182185
fi
183186
`,
184-
debugHint: `All boot scripts, provisioning scripts, and readiness probes must
187+
debugHint: `All boot scripts, provisioning scripts, and readiness probes must
185188
finish before the instance is considered "ready".
186189
Check "/var/log/cloud-init-output.log" in the guest to see where the process is blocked!
187190
`,
188-
})
191+
})
192+
}
189193
return req
190194
}

0 commit comments

Comments
 (0)