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

try disabling chunked upload #45

Merged
merged 1 commit into from
Sep 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
The versions coincide with releases on pip. Only major versions will be released as tags on Github.

## [0.0.x](https://github.com/oras-project/oras-py/tree/main) (0.0.x)
- disable chunked upload for now (not supported by all registries) (0.0.15)
- support for adding one-off annotations for a manifest (0.0.14)
- add debug if location header returned is empty (0.0.13)
- docker is an optional dependency, to minimize dependencies (0.0.12)
Expand Down
10 changes: 8 additions & 2 deletions oras/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ def _parse_manifest_ref(self, ref: str) -> Union[Tuple[str, str], List[str]]:
return ref.split(":", 1)

def _upload_blob(
self, blob: str, container: Union[str, oras.container.Container], layer: dict
self,
blob: str,
container: Union[str, oras.container.Container],
layer: dict,
do_chunked: bool = False,
) -> requests.Response:
"""
Prepare and upload a blob.
Expand All @@ -177,7 +181,9 @@ def _upload_blob(
self.reset_basic_auth()

# Chunked for large, otherwise POST and PUT
if layer["size"] < 1024:
# This is currently disabled unless the user asks for it, as
# it doesn't seem to work for all registries
if not do_chunked:
response = self._put_upload(blob, container, layer)
else:
response = self._chunked_upload(blob, container, layer)
Expand Down
2 changes: 1 addition & 1 deletion oras/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__copyright__ = "Copyright The ORAS Authors."
__license__ = "Apache-2.0"

__version__ = "0.0.14"
__version__ = "0.0.15"
AUTHOR = "Vanessa Sochat"
EMAIL = "[email protected]"
NAME = "oras"
Expand Down