Conversation
dralley
left a comment
There was a problem hiding this comment.
It's quite annoying that you can't specify these parameters directly on the ClientSession.
| if not isinstance(downloader, HttpDownloader): | ||
| raise ValueError("Only HTTP(S) is supported for python syncing") | ||
|
|
||
| async with Master(url) as master: |
There was a problem hiding this comment.
It seems like Bandersnatch Master() has a proxy option you can pass in, but no auth. I assume auth isn't terribly relevant in the ecosystem especially given the primary purpose is just mirroring PyPI.
There was a problem hiding this comment.
Yes, but it doesn't have proxy auth, so I think the partial patching is still the best way to go.
|
I just injected the updated sync.py into the Pulp worker container, and the packages are now being synced successfully. So the change has solved the issue. |
Backport to 3.13: 💚 backport PR created✅ Backport PR branch: Backported as #829 🤖 @patchback |
Fix proxy-sync regression (cherry picked from commit b051180)
…09dae9da8ebbd18c4b230c4fa789b4/pr-824 [PR #824/b051180d backport][3.13] Fix proxy-sync regression
Not sure how to properly test this. The big problem is that bandersnatch creates their own aiohttp session in order to download metadata and the packages. I thought by replacing their session with the remote's session (#750) we would get all of the remote's options by default, but I didn't realize that the auth & proxy settings are actually set at download time in the Downloader's
_runmethod (https://github.com/pulp/pulpcore/blob/main/pulpcore/download/http.py#L292-L294). This should fix the regression by patching thegetmethod that bandersnatch'sMasterclass uses to perform requests, but there is no way for me to test it with our current fixtures. Thehttp_proxyfixture doesn't give access to the proxy's request logs, just the data used to setup the proxy.