Currently if a user puts a typo into a storage.conf
or puts the keys in the wrong section, then tools using
container/storage ignore them. This patch will print them
as warnings, so that the user has some idea what is going on.
Signed-off-by: Daniel J Walsh <dwalsh@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 in Podman if we reset the CONTAINERS_STORAGE_CONF path, we get
the graph driver options from the original config file as well as the
options from the override path. This PR resets the storageconf to the
initial state when called multiple times.
Also if user sets STORAGE_OPTS="" then we should use it to override all
other storage options.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
The storage driver set in `/etc/containers/storage.conf` was ignored for rootless configurations.
Rootless configurations would use overlay or vfs by default.
If the STORAGE_DRIVER environment was variable set, this value would be used instead.
This commit changes this behavior to inherit the driver set in `/etc/containers/storage.conf`.
To inherit the driver in rootless configurations, the driver must be valid in a rootless context.
The valid rootless drivers are btrfs, overlay, and vfs at this time.
To remain consistent with previous behavior, the STORAGE_DRIVER environment variable supersedes any driver set in `/etc/containers/storage.conf` and does not need to be a valid rootless driver.
buildah's documentation for the `--storage-driver` command will need to be updated to reflect these changes.
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>