Commit Graph

2170 Commits

Author SHA1 Message Date
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 a75c1ca09a pkg/config: turn RuntimePath into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 89b8572671 pkg/config: turn AddCompression into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg cad0135389 pkg/config: turn NetworkCmdOptions 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 ddf52636dd pkg/config: turn engine Env into attributedstring.Slice
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 bde9e751dc pkg/config: turn CgroupConf 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 29b42f3f4f attributedstring: add NewSlice func
Convenience function for callers.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
Valentin Rothberg 33dfbc521b attributedstring.Slice: add Set() method
Needed in Buildah (and potentially Podman later on) where some options
must be overridden.  Ultimately this should be avoided whenever possible
but this is not my goal at the present.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-26 09:17:22 +02:00
renovate[bot] 80a170a86c fix(deps): update module sigs.k8s.io/yaml to v1.4.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-24 21:37:00 +00:00
openshift-ci[bot] a8835e404c Merge pull request #1707 from vrothberg/RUN-1934
containers.conf: appendable string arrays, Part 1
2023-10-24 14:06:09 +00: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 92c98a7323 libimage: add !remote tag
To prevent the podman remote client from using libimage which causes a
lot of bloat due the c/image and c/storage dependencies add the
`!remote` tag.

This will cause a hard compile time failure if the remote client ends up
pulling in libimage.

Fixes #1702

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-23 15:14:43 +02:00
renovate[bot] 8daaf3aa23 fix(deps): update module github.com/fsnotify/fsnotify to v1.7.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-23 07:03:40 +00:00
openshift-ci[bot] 681973c9af Merge pull request #1704 from ygalblum/copy-print-crash
Copier: use StringWithinTransport instead of DockerReference
2023-10-23 07:02:45 +00:00
renovate[bot] 85ded05ae4 fix(deps): update module github.com/onsi/gomega to v1.28.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-23 04:12:36 +00:00
Ygal Blum 2c59e6864f Copier: use StringWithinTransport instead of DockerReference
When trying an invalid image DockerReference maybe nil

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-10-22 11:04:10 +03:00
Paul Holzinger ec9d00f17b libimage: Untag should error for non existent name
podman untag should error out of a name is given which does not exists
for the given image. This regression was added in commit a4a7c28aef.

There was even a test which meant to check for it but unfortunately it
did not actually check for what it should. The doNotExist check failed
early to the upper case in the repo name.
The tests have been updated to check for actual error messages to show
ensure it is failing for the right reason.
This also showed that `normalizing name` message was included twice so
I removed one case to not stutter.

Fixes a4a7c28aef ("libimage: support parallel tag/untag")

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-20 12:15:45 +02:00
Paul Holzinger a4a7c28aef libimage: support parallel tag/untag
The c/storage SetNames API is depracated because it is not race free to
first get the list of names and then append our new name then write the
full list back. Instead a better Add/RemovesNames API has been added.

Tag and Untag should use these to prevent race conditions that can be
easily reproduce using podman tag in parallel. Tests have been added to
ensure it is working correctly.

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

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-19 14:51:14 +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
renovate[bot] cd42aa4fdc chore(deps): update dependency containers/automation_images to v20231004
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-17 18:37:02 +00:00
Valentin Rothberg 9d4b1bf156 libimage: fix computing history
Computing the history did not walk the layers correctly.  Fix that and
try to improve the code to make it easier to read and maintain for
future pairs of eyes.

A regression will also be added to the Podman PR vendoring this change.

Fixes: containers/podman/issues/20375
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-17 16:18:12 +02:00
openshift-ci[bot] 8240f0f3ac Merge pull request #1696 from nalind/compat-platform
libimage: add compat interfaces for the new platform subpackage
2023-10-13 06:40:12 +00:00
Nalin Dahyabhai 3bcb56c0be libimage: add compat interfaces for the new platform subpackage
Add compatibility interfaces for items which have been moved from the
main libimage package to its new platform subpackage.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-10-12 16:17:14 -04:00
renovate[bot] 7518231dfd Update module golang.org/x/net to v0.17.0 [SECURITY]
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-12 18:27:28 +00:00
Urvashi Mohnani dce8f8791d Move platform code to its own directory
Move the platform code into its own directory
under libimage so it can be used by farm build in
podman without causing the binary size to increase a lot.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-10-12 10:38:19 -04: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
renovate[bot] 0c7cc623a5 Update module github.com/containerd/containerd to v1.7.7
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-09 22:47:28 +00:00
renovate[bot] 80499fa108 Update module github.com/onsi/ginkgo/v2 to v2.13.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-09 13:06:53 +00:00
renovate[bot] f96bcbe2e7 Update module golang.org/x/sync to v0.4.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-06 09:55:41 +00:00
Valentin Rothberg e71bf4ce52 apparmor: fix parsing beta/alpha version
Copied from github.com/moby/moby who already has a fix for it.
Tested manually on a Ubuntu 23.10 (beta) VM.

Fixes: #containers/podman/issues/20278
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-06 11:41:58 +02:00
renovate[bot] 211d9f0730 Update module golang.org/x/crypto to v0.14.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-05 16:59:41 +00:00
openshift-ci[bot] 9860cad0f8 Merge pull request #1683 from vrothberg/privileged
containers.conf: add `privileged` field to containers table
2023-10-05 12:48:09 +00:00