Bug 2208535

Summary: Prevent regenerating metadata for repositories that use complete mirroring
Product: Red Hat Satellite Reporter: Jeremy Lenz <jlenz>
Component: RepositoriesAssignee: Samir Jha <sajha>
Status: CLOSED ERRATA QA Contact: Partha Aji <paji>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.12.0CC: iballou, paji, pcreech, rlavi, sajha
Target Milestone: 6.14.0Keywords: 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: 2023-11-08 14:19:23 UTC 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 Jeremy Lenz 2023-05-19 12:56:55 UTC
Description of problem:

See discussion in https://bugzilla.redhat.com/show_bug.cgi?id=2184278

Regenerating repository metadata is dangerous for repositories that use the 'mirror_complete' mirroring policy because it will generate metadata locally, which means your repository is no longer completely mirrored.

The previous BZ addresses this in the web UI. However, you can still regenerate repository metadata for 'mirror_complete' repositories using the API or Hammer. We need to harden the backend code to

1. Refuse to do this for repositories that use complete mirroring
2. When regenerating metadata for CV version repositories, skip repos that use complete mirroring.

Comment 4 Samir Jha 2023-05-30 14:10:12 UTC
Created redmine issue https://projects.theforeman.org/issues/36453 from this bug

Comment 6 Bryan Kearney 2023-06-09 00:03:19 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36453 has been resolved.

Comment 7 Partha Aji 2023-07-03 20:27:19 UTC
Created and synced 2 repositories one with complete_mirror policy and the other with content_only policy
# hammer  repository republish --id=1 --force=1
Could not republish the repository.:
  Metadata republishing is not allowed on repositories with the 'Complete Mirroring' mirroring policy.

# hammer  repository republish --id=3 --force=1
[....................................................................................................................................................................] [100%]

Verified that the force parameter has been deprecated 
# hammer  repository republish --id=1 --help
Usage:
    hammer repository republish [OPTIONS]

Options:
....
 --force BOOLEAN                  Force metadata regeneration to proceed. (Deprecated)
 ....

Added both repositories to a content view and published. 
Followed that with
hammer  content-view version  republish --id=6
[....................................................................................................................................................................] [100%]

Noticed the content only repo's metadata got re-generated and the complete mirror one was ignored.

Comment 10 errata-xmlrpc 2023-11-08 14:19:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.14 security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:6818