Bug 2213911
| Summary: | Source RPMs showing up as a regular package on custom repository. | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Anand Kulkarni <ankulkar> |
| Component: | Repositories | Assignee: | satellite6-bugs <satellite6-bugs> |
| Status: | NEW --- | QA Contact: | Satellite QE Team <sat-qe-bz-list> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.11.5 | CC: | casl, dalley, hyu, iballou |
| Target Milestone: | Unspecified | Keywords: | Triaged |
| Target Release: | Unused | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | Bug | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Anand Kulkarni
2023-06-09 21:01:21 UTC
We need to check why the SRPMs are being indexed as RPMs. It's likely that the Pulp API is returning them as such, but why? I'm not going to put this on the Pulp component yet since we should confirm whether or not the issue is coming from the Pulp API first. From Pulp's perspective a source RPM package is just an normal package with a "arch" of "src". So for Katello to be indexing them that way does sound correct, it should just be filtering by `arch` when displaying packages that are or are not source packages specifically. Note please, that calling `Katello::Repository.find(REPOID).index_content` corrects the counts. (In reply to Daniel Alley from comment #4) > From Pulp's perspective a source RPM package is just an normal package with > a "arch" of "src". So for Katello to be indexing them that way does sound > correct, it should just be filtering by `arch` when displaying packages that > are or are not source packages specifically. The katello upload file api expects a "content_type" param to be provided. If the param is not provided, it will just detect whatever the default content type of the target repository (in this case the rpm). # lib/actions/katello/repository/upload_files.rb ~~~ content_type ||= ::Katello::RepositoryTypeManager.find(repository.content_type).default_managed_content_type.label <================ ~~~ # lib/actions/katello/repository/filtered_index_content.rb ~~~ elsif repo.yum? if input[:import_upload_task] && input[:import_upload_task][:content_unit_href] unit_ids = [input[:import_upload_task][:content_unit_href]] elsif input[:upload_actions]&.any? { |action| action.try(:[], "content_unit_href") } uploaded_content_unit_hrefs = [] input[:upload_actions].each { |action| uploaded_content_unit_hrefs << action.try(:[], "content_unit_href") } unit_ids = uploaded_content_unit_hrefs.compact else unit_ids = search_units(repo) end if input[:content_type] == ::Katello::Srpm::CONTENT_TYPE ::Katello::Srpm.import_all(unit_ids, repo, {filtered_indexing: true}) else ::Katello::Rpm.import_all(unit_ids, repo, {filtered_indexing: true}) <======================= This is called in "FilteredIndexContent" action end end ~~~ The "Katello::Repository.find(repo_id).index_content" method does detect the "src" in the arch field and import the rpm and srpm correctly without issue. |