Conservatively use Index* + Delete to delete the
first element where it's not obvious that the code would really
want to delete all instances.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
ignore EINVAL for unmount in the cleanup function as it means the
directory is not a mount point. It can happen if the cleanup happens
before the mount point is created.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
xref https://github.com/containers/storage/pull/2065#issuecomment-2313002081
This does the same for the man page that I did for the default
storage.conf previously; instead of trying to squash all the
`pull_options` into a single option that we document "ad-hoc", make
it its own table just like the other sections.
- Add notes about "string bools" around relevant values.
- Avoid redundantly specifying the default; the default is the first
thing we show after the `=`.
Synchronize the text between the man page and the default
`storage.conf`.
Signed-off-by: Colin Walters <walters@verbum.org>
The previous attempt worked with 'podman image load' but not 'podman
image save' since the error returned from Lexists for non-existent files
was not recognized by os.IsNotExist. This version returns well-formed
errors for non-existent files and works with both 'podman image load'
and 'podman image save'.
Signed-off-by: Doug Rabson <dfr@rabson.org>
The faccessat system call does not support AT_SYMLINK_NOFOLLOW on
FreeBSD versions before 15.0. This works around the limitation by
falling back to os.Lstat if faccessat returns an EINVAL error.
Signed-off-by: Doug Rabson <dfr@rabson.org>
use MkdirAllAndChownNew instead of checking for the directory
existence first and then create it if missing.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
move the check for a previously mounted "merged" directory before
attempting any composefs mount.
It prevents mounting the composefs blobs to then throw them away as it
reuses the already existing mounted path when possible.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
The default storage.conf we ship is inconsistent in a few ways;
there's a lot of fixes rolled up into this single commit.
First: we were using a toml "inline table" for the pull options,
and then documenting each key in that table in one blob above.
It simply looks much nicer to use a non-inline table - then
we can move the docs next to each individual value. This is also
more consistent with other sections of the config.
I also thinned out a bit the doc comments; I think instead of trying
to have a longer explanation of zstd:chunked in the comments here
we should refer to the man page, which is a better place to have
details (and that we should fill out more).
Per another PR, I also stumbled across the fact that we have a
lot of "string bool" values and cannot be native TOML booleans. Document
that clearly next to each type.
We already have default values in the *code* for all
of these, so comment them all out to be consistent with other
values. (We're then getting closer to having the config file
be entirely comments, but that's a distinct project)
Finally, update the recent man pages I added to match
these changes.
Signed-off-by: Colin Walters <walters@verbum.org>