Skip to content

Commit

Permalink
Fixed an HTTP 404 response during sync from registry.redhat.io.
Browse files Browse the repository at this point in the history
Whenever a token expires a new token is requested.
The 404 sync problem was triggered because the accept headers that
were passed originally with the expired token were not passed to the
re-newed token. As a result the registry was redirecting to the wrong
schema version (schema1, which is unsupported since july 2022
https://access.redhat.com/articles/6138332) because of absense of the
accept headers.

closes #974
  • Loading branch information
ipanova committed Aug 22, 2022
1 parent 09b5b4f commit 16e104f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/974.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed an HTTP 404 response during sync from registry.redhat.io.
4 changes: 2 additions & 2 deletions pulp_container/app/downloaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ async def _run(self, handle_401=True, extra_data=None):

self.registry_auth["bearer"] = None
await self.update_token(response_auth_header, this_token, repo_name)
return await self._run(handle_401=False)
return await self._run(handle_401=False, extra_data=extra_data)
elif "Basic" in response_auth_header:
if self.remote.username:
basic = aiohttp.BasicAuth(self.remote.username, self.remote.password)
self.registry_auth["basic"] = basic.encode()
return await self._run(handle_401=False)
return await self._run(handle_401=False, extra_data=extra_data)
else:
raise
to_return = await self._handle_response(response)
Expand Down

0 comments on commit 16e104f

Please sign in to comment.