Commit Graph

201 Commits

Author SHA1 Message Date
openshift-merge-bot[bot] 06890ca3e6 Merge pull request #1754 from ashley-cui/helpbin
Prioritize addtionalHelperBinariesDir over default dirs
2023-11-29 14:26:26 +00:00
Ashley Cui a61dce37d7 Prioritize addtionalHelperBinariesDir over default dirs
When addtionalHelperBinariesDir is set, first search that path for helper binaries, then the default locations.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-11-29 09:11:12 -05:00
Chetan Giradkar 41f0492c7f Add configurability to Netavark firewall driver
closes #1338

Signed-off-by: Chetan Giradkar <cgiradka@redhat.com>
2023-11-28 12:51:21 +00:00
Giuseppe Scrivano fb57f456f0 utils: use GetRuntimeDir() from c/storage
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-11-21 07:29:01 +01:00
Giuseppe Scrivano 88a2502df3 vendor: update c/{image,storage}
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-11-21 07:29:01 +01:00
Daniel J Walsh 274a84c633 Add masked paths and readonly paths to config
Podman and Buildah have gone out of sync, this will allow us to make
sure they stay in sync.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-10-27 12:23:35 -04:00
Valentin Rothberg cd2797eb34 pkg/config: use NewSlice, Get and Set where possible
To improve the code and reduce memory allocations.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 10:04:20 +02:00
Valentin Rothberg e212082542 pkg/config: turn machine Volumes into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 5fb9ed7f84 pkg/config: turn NetavarkPluginDirs into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 67a73c7cc6 pkg/config: turn CNIPluginDirs into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 318bae8a6a pkg/config: turn RuntimeSupportsKVM into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 6e28b11cdd pkg/config: turn RuntimeSupportsNoCgroups into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 7b367af14c pkg/config: turn RuntimeSupportsJSON into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 67bf05db37 pkg/config: turn DefaultHooksDir into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 8a06b6cb94 pkg/config: turn HelperBinariesDir into attributedstring.Slice
Also tag it as omitempty to fix the test.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 499d0a683e pkg/config: turn ComposeProviders into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg f09869b142 pkg/config: turn ConmonRsPath into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg fbafbc0cb6 pkg/config: turn ConmonPath into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 02c8cd8521 pkg/config: turn ConmonEnvVars into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg b4f49e7b28 pkg/config: turn DNSSearches into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 45cb2feed0 pkg/config: turn DNSOptions into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 26143a5a0f pkg/config: turn DNSServers into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg a86cc6fc42 pkg/config: turn Ulimites into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 051dddac85 pkg/config: turn DefaultSysctls into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 12bde4bc00 pkg/config: turn Capabilities into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 04569d2f52 pkg/config: turn Annotations into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg b8c3014c2a pkg/config: turn devices into attributedstring.Slice
The tests are messy and should be turned into table-driven tests but I
do not have time at the moment.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg b103cb9e93 containers.conf: appendable string arrays, Part 1
Commit 395ba05c44 implemented a POC to allow for changing the behavior
when loading multiple container.conf files in sequence.  By default, the
TOML encoder will override existing data/fields with the one specified
in the loaded file.  The POC has demonstrated how this behavior can be
changed to append string slices instead of overriding/replacing them
entirely.

This change is the first step of integrating these appendable string
arrays into containers.conf and starts with enabling the `Env`,
`Mounts`, and `Volumes` fields in the `[Containers]` table.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-24 11:47:46 +02:00
Paul Holzinger 27b072610b pkg/config: lookup InitPath in HelperBinariesDir
Forcing a single upstream default for the init path is bad as some
distro use different install locations for various reasons.

To fix this use the existing helper_binaries_dir field to lookup in all
directories. To keep backwards compatibility we keep using the old
default and both Containers.InitPath and Engine.InitPath. Yes that is
right, somehow we ended up with the same config field under the
containers and engine section and they are both used in podman!
Thus we need to keep supporting both, only the field under the container
section was documented and now recommends the use of helper_binaries_dir.

To make the docs more clear also document what binaries are currently
looked up in helper_binaries_dir.

Note this needs further integration in podman.

Fixes #1110

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-18 12:55:29 +02:00
Paul Holzinger 6a79383d51 pkg/config: use empty default for db_backend
Podman should default to sqlite for new installs, however to not break
upgrades we should detect if a boltdb database exists and use that in
such case. Now in order to distinguish between an explicitly set
"sqlite" and "boltdb" and nothing set we use an empty default.

With that podman can know if we really should use the default or if it
was configured for a db explicitly. The actual detection logic must be
implemented in podman as we only know the file locations there.

