Commit Graph

201 Commits

Author SHA1 Message Date
Paul Holzinger 7966ad46e4 pkg/config: add netavark_plugin_dirs fields
Add config field to specify the location for the netavark plugins.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-04 18:20:12 +02:00
Urvashi Mohnani 386adadc84 Add kube_generate_type defaults
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-04-03 18:12:37 -04:00
Daniel J Walsh 00eae8d87d Back by popular demand CAP_SYS_CHROOT
We are getting a lot of issues on our removal of CAP_SYS_CHROOT
from the default list of capabilities used by Podman, so adding
it back until we do a major release.

This capabilty is also needed to successfully run the
quay.io/buildah/stable image with Podman.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-21 10:25:29 -04:00
Valentin Rothberg ac12d8f273 containers.conf: add database backend option
The on-going work of adding a new database backend to Podman requires it
to be configurable in containers.conf.  To prevent any breaking changes,
the backend defaults to Podman's current boltdb backend.  Also export
the parsing function for it be usable by Podman.

NOTE: documentation will be added once the database rewrite in Podman
has been completed.  I want to avoid any incomplete docs from leaking
into a release.

Fixes: https://issues.redhat.com/browse/RUN-1772
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-20 13:00:13 +01:00
Daniel J Walsh c552ab433d Revert "Revert "Rework default list of capabilities to minimal""
This reverts commit 91ba27095f.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-12-04 16:12:04 -05:00
Daniel J Walsh f8045ec731 Remove conmon probe
This is taking time on every podman call, and provide limited
protection. Versioning should be handled in the packaging system
and this is an unlikely to happen.

Every exec done by container tools hurts us as we try to get container
startup team to absolute minimal amounts.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-27 07:16:29 -05:00
Valentin Rothberg 91ba27095f Revert "Rework default list of capabilities to minimal"
This reverts commit 962dbc3281.
As shown in containers/podman/pull/16610 the changes require a number of
changes in Podman's CI.  While many issues have been fixed in that PR,
there are some potentially controversial changes such as dropping
NET_RAW.

Let's revert the commit to unblock ongoing work.  For the next
iteration, Podman CI must be green before merging.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-11-25 09:37:41 +01:00
OpenShift Merge Robot 5034979776 Merge pull request #1240 from rhatdan/caps
Rework default list of capabilities to minimal
2022-11-23 03:39:04 -05:00
Daniel J Walsh 962dbc3281 Rework default list of capabilities to minimal
For a couple of years now we have been shipping containers.conf settings
to use only 10 capabities. Docker uses 14, with the difference being
CAP_AUDIT_ALLOW, CAP_NET_RAW, CAP_MKNOD, CAP_CHROOT.

This allows us to run with a tighter security then Docker.

This PR makes the change to default config, so that if no
containers.conf overrides are present, we will run with the tighter
security. Currently most distros that ship the containers.conf already
run with this setting, but this makes it formal, and changes the man
page to match the defaults.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-22 12:55:25 -05:00
Daniel J Walsh 3a429400c3 Deprecate UserNSSize, since we don't use it
Podman and Buildah do not use this field, and I
know of no users of it, remove it from docs and
the default conf file, so users will not expect
it to do anything.

Leaving implementation in the slight chance someone
has used it in a non containers project.

Fixes: https://github.com/containers/podman/issues/16562

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-21 13:06:10 -05:00
OpenShift Merge Robot 43bae401c0 Merge pull request #1225 from flouthoc/platform-to-oci-runtime
config: add support for `platform_to_oci_runtime` and default entries for `wasi/wasm`
2022-11-11 16:04:27 +00:00
Aditya R 1ea30aa853 config: add support for platform_to_oci_runtime and default entries for wasm
Containers.conf now supports `platform_to_oci_runtime` which allows end
users to map variant of OCI runtime for a particular platform.

Most ideal use-case of this feature is switching to crun's variant when
platform string is `wasm32/wasi`.

Example
```toml
[engine.platform_to_oci_runtime]
"wasi/wasm" = "crun-wasm"
"wasm/wasm32" = "crun-wasm"
"wasm/wasm64" = "crun-wasm"
```

Signed-off-by: Aditya R <arajan@redhat.com>
2022-11-11 20:44:59 +05:30
Doug Rabson 4b906d8159 pkg/config: Fix DefaultSignaturePath on FreeBSD
The correct location on FreeBSD is /usr/local/etc/containers/policy.json
which is consistent with path conventions for installed packages. This
fixes 'podman commit' on FreeBSD.

There are several definitions of this path:

- c/image/signature has builtinDefaultPolicyPath and DefaultPolicy
- c/podman/pkg/trust has systemDefaultPolicyPath and DefaultPolicyPath
- c/common/pkg/config has DefaultSignaturePolicyPath

As far as I can tell, buildah uses c/image/signature which is why 'buildah
commit' was already working for me. Podman is using the c/common one. Very
confusing.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-11-09 16:50:45 +00:00
unknowndevQwQ 5db50a2cb8 feat: add support for the youki OCI Runtime 2022-10-22 10:35:23 +08:00
Doug Rabson 8d0af4f01e config: Add config entry for ocijail
Another experimental OCI runtime for FreeBSD, similar to runj but with
a focus on podman/buildah compatiblity.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-10-19 12:02:47 +01:00
Valentin Rothberg e17483b871 bump to golangci-lint v1.50.0
Used `go fmt` rules to migrate away from deprecated functions, for
instance `gofmt -w -s -r 'ioutil.TempDir(a, b) -> os.MkdirTemp(a, b)'`

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-17 15:03:07 +02:00
Jason T. Greene 45154dcc7e Fix Windows regression introduced by PR #1161
Before 50eb74a4b1 this code used unshare.IsRootless() which on Windows
always returns false (the behavior we want).

After 50eb74a4b1, a condition was unintentionally inverted, allowing
Windows to function.

Commit 18803495e8 fixed the inversion, but unintentionally excluded Windows
since it used == 0 instead of <= 0 (Windows returns -1)

Move the logic behind a function with a comment since the Windows path is a
bit exotic.

In the future, the Windows path should likely be refactored to be more
intuitive; however, this will get things working for now.

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-09-29 15:39:23 -05:00
Giuseppe Scrivano 18803495e8 config: correct the check for root
originally the code had the condition "!unshare.IsRootless()", and
commit 50eb74a4b1 introduced the issue
by replacing it with "unshare.GetRootlessUID() != 0".

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-09-20 17:14:48 +02:00
Giuseppe Scrivano 50eb74a4b1 config: look user id instead of rootless
Change the check to look for the UID to decide whether to load the
default configuration files from the user directory instead of the
system path.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-09-16 16:46:09 +02:00
Paul Holzinger 7fff18ce94 phg/config: do not force default EventsLogFilePath
The problem with setting such defaults in c/common is that podman cannot
know if a user set this or it is the default. EventsLogFilePath is not a
static path, it depends on the --tmpdir value from podman.

check
b0b36430b8/libpod/runtime.go (L1041-L1043)

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-09 15:07:58 +02:00
OpenShift Merge Robot 07298b23a3 Merge pull request #1129 from mheon/add_volume_timeout
Add volume plugin timeout to containers.conf
2022-08-22 15:43:51 -04:00
Matthew Heon 4f7bd530ae Add volume plugin timeout to containers.conf
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2022-08-22 14:39:23 -04:00
Arthur Sengileyev 30d0948da5 Adjust default volumes for windows compatibility
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2022-08-19 17:09:25 +03:00
Giuseppe Scrivano e4edaae628 config: return correct error
_conmonVersionFormatErr is a format string and it needs an error
argument.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-08-17 14:40:01 +02:00
Giuseppe Scrivano 815258862e config: look at the conmon-rs version string
instead of looking at the binary name, look at the different version
format used by conmon-rs.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-08-16 23:30:17 +02:00
Jake Correnti 5128b5a72f Add conmon-rs paths
Adds the conmon-rs paths so Podman can find the right conmon-rs binary
when making a new runtime.

