Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory Support #55

Merged
merged 12 commits into from
Apr 15, 2019
Merged

Directory Support #55

merged 12 commits into from
Apr 15, 2019

Conversation

shizhMSFT
Copy link
Contributor

@shizhMSFT shizhMSFT commented Apr 3, 2019

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
pkg/content/utils.go Outdated Show resolved Hide resolved
@jdolitsky
Copy link
Contributor

/test

@jdolitsky jdolitsky self-requested a review April 11, 2019 16:25
pkg/content/file.go Outdated Show resolved Hide resolved
@shizhMSFT
Copy link
Contributor Author

/test

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

@jdolitsky jdolitsky left a comment

Choose a reason for hiding this comment

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

lgtm

@yuwaMSFT2
Copy link

LGTM

@shizhMSFT shizhMSFT merged commit c71f94e into master Apr 15, 2019
@shizhMSFT shizhMSFT deleted the shizh/folder branch April 15, 2019 02:42
@shizhMSFT shizhMSFT mentioned this pull request Apr 15, 2019
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