Skip to content

Commit 18320f9

Browse files
committed
add len check back
Signed-off-by: Justin Alvarez <[email protected]>
1 parent 31245bf commit 18320f9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pkg/start/start.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,14 @@ func Start(ctx context.Context, inst *store.Instance) error {
143143
if nerdctlArchiveCache != "" {
144144
args = append(args, "--nerdctl-archive", nerdctlArchiveCache)
145145
}
146-
location, errs := downloadAndCacheArchiveForArch(y.ExtraArchives, *y.Arch, "extrArchive")
147-
if location == "" {
148-
return fmt.Errorf("failed to download the extraArchive archive, attempted %d candidates, errors=%v",
149-
len(y.ExtraArchives), errs)
146+
if len(y.ExtraArchives) > 0 {
147+
location, errs := downloadAndCacheArchiveForArch(y.ExtraArchives, *y.Arch, "extrArchive")
148+
if location == "" {
149+
return fmt.Errorf("failed to download the extraArchive archive, attempted %d candidates, errors=%v",
150+
len(y.ExtraArchives), errs)
151+
}
152+
args = append(args, "--extra-archive", location)
150153
}
151-
args = append(args, "--extra-archive", location)
152154

153155
args = append(args, inst.Name)
154156
haCmd := exec.CommandContext(ctx, self, args...)

0 commit comments

Comments
 (0)