pulp / pulpcore

Pulp 3 pulpcore package https://pypi.org/project/pulpcore/
GNU General Public License v2.0
308 stars 116 forks source link

Provide a better abstraction for customizing downloader behavior #1927

Open pulpbot opened 2 years ago

pulpbot commented 2 years ago

Author: @dralley (dalley)

Redmine Issue: 7352, https://pulp.plan.io/issues/7352


Customization of downloader behavior is currently achieved by subclassing one of the downloader types from the Plugin API and then modifying the get_downloader() method and downloader_factory property on the Remote (sub)class.

A limitation of this abstraction is that while the get_downloader() method accepts **kwargs to pass down to the (possibly customized) downloader, it will pass all kwargs to any downloader without discriminating by the type of downloader. Therefore it's difficult to send a kwarg to be used on a customized HTTP downloader without it being also sent to other types of downloaders such as FileDownloader which are not expecting it.

This could be worked around by additionally modifying the DownloaderFactory, but it's currently suboptimal because:

We could probably benefit from revisiting the design and incorporate some of our experience with customizing downloader behavior in various plugins.

pulpbot commented 2 years ago

From: @dkliban (dkliban@redhat.com) Date: 2021-01-14T15:03:24Z


We will not get to this in the near future.

stale[bot] commented 2 years ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

stale[bot] commented 2 years ago

This issue is no longer marked for closure.