[Pulp-dev] problems with docker tags

Dennis Kliban dkliban at redhat.com
Thu Mar 8 19:48:28 UTC 2018

I am responding on the list because this seems like a problem that other
plugins will also face.

It seems like there are 2 possible solutions here.

1) pulp_docker could provide a custom REST api endpoint that will provide
'tagging' functionality. This API would perform all the validation needed
and then create a new repository version with all the proper tags.

2) pulpcore's v3/repositories/1234/versions/  endpoint could provide a way
for plugins to provide custom behavior.

I have advocated for 2 in the past  and I continue to believe that the
repository versions API should take an 'action' or 'operation' parameter
that would map to some functionality provided by a plugin.

On Tue, Mar 6, 2018 at 4:03 PM, Austin Macdonald <austin at redhat.com> wrote:

> Concept:
> ContentUnits are created with a POST request to /v3/content/<type>/.
> Adding the Tag to a Repository is a separate call. This workflow is awkward
> for Tags because we would need to set the "repository" field on the Tag in
> the first call, and actually add it to the repository in a second call. The
> first call won't have enough information to enforce the uniqueness
> constraints due to repository versions. The second call won't work either,
> because adding content units to a repository is strictly a pulpcore
> endpoint, and does not offer plugins the ability to enforce uniqueness
> constraints. In Pulp 2, we enforced "only 1 tag of name X, type Y,
> repository Z" with unique together, but this cannot work anymore because of
> RepositoryVersions, because Tags created for old RepositoryVersions still
> exist after they are removed from a later version.
> Example:
> We have a Repository, myrepo, and 2 manifests, m1 and m2. We put m1 in
> myrepo.
> myrepov1 = [m1]
> Then we create a tag t1 = Tag("latest", m1, myrepo) and we add it to
> myrepo.
> myrepov2 = [m1, t1]
> Then we add m2 to myrepo.
> myrepov3 = [m1, t1, m2]
> Then it gets interesting. Can we create t2 = Tag("latest", m2, myrepo)?
> We can remove t1 from myrepo, (but we have to leave the tag unchanged to
> preserve old repo versions), which means that yes, t2 is a valid tag.
> Now we have a problem. Without removing t1, we can add t2 to myrepo, and
> the docker plugin is powerless to stop it because the endpoint
> v3/repositories/1234/versions/ does not involve plugins. We don't have the
> ability to validate uniqueness within a repository.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-dev/attachments/20180308/1b65e856/attachment.htm>

More information about the Pulp-dev mailing list