Skip to content

image/docker: use unified configfile for registries.d#753

Open
jankaluza wants to merge 12 commits intocontainers:mainfrom
jankaluza:registries.d-2
Open

image/docker: use unified configfile for registries.d#753
jankaluza wants to merge 12 commits intocontainers:mainfrom
jankaluza:registries.d-2

Conversation

@jankaluza
Copy link
Copy Markdown
Member

Switch registries.d loading to use configfile.Read(), enabling
unified drop-in search across /usr, /etc, and user config directories.
Files are merged with standard precedence, with higher-priority paths
masking lower ones.

Preserve explicit RegistriesDirPath override behavior.

Signed-off-by: Jan Kaluza jkaluza@redhat.com

jankaluza added 12 commits April 2, 2026 13:06
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
When no policy.json is found, `DefaultPolicy()`` previously returned a
generic error without indicating where the system looked for the file.

This commit introduces `configfile.ReadWithPaths()` to track all
attempted config file locations during iteration. It uses this
in DefaultPolicy() to include the searched paths in the error message
when no policy file is found.

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
This commit does the following:

- The `setup()` function now returns the SystemContext.
- The hardcoded check for "no policy file found" has moved to
  the test itself.
- Fixture is used for SignaturePolicyPath.

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
This commit introduces `File.ErrorIfNotFound`. If it is true, the Read
returns an error which contains all the paths it tried when searching
for a config file.

The ReadWithPaths is replaced by this new logic.

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
Switch registries.d loading to use `configfile.Read()`, enabling
unified drop-in search across /usr, /etc, and user config directories.
Files are merged with standard precedence, with higher-priority paths
masking lower ones.

Preserve explicit RegistriesDirPath override behavior.

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
@github-actions github-actions bot added storage Related to "storage" package common Related to "common" package image Related to "image" package labels Apr 9, 2026
@jankaluza
Copy link
Copy Markdown
Member Author

jankaluza commented Apr 9, 2026

This depends on #711. If someone wants to review this early, check only the last commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to "common" package image Related to "image" package storage Related to "storage" package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant