From 958c7f7e6045110f73dfa1d340eb8abaf1cf6466 Mon Sep 17 00:00:00 2001 From: Dennis Kliban Date: Wed, 1 Nov 2023 08:57:36 -0400 Subject: [PATCH] Makes pulp_container compatible with pulpcore 3.40 closes: #1399 --- CHANGES/1399.feature | 1 + pulp_container/app/cache.py | 2 ++ pulp_container/app/registry.py | 4 ++-- requirements.txt | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 CHANGES/1399.feature diff --git a/CHANGES/1399.feature b/CHANGES/1399.feature new file mode 100644 index 000000000..d94287edf --- /dev/null +++ b/CHANGES/1399.feature @@ -0,0 +1 @@ +Made pulp_container compatible with pulpcore 3.40. diff --git a/pulp_container/app/cache.py b/pulp_container/app/cache.py index 4b9151027..16ee76c44 100644 --- a/pulp_container/app/cache.py +++ b/pulp_container/app/cache.py @@ -21,6 +21,8 @@ def __init__(self, base_key=None, expires_ttl=None, auth=None): class RegistryContentCache(RegistryCache, AsyncContentCache): """A wrapper around the Redis content cache handler tailored for the content application.""" + ADD_TRAILING_SLASH = False + def make_key(self, request): """Make a key composed of the request's path, method, host, and accept header.""" accept_header = ",".join(sorted(request.headers.getall("accept", []))) diff --git a/pulp_container/app/registry.py b/pulp_container/app/registry.py index 706ae8998..de9376755 100644 --- a/pulp_container/app/registry.py +++ b/pulp_container/app/registry.py @@ -105,7 +105,7 @@ async def get_tag(self, request): path = request.match_info["path"] tag_name = request.match_info["tag_name"] - distribution = await sync_to_async(self._match_distribution)(path) + distribution = await sync_to_async(self._match_distribution)(path, add_trailing_slash=False) await sync_to_async(self._permit)(request, distribution) repository_version = await sync_to_async(distribution.get_repository_version)() if not repository_version: @@ -222,7 +222,7 @@ async def get_by_digest(self, request): path = request.match_info["path"] digest = "sha256:{digest}".format(digest=request.match_info["digest"]) - distribution = await sync_to_async(self._match_distribution)(path) + distribution = await sync_to_async(self._match_distribution)(path, add_trailing_slash=False) await sync_to_async(self._permit)(request, distribution) repository_version = await sync_to_async(distribution.get_repository_version)() if not repository_version: diff --git a/requirements.txt b/requirements.txt index 4262f9327..b2f31e337 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ ecdsa>=0.14,<=0.18.0 jsonschema>=4.4,<4.20 -pulpcore>=3.25.0,<3.40 +pulpcore>=3.40.1,<3.55 pyjwkest>=1.4,<=1.4.2 pyjwt[crypto]>=2.4,<2.9