From 88f452a88c296379e11fc722449c37cd529855f3 Mon Sep 17 00:00:00 2001 From: "Heck, Jerod" Date: Thu, 2 Mar 2023 18:43:09 -0500 Subject: [PATCH 1/9] fix: Update the registry matching pattern Signed-off-by: Heck, Jerod --- oras/provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oras/provider.py b/oras/provider.py index 8bb024e..af8b540 100644 --- a/oras/provider.py +++ b/oras/provider.py @@ -493,7 +493,7 @@ def _get_location( return session_url # Some registries do not return the full registry hostname - prefix = f"{self.prefix}://{container.registry}" + prefix = f"{self.prefix}" if not session_url.startswith(prefix): session_url = f"{prefix}{session_url}" return session_url From b352eacc3279e6ae801f3dcbc4ec760f0d9844a5 Mon Sep 17 00:00:00 2001 From: "Heck, Jerod" Date: Thu, 2 Mar 2023 18:52:55 -0500 Subject: [PATCH 2/9] fix: Update to just look for http Signed-off-by: Heck, Jerod --- oras/provider.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/oras/provider.py b/oras/provider.py index af8b540..e997ce2 100644 --- a/oras/provider.py +++ b/oras/provider.py @@ -492,8 +492,9 @@ def _get_location( if not session_url: return session_url - # Some registries do not return the full registry hostname - prefix = f"{self.prefix}" + # Some registries do not return the full registry hostname. Check that + # the url starts with a protocol scheme + prefix = "http" if not session_url.startswith(prefix): session_url = f"{prefix}{session_url}" return session_url From d30fb8ea2b8a2734597949a416cde951f8616dcb Mon Sep 17 00:00:00 2001 From: "Heck, Jerod" Date: Thu, 2 Mar 2023 19:03:44 -0500 Subject: [PATCH 3/9] fix: Add reference to origination issue Signed-off-by: Heck, Jerod --- oras/provider.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oras/provider.py b/oras/provider.py index e997ce2..746dd72 100644 --- a/oras/provider.py +++ b/oras/provider.py @@ -493,7 +493,8 @@ def _get_location( return session_url # Some registries do not return the full registry hostname. Check that - # the url starts with a protocol scheme + # the url starts with a protocol scheme, change tracked with: + # https://github.com/oras-project/oras-py/issues/78 prefix = "http" if not session_url.startswith(prefix): session_url = f"{prefix}{session_url}" From 645727fa8b0bbe004ba9056cfaf5ffb5cb748e3b Mon Sep 17 00:00:00 2001 From: "Heck, Jerod" Date: Thu, 2 Mar 2023 19:13:32 -0500 Subject: [PATCH 4/9] docs: Bump version and update changelog Signed-off-by: Heck, Jerod --- CHANGELOG.md | 3 +++ oras/version.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12d42a9..05e7412 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ 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.1.17](https://github.com/oras-project/oras-py/tree/main) (0.1.17) + - patch fix to correct session url pattern, closes issue [78](https://github.com/oras-project/oras-py/issues/78) + ## [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) - bugfix that pagination sets upper limit of 10K (0.1.15) 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" From 7c9d99571c6b95d79bfb31d34f5289d8bb10afc7 Mon Sep 17 00:00:00 2001 From: jhlmco <126677738+jhlmco@users.noreply.github.com> Date: Thu, 2 Mar 2023 20:37:29 -0500 Subject: [PATCH 5/9] Update CHANGELOG.md Co-authored-by: Vanessasaurus <814322+vsoch@users.noreply.github.com> Signed-off-by: jhlmco <126677738+jhlmco@users.noreply.github.com> --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05e7412..68818a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,8 @@ The versions coincide with releases on pip. Only major versions will be released - patch fix to correct session url pattern, closes issue [78](https://github.com/oras-project/oras-py/issues/78) ## [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) From 043f9d61451fa98dd82d7931d0359b4dd21dec1e Mon Sep 17 00:00:00 2001 From: "Heck, Jerod" Date: Thu, 2 Mar 2023 20:58:13 -0500 Subject: [PATCH 6/9] fix: Update per MR comments Signed-off-by: Heck, Jerod --- oras/provider.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/oras/provider.py b/oras/provider.py index 746dd72..4950515 100644 --- a/oras/provider.py +++ b/oras/provider.py @@ -495,8 +495,9 @@ def _get_location( # 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 = "http" - if not session_url.startswith(prefix): + prefix = f"{self.prefix}://{container.registry}" + + if not session_url.startswith('http'): session_url = f"{prefix}{session_url}" return session_url From 2916feac3fe34ab30ee07237f8cc583001210210 Mon Sep 17 00:00:00 2001 From: "Heck, Jerod" Date: Thu, 2 Mar 2023 21:26:16 -0500 Subject: [PATCH 7/9] fix: Update changelog and remove extra version Signed-off-by: Heck, Jerod --- CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68818a8..c4985ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,9 +13,6 @@ 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.1.17](https://github.com/oras-project/oras-py/tree/main) (0.1.17) - - patch fix to correct session url pattern, closes issue [78](https://github.com/oras-project/oras-py/issues/78) - ## [0.0.x](https://github.com/oras-project/oras-py/tree/main) (0.0.x) - 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) From dd22d76856b49d3a76b15d1e2cf9e10a08db7dc7 Mon Sep 17 00:00:00 2001 From: "Heck, Jerod" Date: Thu, 2 Mar 2023 21:44:59 -0500 Subject: [PATCH 8/9] fix: Run pre-commits Signed-off-by: Heck, Jerod --- oras/provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oras/provider.py b/oras/provider.py index 4950515..5864f8b 100644 --- a/oras/provider.py +++ b/oras/provider.py @@ -492,7 +492,7 @@ def _get_location( if not session_url: return session_url - # Some registries do not return the full registry hostname. Check that + # 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}" From 52e0aa0ebacb55c79b1826d688683541cfdca2ed Mon Sep 17 00:00:00 2001 From: vsoch Date: Fri, 3 Mar 2023 13:19:21 -0700 Subject: [PATCH 9/9] run black Signed-off-by: vsoch --- oras/provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oras/provider.py b/oras/provider.py index 5864f8b..700412e 100644 --- a/oras/provider.py +++ b/oras/provider.py @@ -497,7 +497,7 @@ def _get_location( # https://github.com/oras-project/oras-py/issues/78 prefix = f"{self.prefix}://{container.registry}" - if not session_url.startswith('http'): + if not session_url.startswith("http"): session_url = f"{prefix}{session_url}" return session_url