This fixes the following linter warning:
> types/utils.go:17:9: QF1004: could use strings.ReplaceAll instead (staticcheck)
> path = strings.Replace(path, "$UID", strconv.Itoa(rootlessUID), -1)
> ^
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
drop the rootless argument from DefaultStoreOptions and
UpdateStoreOptions since this can be retrieved internally through the
unshare package.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
gofumpt is a superset of gofmt, enabling some more code formatting
rules.
This commit is brought to you by
gofumpt -w .
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
when running in rootful mode, if it is present, prefer the override path
/etc/containers/storage.conf instead of using the default storage.conf
provided by the package under the /usr/share/containers/ directory.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
We now use the golang error wrapping format specifier `%w` instead of the
deprecated github.com/pkg/errors package.
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
CONTAINERS_STORAGE_CONF env var should overwrite the default path even
for the first config load at init time.
Fixescontainers/podman#14267
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Now expandEnvPath always fallbacks to filepath.Clean() when
filepath.EvalSymlinks() fails.
commit b4477c7a8b introduced the
regression.
This is useful in a user namespace when the permissions for the
storage path are not yet tweaked to allow access for all users.
Reported by: https://github.com/containers/buildah/pull/3450
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Other parts of the code are using this directory, so we end up
with us creating an empty directory.
I don't see a reason why we would just use this directory only if
the init program is systemd?
Fixes: https://github.com/containers/podman/issues/10782
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
The current code was hanging for me, this makes sure the path is
expanded properly when it is read.
Fixes: https://github.com/containers/podman/issues/10181
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Currently when we build podman bindings we are pulling in the entire
storage libraries, even though we only need a few structures and
functions.
Testing with the following program
```
package main
import (
"fmt"
"github.com/containers/storage/types"
)
func main() {
fmt.Println(types.GetRootlessRuntimeDir(0))
}
```
Removing types above gives me compile size of the the program
du -s t.old t.new
9640 t.before
3232 t.after
Currently these functions are being vendored into
containers/common/pkg/config, which leads to large size in podman-remote
and podman bindings.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>