Skip to content

Commit

Permalink
try disabling chunked upload (#45)
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch authored Sep 22, 2022
1 parent 1c9dc6e commit 4409d4c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
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

0 comments on commit 4409d4c

Please sign in to comment.