Commit Graph

13 Commits

Author SHA1 Message Date
Giuseppe Scrivano f64e1bd14a
store: prefer /etc/containers/storage.conf
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>
2023-01-17 11:02:23 +01:00
Miloslav Trmač f42467020f Misc. warning cleanups
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-01 02:53:06 +02:00
Miloslav Trmač 4b28197720 Use os.ReadFile instead of ioutil.ReadFile
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-09-12 16:30:43 +02:00
Sascha Grunert 3455d12729
Switch to golang native error wrapping
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>
2022-07-07 13:22:46 +02:00
Paul Holzinger 07530efd08
storage.conf: respect CONTAINERS_STORAGE_CONF env
CONTAINERS_STORAGE_CONF env var should overwrite the default path even
for the first config load at init time.

Fixes containers/podman#14267

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-06-01 16:23:55 +02:00
Daniel J Walsh 534b0b3281
Standardize on capatalized logrus messages, and remove stutters
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-23 14:43:35 -04:00
Giuseppe Scrivano 2c2968534e
types: on error fallback to filepath.Clean()
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>
2021-08-16 13:28:16 +02:00
Daniel J Walsh b4477c7a8b
Follow symlinks if they exists
Fixes: https://github.com/containers/podman/issues/10187

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-08-04 07:13:58 -04:00
Daniel J Walsh 728a92897f
Revert #952, we don't want to use /run/user on non systemd systems
This feature was originally added for  #568, and I mistakenly removed
it.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-07-12 14:00:58 -04:00
Daniel J Walsh 06e2dce12b
Use /run/user/UID in rootless mode if writable
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>
2021-06-25 08:53:40 -04:00
mla 74a61676d2 Added support for CONTAINERS_STORAGE_CONF override
Signed-off-by: Morten Larsen <mortenlarsens@gmail.com>
2021-06-09 10:17:09 +02:00
Daniel J Walsh 98384ff1ca
Expand Variables on rootlessStoragePath
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>
2021-05-05 13:49:51 -04:00
Daniel J Walsh 120cc997d2
Move storageOpts structures into types subdir to shrink bindings.
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>
2021-02-26 05:34:09 -05:00