@@ -26,6 +26,12 @@ func (a *HostAgent) waitForRequirements(ctx context.Context, label string, requi
26
26
a .l .Infof ("The %s requirement %d of %d is satisfied" , label , i + 1 , len (requirements ))
27
27
break retryLoop
28
28
}
29
+ if req .fatal {
30
+ a .l .Infof ("No further %s requirements will be checked" , label )
31
+ return multierror .Append (mErr ,
32
+ errors .Wrapf (err , "failed to satisfy the %s requirement %d of %d %q: %s; skipping further checks" ,
33
+ label , i + 1 , len (requirements ), req .description , req .debugHint ))
34
+ }
29
35
if j == retries - 1 {
30
36
mErr = multierror .Append (mErr ,
31
37
errors .Wrapf (err , "failed to satisfy the %s requirement %d of %d %q: %s" ,
@@ -52,6 +58,7 @@ type requirement struct {
52
58
description string
53
59
script string
54
60
debugHint string
61
+ fatal bool
55
62
}
56
63
57
64
func (a * HostAgent ) essentialRequirements () []requirement {
@@ -117,20 +124,37 @@ A possible workaround is to run "lima-guestagent install-systemd" in the guest.
117
124
func (a * HostAgent ) optionalRequirements () []requirement {
118
125
req := make ([]requirement , 0 )
119
126
if * a .y .Containerd .System || * a .y .Containerd .User {
120
- req = append (req , requirement {
121
- description : "containerd binaries to be installed" ,
122
- script : `#!/bin/bash
127
+ req = append (req ,
128
+ requirement {
129
+ description : "systemd must be available" ,
130
+ fatal : true ,
131
+ script : `#!/bin/bash
132
+ set -eux -o pipefail
133
+ if ! command -v systemctl 2>&1 >/dev/null; then
134
+ echo >&2 "systemd is not available on this OS"
135
+ exit 1
136
+ fi
137
+ ` ,
138
+ debugHint : `systemd is required to run containerd, but does not seem to be available.
139
+ Make sure that you use an image that supports systemd. If you do not want to run
140
+ containerd, please make sure that both 'container.system' and 'containerd.user'
141
+ are set to 'false' in the config file.
142
+ ` ,
143
+ },
144
+ requirement {
145
+ description : "containerd binaries to be installed" ,
146
+ script : `#!/bin/bash
123
147
set -eux -o pipefail
124
148
if ! timeout 30s bash -c "until command -v nerdctl; do sleep 3; done"; then
125
149
echo >&2 "nerdctl is not installed yet"
126
150
exit 1
127
151
fi
128
152
` ,
129
- debugHint : `The nerdctl binary was not installed in the guest.
153
+ debugHint : `The nerdctl binary was not installed in the guest.
130
154
Make sure that you are using an officially supported image.
131
155
Also see "/var/log/cloud-init-output.log" in the guest.
132
156
` ,
133
- })
157
+ })
134
158
}
135
159
for _ , probe := range a .y .Probes {
136
160
if probe .Mode == limayaml .ProbeModeReadiness {
0 commit comments