I also slightly modified the `FindConmon` function so that the code
could be shared with the `FindConmonRs` function that I added.

Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
2022-08-10 10:46:26 -04:00
Charlie Doern 64be63d976 ssh package
initial implementation of the ssh package including:

- nativeConnectionCreate() / golangConnectionCreate()
- n/a / golangConnectionDial()
- nativeConnectionScp() / golangConnectionScp()
- nativeConnectionExec() / golangConnectionExeC()

the way this works, is there are publicly accessible functions Create, Exec, Dial and Scp. podman will have a new global flag --ssh` that will allow users to choose native or golang based ssh functions. The functionality in containers/common (here) also checks if you have the necessary binaries installed

closes #1091

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-08-08 09:22:46 -04:00
Dominique Martinet 2e8943d3f7 add network dns_bind_port setting and set NETAVARK_DNS_PORT from it
This commit allows using aardvark with an alternate port as per
implementation in containers/netavark#323

Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
2022-07-08 09:45:15 +09:00
Daniel J Walsh a390d0c66c Change github.com/pkg/errors to use errors in pkg/config
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-05-18 10:33:53 -04:00
Daniel J Walsh 58f58410a6 Support setting image_volume_mode in containers.conf
Begins to fix https://github.com/containers/podman/issues/14230

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-05-18 10:10:06 -04:00
Doug Rabson c4cbb913bd Change some defaults for FreeBSD and add a sample containers.conf
Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-05-09 14:07:58 +01:00
Doug Rabson faf3c75d8f Add runj which is an experimental OCI runtime based on FreeBSD jails
Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-05-09 14:07:58 +01:00
Valentin Rothberg 1cb045b421 containers.conf: add pod_exit_policy
Add a new `pod_exit_policy` field to the containers.conf's engine table.
A pod's exit policy determines the behaviour when the last container of
a pod exits.

Required-in: containers/podman/pull/13859
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-04-29 12:17:16 +02:00
OpenShift Merge Robot 14485d3f32 Merge pull request #1006 from Luap99/ipv6-slirp
pkg/config: fix docs for network_cmd_options
2022-04-21 07:11:03 -04:00
Paul Holzinger a3b0ae033e add base_hosts_file field to containers.conf
base_hosts_file can be used to overwrite the default base host file
/etc/hosts which is used to copy hosts entries from this file into the
containers /etc/hosts file. As special value "image" can be used to copy
the entries from the image hosts file or "none" to not use a base file
at all. IF the value is empty we should use /etc/hosts as default.

Ref https://github.com/containers/podman/issues/13277
Ref https://github.com/containers/podman/issues/13748

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-21 11:39:56 +02:00
Paul Holzinger d154daf361 pkg/config: fix docs for network_cmd_options
Slirp4netns options were changed to always default to ipv6 so it does
not need the extra setting. Update the documentation to reflect this.

see https://github.com/containers/podman/pull/13929

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-20 14:56:31 +02:00
Niall Crowe a894dd11a3 pkg/config: new value for events_logfile_max_size
Changing the value for events_logfile_max_size from 0 to 1048576. This allows
up to 10,000 events to be written to the events log file before rotation occurs.
Also adding new values to default.go

Signed-off-by: Niall Crowe <nicrowe@redhat.com>
2022-04-20 10:23:50 +01:00
OpenShift Merge Robot 6c2cd2f357 Merge pull request #997 from kolyshkin/golangci-lint
golangci-lint spring cleaning and bump
2022-04-14 07:14:51 -04:00
Daniel J Walsh a3e25551d0 Add machine volumes to containers.conf
This will allow users to specify which volumes they want podman machine
to automatically mount into the machine. These volumes can later be used
to volume mount into containers.

Environment variables like $HOME can be used and are translated at the
time of machine start.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-04-13 07:33:17 -04:00
Kir Kolyshkin b951b72412 Gofumpt the code
gofumpt is a stricter version of gofmt, basically making the code more
readable, and fixing the gocritic's octalLiterar warnings like this one:

	pkg/util/util_supported.go:26:17: octalLiteral: use new octal literal style, 0o722 (gocritic)
		return (perm & 0722) == 0700
			       ^

Generated by gofumpt -w .

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-04-09 16:50:11 -07:00
Daniel J Walsh 54be5eba7e IPCMode default mode should be sharable not private
Docker defined --ipc=private to mean that the container's IPC Namespace
can NOT be shared with another container.  While --ipc=shareable can,
which is our current default.  Docker also defines "none" which means
the container runs in a IPC namespace but does NOT mount a /dev/shm.
"Host" means the container runs in the host namespace, and
container:UUID means run new container in other containers namespace.
ns:PATH means run in the namepsace designated in PATH.2

This Patch, fixes containers/common to reflect the correct default.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-03-22 07:25:59 -04:00
Paul Holzinger a2ee133248 Fix ImageCopyTmpDir for windows
We cannot use /var/tmp on windows, instead use the temp var which is
defined on windows, of fall back to appdata.

Fixes containers/podman#13434

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-08 19:40:10 +01:00
Ashley Cui 74dd6d6f1b Add additionalHelperBinariesDir
Different packaging for different distributions have their own prefix for where helper binaries should live. additionalHelperBinariesDir is a variable that can be set during link-time so that a packager can change the location without having to carry patches for their default location.

[NO NEW TESTS NEEDED]

Signed-off-by: Ashley Cui <acui@redhat.com>
2022-02-25 16:23:38 -05:00
Rover van der Noort 87dcc5729f Add ExitCommandDelay as configuration in EngineConfig with default of 5 minutes in seconds.
Signed-off-by: Rover van der Noort <s.r.vandernoort@student.tudelft.nl>
2022-02-24 15:51:05 +01:00
Sascha Grunert 446e323e80 Fix bug in `probeConmon` and add unit tests
This patch adds unit tests for the function `probeConmon` as well as
fixes a bug where a `nil` error got wrapped always to `nil`.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-02-16 11:03:55 +01:00
Paul Holzinger b76062811b pkg/config: add new default_subnet_pools field
Add a new field to set the default subnet pools. They can be used to
change the subnet which is automatically allocated by podman network
create.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-02-15 15:29:19 +01:00
Daniel J Walsh e24561828a Change infra_image default to ""
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-01-27 16:42:18 -05:00
Paul Holzinger 4eb265ce95 remove rootless_networking field from containers.conf
This field was only needed for machine to force cni, however you can set
netns="bridge" in the config to have the same effect. This is already
done in the machine setup.

The field was more of a hack and just creates confusion for users so we
remove it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-20 16:23:12 +01:00
Paul Holzinger 995cdaae8f netavark: use globally shared network config dir
Since the network namespace is shared for all rootful libpod instances
we also need to make sure to use the same network config dir and run dir
to ensure that we do not use the same subnet or ip for more than one
container.

Also update the documentation about the network_config_dir field.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-17 15:36:03 +01:00
Paul Holzinger 25af87fbcc libnetwork: add function to get the default network backend
When the network backend is unset in the config we have to to figure out
if we need CNI or netavark. New installs should use netavark while
existing installs should continue to use CNI to prevent breaking
systems.

We use the following conditions to determine what backend to use:
1. read ${graphroot}/defaultNetworkBackend
2. find netavark binary (if not installed use CNI)
3. check containers, images and CNI networks and if there are some
   we have an existing install and should continue to use CNI

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-04 15:46:12 +01:00
Paul Holzinger a8f3e67f91 add netns package from podman
We need the netns package in c/common for the new network code.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-16 18:51:21 +01:00
Jason T. Greene d813c5e6fb Add platform driven image and user defaults for podman machine
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2021-12-09 14:37:54 -06:00
OpenShift Merge Robot a17d7ed71f Merge pull request #833 from vrothberg/compat-registry
containers.conf: add option to enforce docker.io for compat API
2021-11-22 21:40:31 +01:00
OpenShift Merge Robot aeadc7f2af Merge pull request #830 from rhatdan/network
Set netns to default to private like other namespaces
2021-11-19 17:34:16 +01:00
Valentin Rothberg c9748ff5ad containers.conf: add option to enforce docker.io for compat API
Add an option to containers.conf as a knob to enforce short-name
resolution to Docker Hub in Podman's compatibility REST API.

By popular request, turn it on by default.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-19 16:44:56 +01:00
Valentin Rothberg 1d98659f5a increase default machine vm size to 100GiB
Context: containers/podman/issues/11712
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-19 07:49:53 +01:00
Daniel J Walsh 4249000f56 Set netns to default to private like other namespaces
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-18 10:42:47 -05:00
Matthew Heon 8b1b879924 Add network_backend field for switching to netavark
This field determines whether CNI or netavark will be used to
create container networks. Default presently set to "cni".

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-11-09 13:45:56 -05:00
Ashley Cui bb2b17e7da Add machine table to containers.conf
Add machine teable to configure podman machine options. Move machine_image to the machine table, and add cups, disk size, and memory to the machine table.

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-09-23 17:03:12 -04:00
Daniel J Walsh 8795468580 UserNS should default to '' rather then host
If you use this field in rootless mode, it will blow up,
since rootless mode can not use the host user namespace.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-18 07:00:40 -04:00
Daniel J Walsh 34010ec073 Merge branch 'main' of github.com:containers/common into ipv6 2021-09-17 07:15:03 -04:00
Daniel J Walsh b45ac6d515 Make podman system service timeout configurable in containers.conf
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-15 06:15:42 -04:00
Frederic Crozat abfd6e3fdd ensure same path is used in all location for krun 2021-09-14 16:59:26 +02:00
Frederic Crozat c2965e479c Add support for the krun (runc running in KVM) OCI Runtime
Signed-off-by: Frederic Crozat <fcrozat@suse.com>
2021-09-14 15:57:26 +02:00
Daniel J Walsh fd50dccd46 Enable ipv6 for rootless users by default
Fixes containers/podman#10889

Inspired by @rugk

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-12 06:31:56 -04:00
Daniel J Walsh a5bac2096a Add support for image_copy_tmp_dir
Allow users to set the default location for the temporary files used
during image pulls and pushes.

Defaults to /var/tmp;

Overridden via "TMPDIR" environment variable.

Allow special flag "storage" to indicate the the storage should use
the tmp directory in containers/storage/tmp.

Needed to fix: https://github.com/containers/podman/issues/11107

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-11 04:51:27 -04:00
Paul Holzinger 25622da26e Add HelperBinariesDir field to engine config
This field contains a list of directories which should be used to store
some helper binaries, e.g. gvproxy.

Also add a FindHelperBinary method to the config struct to get the full
path to a helper binary.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-10 13:38:19 +02:00
Matthew Heon 92ebb4a858 Switch default Rootless Networking to "CNI" for OSX
This should better support rootless CNI usescases.

Fixes https://github.com/containers/podman/issues/11396

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-09-01 15:57:00 -04:00
unknowndevQwQ 43bd1ced8a add some cni plugin paths
add some possible paths for the cni plugin to be stored

Replaces: containers/common#728

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-08-31 06:23:16 -04:00
openshift-ci[bot] e2d30a3914 Merge pull request #716 from ashley-cui/machineconfs
Add machine_image to containers.conf
2021-08-10 14:56:30 +00:00
Ashley Cui 927da0ce99 Add machine_image to containers.conf
Signed-off-by: Ashley Cui <acui@redhat.com>
2021-08-09 15:37:06 -04:00
Daniel J Walsh 4c61660bf5 Switch default logdriver and eventslogger to journald, if root
This will fix hte eventslog and log files from growing huge,
Lets journald handling rolling logs.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-08-09 11:54:46 -04:00
Matej Vasek 61d2ae986d add config option for ChownCopiedFiles
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-07-13 18:17:12 +02:00
Tino Rusch 5ec160696b add 'secret' section to the containers.conf struct. 2021-06-10 14:04:32 +02:00
Paul Holzinger 90eca585d4 Leave default seccomp path empty
The default path should be empty in order for podman to distinguish
between a path the was explicitly or to use the default (in memory)
profile.

Fixes: containers/podman#10556

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-04 13:05:35 +02:00
Paul Holzinger 79bec2ae80 Do not set the default netns
The default netns must be empty. Podman should decide what the default
option is. While podman also defaults to slirp4netns as rootless and
bridge as root, there are also other defaults for `podman run --pod ...`
and `podman pod create --infra=false` where it defaults to the pods
netns. This config field was always ignored by podman and trying to
make it work requires this patch since the default values are incorrect
for podman.

Buildah does not seem to use it either.

Also move the rootless_networking field in the default config file to
the correct containers stanza.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-05-28 16:33:03 +02:00
Daniel J Walsh 4c654f7ac2 Don't use systemd defaults if /proc/1/comm != systemd
Currently we have users failing to run containers within containers
or on systems without systemd support.  This change will give us
better defaults on these systems.

Fixes: https://github.com/containers/common/issues/580

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-05-26 15:08:14 -04:00
Matthew Heon eb83275e21 Use Private as default for rootless when we want CNI
We were hardcoding Slirp4netns as the only valid option for
rootless when "private" networking was selected. We shouldn't be
doing that - the default networking selection in Podman itself is
smart enough to figure out what to do, c/common should not decide
for us.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-05-21 13:12:03 -04:00
Brent Baude cf1c43959f rootless networking
Set type of rootless networking with:

rootless_networking = "slirp4netns | cni"

slirp is the default

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-05-20 15:34:44 -05:00
Valentin Rothberg 460874be71 Revert "Do not emit warnings about OCI runtime paths"
This reverts commit 352073be9e as it's
causing a regression as it overwrites any custom OCI runtime with either
rucc, crun or kata.  See the Podman CI failure below:

```
[+0383s] not ok 95 podman build - set runtime
[+0383s] # (from function `die' in file test/system/helpers.bash, line 412,
[+0383s] #  from function `run_podman' in file test/system/helpers.bash, line 220,
[+0383s] #  in test file test/system/070-build.bats, line 70)
```

I currently do not have the time for a proper fix but the next commit
attempting to address the warnings must include tests.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-05-19 13:12:13 +02:00
OpenShift Merge Robot af06050478 Merge pull request #546 from vrothberg/log-driver
adjust log-driver defaults
2021-05-12 15:09:47 -04:00
Valentin Rothberg 2d3c57daa0 adjust log-driver defaults
Commit ebfe786429 changed the default logging driver k8s-file to
journald.  The only consumer of the log-driver is Podman which I think
still needs some more time to stabilize.  Vendoring containers/common
into Podman has revealed quite some warts (see
containers/podman/pull/10222) which reduced my confidence level.

To resolve the chicken-egg-problem of maturing the journald driver, I
want to only partially revert commit ebfe786429.  The built-in default
remains k8s-file while the containers.conf sets it to journald.  The
intention behind is to make sure that running systems are not impacted
but we can change Fedora to journald to increase coverage.

Once the confidence level is back to normal, we can change the default
to journald.  Latest before RHEL9.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-05-12 14:13:04 +02:00
Vasyl Gello 352073be9e Do not emit warnings about OCI runtime paths
... before all user configuration files are merged.

This fixes #9389.

Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
2021-05-10 21:39:17 +03:00
OpenShift Merge Robot ba743c0fdb Merge pull request #518 from rhatdan/journald
Swap default logging to journald
2021-05-05 11:18:10 -04:00
Matthew Heon 85df6670fb Add ability to specify a subnet for the default network
This lays the foundation for c/common to be able to create the
default CNI configuration file itself.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-05-04 11:40:22 -04:00
Daniel J Walsh ebfe786429 Swap default logging to journald
This eliminates the concern of log files growing infinitely and also
records all containers for posterity rather then allowing the removal
of a container to destroy the record.

Partially fixes: https://github.com/containers/podman/issues/9158

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-04-29 13:32:50 -04:00
OpenShift Merge Robot 9724f1b55e Merge pull request #510 from rhatdan/parallel
Add support for the runsc OCI Runtime
2021-04-26 15:45:14 -04:00
Daniel J Walsh 671db86c0d Add support for the runsc OCI Runtime
Based on https://github.com/containers/common/pull/507 PR.

Thanks to unknowndev233 unknowndevQwQ@protonmail.com whoever they are.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-04-24 06:11:10 -04:00
Ashley Cui 24f4991dc1 Add support for machine_enabled in containers.conf
machine_enabled is a bool that indicates if Podman is running in a
podman-machine VM

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-04-23 14:37:18 -04:00
Daniel J Walsh 417d17cba5 [NO TESTS NEEDED] Remove some stuttering on return errors
golang builtin OS functions, include the path to the object being used,
no reason for us to wrap these errors with an object for a second time.

This just causes stuttering, and looks bad at the CLI level.

Existing tests should catch any errors.

Also stop adding "error" to something that is obviusly an error when it
shows up to the user.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-29 10:33:18 -04:00
Sascha Grunert 4cfca98e2b Update pause image to 3.5
This patch updates the pause container image to the latest release.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-03-16 15:08:16 +01:00
Daniel J Walsh ee0eadd226 Vendor in containers/common and start using types subdir.
This will shrink the vendoring size of containers/common/pkg/config
by a huge amount.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-27 06:43:12 -05:00
pacoxu 6e9f831375 update pause image to 3.4.1 2021-02-08 14:25:28 +08:00
Valentin Rothberg 592498d52b Revert "Change default log driver to journald"
This reverts commit 451f5fb68b.

Journald is not yet passing Podman CI.  We need to temporarily revert
the commit to unblock secrets work.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-05 21:28:22 +01:00
Daniel J Walsh 451f5fb68b Change default log driver to journald
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-30 07:57:07 -05:00
baude c0b1b9a368 Add accessor for log-driver
For podman, we need to be able to get the log driver from common config.

Signed-off-by: baude <bbaude@redhat.com>
2021-01-19 15:08:34 -06:00
Daniel J Walsh 58231b6407 http_proxy is supposed to default to true.
In the containers.conf we default to true, but in code and man page
it is defaulted to false. Since Podman wants it defaulted to true
we need to change default and man page to match.

Also fixed the testing for SELinux, which would never succeed on an SELinux box.

Helps fix: https://github.com/containers/podman/pull/8844

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-29 08:04:52 -05:00
Daniel J Walsh ec4a98a333 Switch references of /var/run -> /run
Systemd is now complaining or mentioning /var/run as a legacy directory.
It has been many years where /var/run is a symlink to /run on all
most distributions, make the change to the default.

Partial fix for https://github.com/containers/podman/issues/8369

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-18 06:27:41 -05:00
Daniel J Walsh 44e14b12b9 Find ociruntime instead of hard coding default
Users could have any one of the OCI runtimes installed,
code will search for default.  This way they do not need
to modify defaults if they have "crun" installed.

Search order will be crun, runc, kata

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-15 05:43:45 -05:00
Daniel J Walsh 8618895ac3 Switch default runtime from runc to crun
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-04 08:06:11 -05:00