Skip to content

Directory Support#55

Merged
shizhMSFT merged 12 commits into
masterfrom
shizh/folder
Apr 15, 2019
Merged

Directory Support#55
shizhMSFT merged 12 commits into
masterfrom
shizh/folder

Conversation

@shizhMSFT

@shizhMSFT shizhMSFT commented Apr 3, 2019

Copy link
Copy Markdown
Contributor

This PR enables oras to push / pull a directory to / from a remote registry.

To push, the target directory is compressed into a tar.gz temproray file (on Linux, it sits at /tmp). Then the tar.gz file is pushed normally with media type application/vnd.oci.image.layer.v1.tar+gzip and extra annotations

  • io.deis.oras.content.digest: the sha256 digest of the internal tar file. It is different from the digest of the tar.gz file.
  • io.deis.oras.content.unpack: marked as true for extration when pull.

To pull, the tar.gz file is pulled to a temprorary directory. Then it is extracted and verified against io.deis.oras.content.digest.

Notes:

  • Since the temp files are introduced, please call defer store.Close() for *FileStore to release resources.
  • The pushed directory can be directly used as a layer of a container image without any modification.

Resolves #54

@shizhMSFT shizhMSFT added the enhancement New feature or request label Apr 3, 2019
Comment thread pkg/content/utils.go
Comment thread pkg/content/utils.go Outdated
@jdolitsky

Copy link
Copy Markdown
Contributor

/test

@jdolitsky jdolitsky self-requested a review April 11, 2019 16:25
Comment thread pkg/content/utils.go
Comment thread pkg/content/file.go Outdated
Comment thread pkg/content/utils.go
@shizhMSFT

Copy link
Copy Markdown
Contributor Author

/test

@jdolitsky jdolitsky self-requested a review April 12, 2019 11:29

@jdolitsky jdolitsky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@yuwaMSFT2

Copy link
Copy Markdown

LGTM

@shizhMSFT shizhMSFT merged commit c71f94e into master Apr 15, 2019
@shizhMSFT shizhMSFT deleted the shizh/folder branch April 15, 2019 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable folder upload

3 participants