diff options
author | Jason T. Greene <jason.greene@redhat.com> | 2022-07-18 10:34:42 -0500 |
---|---|---|
committer | Jason T. Greene <jason.greene@redhat.com> | 2022-07-18 10:47:21 -0500 |
commit | 82b1d85ebe82b6d9afc3ca5187554ff41c1a8407 (patch) | |
tree | 09f2d18e10835a6b3c8369d25683f010aa8ec51c /pkg/machine/pull.go | |
parent | 5201ea8e4176dfc6cfd2816e5cf1c3fa0adf9587 (diff) | |
download | podman-82b1d85ebe82b6d9afc3ca5187554ff41c1a8407.tar.gz podman-82b1d85ebe82b6d9afc3ca5187554ff41c1a8407.tar.bz2 podman-82b1d85ebe82b6d9afc3ca5187554ff41c1a8407.zip |
Print rootfs download as a specific version on Win
- Also save the file using this convention.
- Change the general pull mechanism to print the local file
as opposed to the remote to enable this - no change in
observed behavior on mac
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
Diffstat (limited to 'pkg/machine/pull.go')
-rw-r--r-- | pkg/machine/pull.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pkg/machine/pull.go b/pkg/machine/pull.go index 08baa7df8..26b6adc67 100644 --- a/pkg/machine/pull.go +++ b/pkg/machine/pull.go @@ -113,7 +113,7 @@ func DownloadImage(d DistributionDownload) error { return err } if !ok { - if err := DownloadVMImage(d.Get().URL, d.Get().LocalPath); err != nil { + if err := DownloadVMImage(d.Get().URL, d.Get().ImageName, d.Get().LocalPath); err != nil { return err } // Clean out old cached images, since we didn't find needed image in cache @@ -128,7 +128,7 @@ func DownloadImage(d DistributionDownload) error { // DownloadVMImage downloads a VM image from url to given path // with download status -func DownloadVMImage(downloadURL *url2.URL, localImagePath string) error { +func DownloadVMImage(downloadURL *url2.URL, imageName string, localImagePath string) error { out, err := os.Create(localImagePath) if err != nil { return err @@ -153,8 +153,7 @@ func DownloadVMImage(downloadURL *url2.URL, localImagePath string) error { return fmt.Errorf("downloading VM image %s: %s", downloadURL, resp.Status) } size := resp.ContentLength - urlSplit := strings.Split(downloadURL.Path, "/") - prefix := "Downloading VM image: " + urlSplit[len(urlSplit)-1] + prefix := "Downloading VM image: " + imageName onComplete := prefix + ": done" p := mpb.New( |