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