Actions
Issue #2544
closedcopy always matches every unit in the repo
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version - OSTree:
1.2.0
Platform Release:
2.12.2
Target Release - OSTree:
OS:
Fedora 25
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
Sprint 15
Quarter:
Description
When doing a copy from one ostree repo to another, all units in the repo get copied, no matter what filters were supplied.
The bug is here: https://github.com/pulp/pulp_ostree/blob/24729931bc5c49578e9a11c883a0e95409b23c96/plugins/pulp_ostree/plugins/importers/web.py#L141
It should use the iterable of "units" if provided.
How to reproduce:
pulp-admin ostree repo create --repo-id=f25 --feed=https://kojipkgs.fedoraproject.org/atomic/25/
pulp-admin ostree repo sync run --repo-id=f25
pulp-admin ostree repo search --repo-id=f25
Note that there are two units. I can do a query that matches just one of them:
pulp-admin ostree repo search --repo-id=f25 --str-eq='branch=fedora-atomic/25/x86_64/testing/docker-host'
Now let's create a new repo, and try to copy that one branch using the same filter.
$ pulp-admin ostree repo create --repo-id=f25-test
Repository [f25-test] successfully created
$ pulp-admin ostree repo copy -f f25 -t f25-test --str-eq='branch=fedora-atomic/25/x86_64/testing/docker-host'
This command may be exited via ctrl+c without affecting the request.
[\]
Running...
Copied:
remote_id:d9680ea424e704ad20d57011c054adb7e3f4ad43f8849c0e1eb9efd4f0ba9bf1
branch:fedora-atomic/25/x86_64/docker-host
commit:27b1ae24686697235c35b793b5c8ab0822b8427e892d3659f0cb300c400979fa
remote_id:d9680ea424e704ad20d57011c054adb7e3f4ad43f8849c0e1eb9efd4f0ba9bf1
branch:fedora-atomic/25/x86_64/testing/docker-host
commit:35c51948ffdc01c7f235796efcd2b34c7d14b3f1feb417a2ce849ecf2ec13bb2
Notice that it copied both branches. It should have only copied the one matching the filter.
Actions
Fix unit copy. closes #2544