Skip to content

Make oras-py behave the same way as oras-go for deciding whether to unpack a layer #179

Open
stefansli wants to merge 5 commits into
oras-project:mainfrom
stefansli:fix_119_unpack
Open

Make oras-py behave the same way as oras-go for deciding whether to unpack a layer #179
stefansli wants to merge 5 commits into
oras-project:mainfrom
stefansli:fix_119_unpack

Conversation

@stefansli
Copy link
Copy Markdown

See initial implementation at #170

Fixes #119

MichaelKopfMkf and others added 3 commits December 3, 2024 13:15
…npack a tar layer or not

Signed-off-by: Michael Kopf <michael.kopf@vector.com>
Signed-off-by: Michael Kopf <michael.kopf@vector.com>
Comment thread oras/provider.py Outdated
# A directory will need to be uncompressed and moved
unpack_layer = annotations.get(oras.defaults.annotation_unpack, False)

if unpack_layer and skip_unpack:
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.

How do we know the filename doesn't already have .tar.gz?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

After thinking about this for a while:

Do we even need the skip_unpack parameter if we support the official annotation?
For special cases, one can always call self.download_blob directly.

To me unpack_layer and skip_unpack reads like a contradiction with behavior that is not obvious and must be documented. So I'd rather leave it out. What do you think?

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.

What does the upstream oras client do?

Comment thread CHANGELOG.md Outdated
Signed-off-by: Stefan Lietzau <104021830+stefansli@users.noreply.github.com>
Rewrite test to test the functionality to only unpack if the annotation is set.

Signed-off-by: Stefan Lietzau <104021830+stefansli@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable tgz extraction on pull

3 participants