Skip to content

Commit

Permalink
fix: 兼容 Registry V2 的工作流
Browse files Browse the repository at this point in the history
  • Loading branch information
shabbywu committed Jan 7, 2022
1 parent d1b4d61 commit 160f4d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion moby_distribution/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from moby_distribution.spec.image_json import ImageJSON
from moby_distribution.spec.manifest import ManifestSchema1, ManifestSchema2, OCIManifestSchema1

__version__ = "0.4.1"
__version__ = "0.4.2"
__ALL__ = [
"DockerRegistryV2Client",
"Blob",
Expand Down
5 changes: 5 additions & 0 deletions moby_distribution/registry/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ def _validate_response(self, resp: requests.Response, auto_auth: bool = True) ->
raise exceptions.RetryAgain
raise exceptions.PermissionDeny

if resp.status_code == 403:
if auto_auth and self._authed is None and self.ping():
raise exceptions.RetryAgain
raise exceptions.PermissionDeny

if resp.status_code == 404:
raise exceptions.ResourceNotFound

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "moby-distribution"
version = "0.4.1"
version = "0.4.2"
description = "Yet another moby(docker) distribution implement by python."
authors = ["shabbywu <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 160f4d1

Please sign in to comment.