Issue #7284
closedRPM Copy API copies all content when config content is []
Description
In my Katello code, I empty out a Pulp 3 repo and then call the RPM copy API to copy content back into it. I had one situation where the content to be copied back into the repo was empty because everything was filtered out. The result was that all the repo's content was copied from the source repo version to the destination repo. More details below:
data2 = PulpRpmClient::Copy.new
data2.config = [{:source_repo_version=>"/pulp/api/v3/repositories/rpm/rpm/9f5d9709-bf3c-4d6a-90de-98d239769919/versions/1/", :dest_repo=>"/pulp/api/v3/repositories/rpm/rpm/859d5b2d-bf70-4208-9580-662d97488ad1/", :content=>[]}]
data2.dependency_solving = false
api.copy_api.copy_content(data2)
Original repo version, emptied out:
data2 = PulpRpmClient::Copy.new
data2.config = [{:source_repo_version=>"/pulp/api/v3/repositories/rpm/rpm/9f5d9709-bf3c-4d6a-90de-98d239769919/versions/1/", :dest_repo=>"/pulp/api/v3/repositories/rpm/rpm/859d5b2d-bf70-4208-9580-662d97488ad1/", :content=>[]}]
data2.dependency_solving = false
Repo version after the empty copy call:
Version after empty copy:
{
"pulp_href": "/pulp/api/v3/repositories/rpm/rpm/859d5b2d-bf70-4208-9580-662d97488ad1/versions/3/",
"pulp_created": "2020-08-05T23:19:08.130503Z",
"number": 3,
"base_version": null,
"content_summary": {
"added": {
"rpm.package": {
"count": 2,
"href": "/pulp/api/v3/content/rpm/packages/?repository_version_added=/pulp/api/v3/repositories/rpm/rpm/859d5b2d-bf70-4208-9580-662d97488ad1/versions/3/"
}
},
"removed": {},
"present": {
"rpm.package": {
"count": 2,
"href": "/pulp/api/v3/content/rpm/packages/?repository_version=/pulp/api/v3/repositories/rpm/rpm/859d5b2d-bf70-4208-9580-662d97488ad1/versions/3/"
}
}
}
}
Is this intentional? I'm assuming not, since if I need to do dep solving I will need those other repositories to be present in the data config section.
Tested on pulp-rpm 3.4.1 and 3.5.0.
Updated by ttereshc over 4 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 78
Updated by ggainey over 4 years ago
Possible patch to solve the problem: https://gist.github.com/daviddavis/9d2b950746b44e23e2a91e232d5e9bb4
Updated by pulpbot about 4 years ago
- Status changed from NEW to POST
Added by ggainey about 4 years ago
Updated by ggainey about 4 years ago
- Status changed from POST to MODIFIED
Applied in changeset 98a5d449269e8fd924811a27830fbe78ac0d1d0a.
Added by ggainey about 4 years ago
Revision 530485e2 | View on GitHub
Fixed copy to check for empty-content correctly.
Added test_copy_none to suite of copy-tests.
fixes #7284 [nocoverage]
(cherry picked from commit 98a5d449269e8fd924811a27830fbe78ac0d1d0a)
Updated by pulpbot about 4 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Fixed copy to check for empty-content correctly.
Added test_copy_none to suite of copy-tests.
fixes #7284 [nocoverage]