Podman load can pull in compressed files
Podman load can now load in docker-archive files that are compressed. Signed-off-by: umohnani8 <umohnani@redhat.com> Closes: #468 Approved by: baude
This commit is contained in:
parent
9afa1f7416
commit
713c08630b
|
@ -606,7 +606,10 @@ func (r *Runtime) getPullListFromRef(srcRef types.ImageReference, imgName string
|
||||||
|
|
||||||
// supports pulling from docker-archive, oci, and registries
|
// supports pulling from docker-archive, oci, and registries
|
||||||
if srcRef.Transport().Name() == DockerArchive {
|
if srcRef.Transport().Name() == DockerArchive {
|
||||||
tarSource := tarfile.NewSource(archFile)
|
tarSource, err := tarfile.NewSourceFromFile(archFile)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
manifest, err := tarSource.LoadTarManifest()
|
manifest, err := tarSource.LoadTarManifest()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Errorf("error retrieving manifest.json: %v", err)
|
return nil, errors.Errorf("error retrieving manifest.json: %v", err)
|
||||||
|
|
|
@ -44,6 +44,26 @@ var _ = Describe("Podman load", func() {
|
||||||
Expect(result.ExitCode()).To(Equal(0))
|
Expect(result.ExitCode()).To(Equal(0))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("podman load compressed tar file", func() {
|
||||||
|
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")
|
||||||
|
|
||||||
|
save := podmanTest.Podman([]string{"save", "-o", outfile, ALPINE})
|
||||||
|
save.WaitWithDefaultTimeout()
|
||||||
|
Expect(save.ExitCode()).To(Equal(0))
|
||||||
|
|
||||||
|
compress := podmanTest.SystemExec("gzip", []string{outfile})
|
||||||
|
compress.WaitWithDefaultTimeout()
|
||||||
|
outfile = outfile + ".gz"
|
||||||
|
|
||||||
|
rmi := podmanTest.Podman([]string{"rmi", ALPINE})
|
||||||
|
rmi.WaitWithDefaultTimeout()
|
||||||
|
Expect(rmi.ExitCode()).To(Equal(0))
|
||||||
|
|
||||||
|
result := podmanTest.Podman([]string{"load", "-i", outfile})
|
||||||
|
result.WaitWithDefaultTimeout()
|
||||||
|
Expect(result.ExitCode()).To(Equal(0))
|
||||||
|
})
|
||||||
|
|
||||||
It("podman load oci-archive image", func() {
|
It("podman load oci-archive image", func() {
|
||||||
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")
|
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue