Uploaded image for project: 'RHEL Conversions'
  1. RHEL Conversions
  2. RHELC-884

Disable RHEL repos when performing checks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • 2.0.0
    • None
    • None
    • 2023-Q1, 1.4 GA, 2023-Q2, 2023-R4, 2024-R2
    • Testable

      The checks convert2rhel performs don't expect the system to have RHEL repos enabled on the system.

      This can happen for instance if a customer:

      • defines custom RHEL repos in /etc/yum.repos.d/ and does not specify enabled=0
      • uses a single Satellite activation key that enables both original vendor and RHEL repos available

      For example when checking whether the system has the latest kernel installed we expect the original OS vendor repos to be enabled (CentOS, Oracle, ..) and if RHEL repos are enabled convert2rhel might provide misleading suggestions about what kernel the customer shall install prior to the conversion. On OL7.9 with the latest updates and with having the rhel-7-server-rpms repo enabled, this critical-level error message appears:

      SystemExit: The version of the loaded kernel is different from the latest version in the enabled system repositories.
       Latest kernel version available in rhel-7-server-rpms: 3.10.0-1160.83.1.el7
       Loaded kernel version: 3.10.0-1160.83.1.0.1.el7
      
      To proceed with the conversion, update the kernel version by executing the following step:
      
      1. yum install kernel-3.10.0-1160.83.1.el7 -y
      2. reboot 

      The conversion is inhibited when the loaded OL7 kernel-3.10.0-1160.83.1.0.1.el7 is newer than the kernel-3.10.0-1160.83.1.el7 available in the enabled RHEL 7 repo.

      Reproducer:

      1. Install kernel (3.10.0-1160.83.1.0.1.el7) from the Oracle Linux 7 official repository
      2. Set the default kernel to above mentioned and reboot to it
      3. EnableĀ ONLY the Red Hat repository (rhel-7-server-rpms)
      4. Run convert2rhel and observe the error

      Acceptance criteria:

      • To ensure that all checks convert2rhel performs will ignore RHEL repositories that are enabled on the system at the time of executing convert2rhel:
        • convert2rhel disables repos named "rhel-*" (Reason: all repoids of RHEL repositories provided by Red Hat start with rhel-, e.g. rhel-7-server-rpms or rhel-8-for-x86_64-baseos-rpms)
        • convert2rhel disables repos passed through the --enablerepo at the beginning of its execution
      • Then we look at all the enabled repos on the system and check the signature of any package from each repo to make sure there's no package signed by Red Hat. If we detect a Red Hat package in any of the enabled repos we disable the repo and print a warning to the user that we've done so.
        • [Michal] I've removed this step as it's not easy to implement and it's not straightforward how to approach it ("what package to query from each repo?"). It solves a low-probability corner case where the customer has defined and enabled a RHEL repo with a non-default repoid in /etc/yum.repos.d/ AND they don't specify this RHEL repoid in the --enablerepo convert2rhel cli option. For that reason it's IMHO not worth the effort and we can implement it only if a customer reports bumping into this.
      • We have an integration test that makes sure that the conversion succeeds even with RHEL repos enabled.

            ahosek@redhat.com Adam Hosek
            mbocek@redhat.com Michal Bocek
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: