Skip to content

Commit

Permalink
Fix saving in oci format
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Jun 11, 2020
1 parent 39ad038 commit 0021754
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libpod/image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/containers/image/v5/image"
"github.com/containers/image/v5/manifest"
ociarchive "github.com/containers/image/v5/oci/archive"
"github.com/containers/image/v5/oci/layout"
is "github.com/containers/image/v5/storage"
"github.com/containers/image/v5/tarball"
"github.com/containers/image/v5/transports"
Expand Down Expand Up @@ -1475,9 +1476,10 @@ func (i *Image) Save(ctx context.Context, source, format, output string, moreTag
return errors.Wrapf(err, "error getting OCI archive ImageReference for (%q, %q)", output, destImageName)
}
case "oci-dir":
destRef, err = directory.NewReference(output)
destImageName := imageNameForSaveDestination(i, source)
destRef, err = layout.NewReference(output, destImageName)
if err != nil {
return errors.Wrapf(err, "error getting directory ImageReference for %q", output)
return errors.Wrapf(err, "error saving the oci directory ImageReference for (%q, %q)", output, destImageName)
}
manifestType = imgspecv1.MediaTypeImageManifest
case "docker-dir":
Expand Down

0 comments on commit 0021754

Please sign in to comment.