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