Skip to content

image: Skip creating lock file if short-name-aliases.conf is missing - #969

Open
Lekensteyn wants to merge 1 commit into
podman-container-tools:mainfrom
Lekensteyn:skip-short-name-lock-ro
Open

image: Skip creating lock file if short-name-aliases.conf is missing#969
Lekensteyn wants to merge 1 commit into
podman-container-tools:mainfrom
Lekensteyn:skip-short-name-lock-ro

Conversation

@Lekensteyn

@Lekensteyn Lekensteyn commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

The lock file ~/.cache/containers/short-name-aliases.conf.lock used to be created in all cases, even for read-only attempts for a non-existing ~/.cache/containers/short-name-aliases.conf file. Do not create this file unless necessary, this keeps the home directory a bit cleaner.

Link: podman-container-tools/podman#27921

@mtrmac mtrmac left a comment

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.

Thanks!

I’m pretty unconvinced this makes much of a difference ultimately — Podman must have writable storage for mount counting and locks, after all — but if it can be done cleanly, why not.

Comment thread image/pkg/sysregistriesv2/shortnames.go Outdated
Comment thread image/pkg/sysregistriesv2/shortnames_test.go Outdated
Comment thread image/pkg/sysregistriesv2/shortnames_test.go Outdated
@Lekensteyn
Lekensteyn force-pushed the skip-short-name-lock-ro branch from bb9be0c to 6c5fc25 Compare July 8, 2026 22:30
@Lekensteyn

Copy link
Copy Markdown
Contributor Author

I’m pretty unconvinced this makes much of a difference ultimately — Podman must have writable storage for mount counting and locks, after all — but if it can be done cleanly, why not.

Thanks for the review! I should've addressed all comments.

Yes, writeable storage is required, here I just try to remove unnecessary writes and new directories that would have been empty otherwise.

Comment thread image/pkg/sysregistriesv2/shortnames.go Outdated
Comment thread image/pkg/sysregistriesv2/shortnames.go Outdated
Comment thread image/pkg/sysregistriesv2/shortnames.go Outdated
The lock file `~/.cache/containers/short-name-aliases.conf.lock` used to
be created in all cases, even for read-only attempts for a non-existing
`~/.cache/containers/short-name-aliases.conf` file. Do not create this
file unless necessary, this keeps the home directory a bit cleaner.

Link: podman-container-tools/podman#27921
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
@Lekensteyn
Lekensteyn force-pushed the skip-short-name-lock-ro branch from 6c5fc25 to 314548e Compare July 9, 2026 20:54
@Lekensteyn

Copy link
Copy Markdown
Contributor Author

All comments have been addressed, is there anything else you'd like me to address @mtrmac?

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

Labels

image Related to "image" package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants