Selectively disable cases that I cannot touch or don't bother spending
time on. Future cases will be avoided.
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
golangci-lint has a number of helpful linters and new ones are being
continuously added. Instead of enabling only a minimal subset of these
linters, enable all by default and - for now - disable failing ones.
This allows us to make use of new linters on updates and to selectively
enable those we deem useful.
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
When pulling from an OCI source, make sure to preseve the optional name.
For instance, a `podman pull oci:/tmp/foo:quay.io/foo/bar:latest` should
pull the image and name it `quay.io/foo/bar:latest`.
While at it, also fix a bug when pulling an OCI without the optional
name. Previously, we used the path to name the image which will error
in most cases due to invalid characters (e.g., capital ones). Hence,
apply the same trick as for the `dir` transport and generate a sha.
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
These structs are (for better or worse) a part of
Podman's API, so podman-remote needs to include the subpackage that
defines them - which is all of libimage (and c/image/v5/copy) right now.
Instead, move them to libimage/define.
Alternatively, maybe Podman's API should not directly depend on (unstable)
c/common types?!
Only moves unchanged code, should not change behavior.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Make sure to close all `ImageCloser` to avoid potential memory leaks.
Fixes: containers/common#1533
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Set the `EXTEND_TIMEOUT_USEC` over DBUS when pulling an image from a
registry and when running under systemd. This will prevent a frequent
issue when running Quadlets and exceeding the default systemd start
timeout of 90 seconds when pulling the image takes too long.
Fixes: containers/podman/issues/18353
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit restores the terminal state in case the program is
interrupted while being in password read mode. This ensures the terminal
remains usable, also if the password input is being cancelled.
Signed-off-by: phoenix <felix.niederwanger@suse.com>
This allows us to use a single jail for containers with networking since
CNI can initialise the network without needing a separate jail to own
the network namespace.
Signed-off-by: Doug Rabson <dfr@rabson.org>
port Commit 10d63bf089 (cgroups: use SessionBusPrivateNoAutoStartup)
from cgroups.go to cgroups_linux.go
do not start up a dbus daemon if it is not already running.
[NO NEW TESTS NEEDED] the fix is in a dependency.
Signed-off-by: Joni Korhonen <joni.korhonen@gmail.com>
To return absolute paths to modules a config was loaded with.
Knowing the modules is required for conmon's callback to
Podman's cleanup. Returning them as absolute paths makes
loading the modules a bit faster as it avoids the lookup.
Also drop the attempted performance tune in `Default()` to
accommodate for go's memory model.
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Add a new concept to containers.conf called "modules". A "module" is
a containers.conf file located at a specific directory. More than one
module can be loaded in the specified order, following existing
override semantics.
There are three directories to load modules from:
- $CONFIG_HOME/containers/containers.conf.modules
- /etc/containers/containers.conf.modules
- /usr/share/containers/containers.conf.modules
With CONFIG_HOME pointing to $HOME/.config or, if set, $XDG_CONFIG_HOME.
Absolute paths will be loaded as is, relative paths will be resolved
relative to the three directories above allowing for admin configs
(/etc/) to override system configs (/usr/share/) and user configs
($CONFIG_HOME) to override admin configs.
Also move some functions from config.go for locality.
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Add `New()` function to create a Config and deprecate `NewConfig` which is
a) not extensible and b) broken in the sense that no external caller was
actually using the argument.
Many call sites use `Default()` which now has improved documentation and
allows for interacting with `New(). Most call sites just need to access
a pro-loaded config (via `Default()`). This config can overridden by
`New()` if the caller sets the specific option - a requirement for an
upcoming feature for Podman allowing to load user-specified configs via
CLI flags.
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
It's wasteful and `sut` was not a name I would now understand. Change
the tests that need a default config. The diff also shows that the
tests would benefit a lot from a rewrite into a table-driven form but I
do not want to shave the entire Yak.
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
It has no external user and should not be exported to avoid any API
misuse; built-in defaults are an implementation detail.
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>