mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08:00
Move alternate image acquisition to separate function
Moves acquisition of an alternate image provided by the user out of `acquireVMImage` in `pkg/machine/<hypervisor>/machine.go` and into `pkg/machine/pull.go` as its own function. Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
This commit is contained in:
@ -225,20 +225,11 @@ func (v *MachineVM) acquireVMImage(opts machine.InitOptions) error {
|
||||
// The user has provided an alternate image which can be a file path
|
||||
// or URL.
|
||||
v.ImageStream = "custom"
|
||||
g, err := machine.NewGenericDownloader(vmtype, v.Name, opts.ImagePath)
|
||||
imagePath, err := machine.AcquireAlternateImage(v.Name, vmtype, opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
imagePath, err := machine.NewMachineFile(g.Get().LocalUncompressedFile, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
v.ImagePath = *imagePath
|
||||
if err := machine.DownloadImage(g); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user