RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1977280 - registries.conf mixes v1 and v2 syntax
Summary: registries.conf mixes v1 and v2 syntax
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: skopeo
Version: 8.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: beta
: ---
Assignee: Jindrich Novy
QA Contact: Yuhui Jiang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-29 11:34 UTC by Valentin Rothberg
Modified: 2021-11-09 19:44 UTC (History)
12 users (show)

Fixed In Version: skopeo-1.4.0-5.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 17:38:44 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Updated/fixed registries.conf (3.76 KB, text/plain)
2021-06-29 11:34 UTC, Valentin Rothberg
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:4154 0 None None None 2021-11-09 17:39:21 UTC

Description Valentin Rothberg 2021-06-29 11:34:50 UTC
Created attachment 1795755 [details]
Updated/fixed registries.conf

Description of problem:

/etc/containers/registries.conf mixes the v1 and v2 notation, namely:

----------
# OLD v1 notation
[registries.search]
registries = ['registry.access.redhat.com', 'registry.redhat.io', 'docker.io']

# NEW v2 notation
unqualified-search-registries = ["registry.fedoraproject.org", "registry.access.redhat.com", "registry.centos.org", "docker.io"]
----------


Mixing the v1 and v2 notation is unsupported and should yield an error when being loaded.  Ultimately, it points to a bug in the containers/image library which we should not fix now since it would break with the shipped registries.conf.

Note that only [registries.search] gets loaded; unqualified-search-registries will be ignored.  But that is quite unclear when purely looking at this file.

I assume that this mix-up happened when reducing the number of search registries.

What we should do:
- Update /etc/containers/registries.conf and remove all references to the v1 notation and update the `unqualified-search-registries` with the proper set of registries. I uploaded a file how I think registries.conf should look like.


Version-Release number of selected component (if applicable):

[root@kvm-01-guest13 ~]# dnf info containers-common
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 0:41:39 ago on Tue 29 Jun 2021 01:50:39 PM IDT.
Installed Packages
Name         : containers-common
Epoch        : 1
Version      : 1.2.2
Release      : 4.module+el8.5.0+10387+8d85dbaf
Architecture : x86_64
Size         : 299 k
Source       : skopeo-1.2.2-4.module+el8.5.0+10387+8d85dbaf.src.rpm
Repository   : @System
From repo    : beaker-AppStream
Summary      : Configuration files for working with image signatures
URL          : %{git0}
License      : ASL 2.0
Description  : This package installs a default signature store configuration and a default
             : policy under `/etc/containers/`.


How reproducible:

Always.  Also reproduced on RHEL 9 beta.

Steps to Reproduce:
1. dnf install podman; cat /etc/containers/registries.conf


Additional info:

I added a registries.conf file with the appropriate fixes.  Please include Miloslav and/or me when updating the packages, so we can have a final look.

Comment 1 Miloslav Trmač 2021-06-29 12:59:52 UTC
This is rejected:

> unqualified-search-registries = ["registry.fedoraproject.org", "registry.access.redhat.com", "registry.centos.org", "docker.io"]
> [registries.search]
> registries = ['registry.access.redhat.com', 'registry.redhat.io', 'docker.io']

while this is accepted:
> [registries.search]
> registries = ['registry.access.redhat.com', 'registry.redhat.io', 'docker.io']
> unqualified-search-registries = ["registry.fedoraproject.org", "registry.access.redhat.com", "registry.centos.org", "docker.io"]

and like this, without comments, it’s easier to see what is going on: the second version defines, in TOML, a field registries.search.unqualified-search-registries, not the v2 top-level unqualified-search-registries field.

---

So this is, in some sense, not a bug in the config file parser, OTOH it seems quite desirable to reject such configs as a special case.

Comment 2 Valentin Rothberg 2021-06-30 13:51:19 UTC
Assigning to Jindrich, since it must be fixed in the downstream registries.conf.

Comment 3 Jindrich Novy 2021-07-01 10:41:01 UTC
Can we get qa ack please?

Comment 5 Valentin Rothberg 2021-08-04 14:15:11 UTC
@Jindrich, looks good to me. Thanks for the ping!

I have a slight preference to move `short-name-mode = "enforcing"` up to line 23, maybe with a blank line in before.  It looks a bit hidden down there but it does the job.

Comment 6 Jindrich Novy 2021-08-04 14:30:13 UTC
Thanks Valentin. It's actually a good catch as we need enforcing for short-name-mode in RHEL9+ only and not in 8.5? If so I actually need to drop this...

FYI - for RHEL9 I'm using this: http://pkgs.devel.redhat.com/cgit/rpms/skopeo/tree/update.sh?h=stream-container-tools-latest-rhel-9.0.0-beta#n27 which tests if there is "# short-name-mode" within the config and if so, it will put the "short-name-mode = enforcing" straight after it.

Comment 7 Valentin Rothberg 2021-08-04 14:47:13 UTC
(In reply to Jindrich Novy from comment #6)
> Thanks Valentin. It's actually a good catch as we need enforcing for
> short-name-mode in RHEL9+ only and not in 8.5? If so I actually need to drop
> this...

Good catch. Yes, no enforcing in 8.5 since it would be a breaking change.

Comment 15 errata-xmlrpc 2021-11-09 17:38:44 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 (Moderate: container-tools:rhel8 security, bug fix, and enhancement 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-2021:4154


Note You need to log in before you can comment on or make changes to this bug.