Issue #4437
closedCannot adapt BaseUrl when serving Content at a custom URL using a custom aiohttp handler
Description
Problem¶
Assume that A plugin writer is adding custom routes to serve their content. They likely require this because they need more control when serving an Artifact, e.g. response headers. When their Distribution serializes the base_path it will serve all Pulp content at /pulp/content/. This is correct for most Content, but not for this type which serves it at a custom route in the content app, e.g. /mycustomurl/.
The Distributor Serializer/Viewset is also not part of the plugin API which prevents the reuse of that serializer/viewset.
This was originally identified by gmbnomis in this comment
Solution¶
Make the Serializer and Viewset part of the plugin API
Updated by bmbouter almost 6 years ago
- Tags Pulp 3 RC Blocker added
I believe this will produce an API change so I believe it needs to be done before the RC.
Updated by bmbouter almost 6 years ago
gmbnomis the docker team told me they subclassed the Distribution object and implemented a different serializer for the BaseURL.
Updated by bmbouter almost 6 years ago
The DockerDistributionSerializer is here for examaple: https://github.com/pulp/pulp_docker/blob/master/pulp_docker/app/serializers.py#L199
DockerDistributionViewSet: https://github.com/pulp/pulp_docker/blob/master/pulp_docker/app/viewsets.py#L193-L205
Updated by bmbouter almost 6 years ago
gmbnomis do you want to go this subclassing route or try to reconfigure the URL on the BaseURL?
Updated by jortel@redhat.com almost 6 years ago
This seems to be the same as https://pulp.plan.io/issues/4391 but not enough detail written here to tell. Could someone add more detail to the description, please?
Updated by bmbouter almost 6 years ago
- Description updated (diff)
I rewrote this with more detail. It's different than https://pulp.plan.io/issues/4391 which deals with the serialization of base_path in the common case.
Updated by dkliban@redhat.com almost 6 years ago
- Status changed from NEW to ASSIGNED
Added by dkliban@redhat.com almost 6 years ago
Added by dkliban@redhat.com almost 6 years ago
Revision 753d49bf | View on GitHub
Problem: plugin code is not using new plugin API serializer
Solution: update the DockerDistribution serializer to use the BaseDistributionSerializer
re: #4435 https://pulp.plan.io/issues/4435 re: #4437 https://pulp.plan.io/issues/4437
Added by dkliban@redhat.com almost 6 years ago
Revision 753d49bf | View on GitHub
Problem: plugin code is not using new plugin API serializer
Solution: update the DockerDistribution serializer to use the BaseDistributionSerializer
re: #4435 https://pulp.plan.io/issues/4435 re: #4437 https://pulp.plan.io/issues/4437
Added by dkliban@redhat.com almost 6 years ago
Revision 753d49bf | View on GitHub
Problem: plugin code is not using new plugin API serializer
Solution: update the DockerDistribution serializer to use the BaseDistributionSerializer
re: #4435 https://pulp.plan.io/issues/4435 re: #4437 https://pulp.plan.io/issues/4437
Added by dkliban@redhat.com almost 6 years ago
Revision 753d49bf | View on GitHub
Problem: plugin code is not using new plugin API serializer
Solution: update the DockerDistribution serializer to use the BaseDistributionSerializer
re: #4435 https://pulp.plan.io/issues/4435 re: #4437 https://pulp.plan.io/issues/4437
Updated by dkliban@redhat.com almost 6 years ago
- Status changed from ASSIGNED to MODIFIED
- Assignee set to dkliban@redhat.com
Updated by bmbouter about 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Problem: DistributionSerializer is too prescriptive
Solution: Add a generic BaseDistributionSerializer
re: #4435 https://pulp.plan.io/issues/4435 re: #4437 https://pulp.plan.io/issues/4437