Skip to content

storage: fix drop-in config order and windows special case#826

Open
Luap99 wants to merge 3 commits intocontainers:mainfrom
Luap99:config-order
Open

storage: fix drop-in config order and windows special case#826
Luap99 wants to merge 3 commits intocontainers:mainfrom
Luap99:config-order

Conversation

@Luap99
Copy link
Copy Markdown
Member

@Luap99 Luap99 commented May 6, 2026

see commits

Luap99 added 3 commits May 6, 2026 15:25
On windows the uid will always be reported as -1 as there is no uid
concept. As such using the special root/rootless paths make no sense
there so lets just not add them to the search paths to begin with.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
When have the same filename in the per $UID rootless directory than that
should have higher priority over the same filename in the general
rootless directory and that also should be higher than the main conf.d
location.

This is how it used to be before I switch the logic accidentally in
commit 046e21b ("storage: add GetSearchPaths() to pkg/configfile").

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
The docs uses a slightly incorrect order, it makes a difference if we
start with the per user location or the /usr one for the special
drop-in directories like containers.rootless.conf.d/$UID and just
containers.rootless.conf.d/.

So ensure the registries.conf and containers.conf and certs.d pages are
actually correct now.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@Luap99 Luap99 changed the title storage: fix drop-in config order and windows speical case storage: fix drop-in config order and windows special case May 6, 2026
@github-actions github-actions Bot added storage Related to "storage" package common Related to "common" package image Related to "image" package labels May 6, 2026
@Luap99
Copy link
Copy Markdown
Member Author

Luap99 commented May 6, 2026

cc @mtrmac @jankaluza

@Luap99 Luap99 added the podman 6 breaking changes that should go only into podman 6 only label May 6, 2026
Copy link
Copy Markdown
Contributor

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

LGTM otherwise, OK to merge without another review round.

specialName = "rootful"
}
// insert the name after the main config name but before the extension if it has one.
mainPath, cut := strings.CutSuffix(mainPath, suffix)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the reordering, this shadows the mainPath variable outside the if. It does work correctly but it looks a bit confusing / risky.

Maybe something like prefix or specialPrefix?

Comment on lines 60 to 73
{
name: "storage.conf",
mainPath: "/usr/share/containers/storage.conf",
suffix: ".conf",
uid: 0,
want: []string{"/usr/share/containers/storage.conf.d", "/usr/share/containers/storage.rootful.conf.d"},
want: []string{"/usr/share/containers/storage.rootful.conf.d", "/usr/share/containers/storage.conf.d"},
},
{
name: "storage.conf",
mainPath: "/usr/share/containers/storage.conf",
suffix: ".conf",
uid: 0,
want: []string{"/usr/share/containers/storage.conf.d", "/usr/share/containers/storage.rootful.conf.d"},
want: []string{"/usr/share/containers/storage.rootful.conf.d", "/usr/share/containers/storage.conf.d"},
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Absolutely non-blocking: Unrelated and pre-existing, these entries are exactly identical.)

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 podman 6 breaking changes that should go only into podman 6 only storage Related to "storage" package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants