@@ -336,14 +336,18 @@ func GenerateISO9660(instDir, name string, y *limayaml.LimaYAML, udpDNSLocalPort
336
336
}
337
337
}
338
338
339
- guestAgentBinary , err := GuestAgentBinary (* y .OS , * y .Arch )
339
+ guestAgentBinary , err := usrlocalsharelima . GuestAgentBinary (* y .OS , * y .Arch )
340
340
if err != nil {
341
341
return err
342
342
}
343
- defer guestAgentBinary .Close ()
343
+ guestAgent , err := os .Open (guestAgentBinary )
344
+ if err != nil {
345
+ return err
346
+ }
347
+ defer guestAgent .Close ()
344
348
layout = append (layout , iso9660util.Entry {
345
349
Path : "lima-guestagent" ,
346
- Reader : guestAgentBinary ,
350
+ Reader : guestAgent ,
347
351
})
348
352
349
353
if nerdctlArchive != "" {
@@ -370,21 +374,6 @@ func GenerateISO9660(instDir, name string, y *limayaml.LimaYAML, udpDNSLocalPort
370
374
return iso9660util .Write (filepath .Join (instDir , filenames .CIDataISO ), "cidata" , layout )
371
375
}
372
376
373
- func GuestAgentBinary (ostype limayaml.OS , arch limayaml.Arch ) (io.ReadCloser , error ) {
374
- if ostype == "" {
375
- return nil , errors .New ("os must be set" )
376
- }
377
- if arch == "" {
378
- return nil , errors .New ("arch must be set" )
379
- }
380
- dir , err := usrlocalsharelima .Dir ()
381
- if err != nil {
382
- return nil , err
383
- }
384
- gaPath := filepath .Join (dir , "lima-guestagent." + ostype + "-" + arch )
385
- return os .Open (gaPath )
386
- }
387
-
388
377
func getCert (content string ) Cert {
389
378
lines := []string {}
390
379
for _ , line := range strings .Split (content , "\n " ) {
0 commit comments