From d17bb93bff1ba868d3b43b631b6730d1645a7136 Mon Sep 17 00:00:00 2001 From: jhlmco <126677738+jhlmco@users.noreply.github.com> Date: Fri, 3 Mar 2023 20:45:26 -0500 Subject: [PATCH] fix: Update the registry matching pattern (#79) * fix: Update the registry matching pattern * fix: Update to just look for http * fix: Add reference to origination issue * docs: Bump version and update changelog * fix: Update changelog and remove extra version * fix: Run pre-commits Signed-off-by: Heck, Jerod --- CHANGELOG.md | 3 ++- oras/provider.py | 7 +++++-- oras/version.py | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12d42a9..c4985ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,8 @@ 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) - - add support for tag deletion and retry decorators (0.1.16) + - patch fix to correct session url pattern, closes issue [78](https://github.com/oras-project/oras-py/issues/78) (0.1.17) + - add support for tag deletion and retry decorators (0.1.16) - bugfix that pagination sets upper limit of 10K (0.1.15) - pagination for tags (and general function for pagination) (0.1.14) - expose upload_blob function to be consistent (0.1.13) diff --git a/oras/provider.py b/oras/provider.py index 8bb024e..700412e 100644 --- a/oras/provider.py +++ b/oras/provider.py @@ -492,9 +492,12 @@ def _get_location( if not session_url: return session_url - # Some registries do not return the full registry hostname + # Some registries do not return the full registry hostname. Check that + # the url starts with a protocol scheme, change tracked with: + # https://github.com/oras-project/oras-py/issues/78 prefix = f"{self.prefix}://{container.registry}" - if not session_url.startswith(prefix): + + if not session_url.startswith("http"): session_url = f"{prefix}{session_url}" return session_url diff --git a/oras/version.py b/oras/version.py index 5183c2e..434aec3 100644 --- a/oras/version.py +++ b/oras/version.py @@ -2,7 +2,7 @@ __copyright__ = "Copyright The ORAS Authors." __license__ = "Apache-2.0" -__version__ = "0.1.16" +__version__ = "0.1.17" AUTHOR = "Vanessa Sochat" EMAIL = "vsoch@users.noreply.github.com" NAME = "oras"