This commit also drops the unused StateType as this was not used at all.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-10 15:57:52 +02:00
OpenShift Merge Robot 9fd112d7ef Merge pull request #1660 from vrothberg/fix-podman-19938
pkg/config: do NOT set StaticDir and VolumeDir
2023-09-22 06:41:22 -04:00
Valentin Rothberg 7cad0ac3a8 pkg/config: do NOT set StaticDir and VolumeDir
Let callers (i.e., Podman) decide which defaults to chose.  This way,
callers know when to override defaults (i.e., when the values are
empty).

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-09-21 11:27:13 +02:00
Ashley Cui 14bd78db61 Default machine CPUs to Cores/2
1 CPU core typically is not enough for most use cases, so we default to available cores/2 for new machines.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-09-20 15:10:16 -04:00
Christophe de Dinechin d4e262dc59 Fix typo in comment
Replacing 'eturns' with 'returns'

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2023-09-14 11:40:32 +02:00
Valentin Rothberg e00d7e3560 pkg/config: unexport DefaultConfig
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>
2023-08-14 09:40:27 +02:00
Valentin Rothberg 808df82b75 pkg/config: s/defaultConfigFromMemory/defaultEngineConfig/
Because that's what it actually does.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-08-14 09:40:27 +02:00
Brent Baude 764f36735e cleanup getDefaultMachineUser|Image
small refactoring for #1603 adn #1608 where we no longer have operating
system differences.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-08-11 07:46:17 -05:00
OpenShift Merge Robot 8694484524 Merge pull request #1586 from umohnani8/farms
Add Farms to config
2023-08-05 04:34:23 +02:00
Urvashi Mohnani 42a36d1ba1 Add Farms TOML table
Add two new fields Farms and DefaultFarm to the Config
to be used by the new podman buildfarm command.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-08-03 09:53:48 -04:00
Daniel J Walsh cdb801ec18 We don't want TERM environment turned on by default
This should only be done in container-engines that are using a
terminal.

Reverts: https://github.com/containers/common/pull/267

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-31 11:33:28 -04:00
Daniel J Walsh 19a6a187a9 Allow mounts to be specified in containers.conf
We want to allow HPC Customers and others to specify mounts
inside of containers.conf, so that they can have a default
list of mounts into all of thier containers.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-25 15:06:08 -04:00
OpenShift Merge Robot 719a2a94bd Merge pull request #1571 from vrothberg/RUN-1865
containers.conf: add compose fields
2023-07-24 18:10:16 +02:00
Valentin Rothberg 0ce0a1367c containers.conf: add new `compose_providers` option
Specify one or more external providers for the compose command.  The
first found provider is used for execution. Can be an absolute path or a
(file) name. Relative names are invalid.  File names are evaluated via
$PATH look ups.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-07-24 15:53:17 +02:00
Valentin Rothberg dc08c0598b containers.conf: add new `compose_warnings_logs` option
Emit logs on each invocation of the compose command indicating that an
external compose provider is being executed.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-07-24 10:06:41 +02:00
Doug Rabson 4faf4b6dbb pkg/config: Add ocijail to the RuntimeSupportsJSON list
I added this support to ocijail a while ago but forgot to change the
compiled-in default since I was overriding the value in my
containers.conf.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2023-07-23 16:22:23 +01:00
Doug Rabson 478419732a Change default image volume mode to "nullfs" on FreeBSD
This fixes a regression in
https://github.com/containers/podman/pull/19241 which quite reasonably
assumed that the default image volume mode from pkg/config was correct.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2023-07-17 14:58:23 +01:00
Lokesh Mandvekar 4bb9e26054 containers.conf: Add `podmansh_timeout`
Ref: https://github.com/containers/podman/pull/19140#discussion_r1254435823

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-07-14 15:19:11 -04:00
Doug Rabson 5daab4a8cf pkg/config: override DefaultInitPath for FreeBSD
FreeBSD packages typically install files under /usr/local on FreeBSD.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2023-06-12 16:00:37 +01:00
Daniel J Walsh a370cfad72 Add some fixes for CompressionFormat
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-05-30 17:32:27 -04:00
Paul Holzinger c0a7616486 pkg/config: add default_rootless_network_cmd field
Add a new field to the network section to allow users to set the default
network program which is used when running rootless containers.
This should be used when you run something like --network private or
--network default as rootless user.

The current default is slirp4netns so we keep that for now. Once I
integrate pasta in the rootless netns then we can consider switching the
default to pasta.

This setting will also be useful then for distros who may not ship pasta
so that they could set it back to slirp if needed.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-23 13:40:23 +02:00