oras-py icon indicating copy to clipboard operation
oras-py copied to clipboard

Disable tgz extraction on pull

Open daniel-pebble opened this issue 2 years ago • 3 comments

It seems that client.pull() automatically extracts archives which is a nice feature however I don't require it so it is possible to disable?

I've also noticed that the result from the pull is an invalid path, the path is actually the path to the extacted folder however the returned path includes the tgz which is infact in another folder (all be it with a random name)

image

image

image

daniel-pebble avatar Nov 28 '23 11:11 daniel-pebble

It's partially related to this issue: https://github.com/oras-project/oras-go/issues/644. We should possibly follow what they decide to do and then mimic it here.

vsoch avatar Nov 28 '23 16:11 vsoch

When I use "oras pull" it doesn't unpack the tgz automatically so I thought it was just an issue with the py library. Looking at the pull function, could we add an argument like "skip_unpack= kwargs.get("skip_unpack", false)" and then check the value of that variable here if layer["mediaType"] == oras.defaults.default_blob_dir_media_type:

daniel-pebble avatar Nov 28 '23 16:11 daniel-pebble

Yes absolutely - I think that's the direction the upstream client will go to. Would you care to do a pull request? We can add the argument, and ensure that:

  1. Documentation for usage is added
  2. A test
  3. Update the CHANGELOG.md and version.py

Thank you!

vsoch avatar Nov 28 '23 17:11 vsoch