Commit Graph

5917 Commits

Author SHA1 Message Date
Paul Holzinger 74454bf59c
rework system connection and farm storage
We now no longer write containers.conf, instead system connections and
farms are written to a new file called podman-connections.conf.

This is a major rework and I had to change a lot of things to get this
to compile again with my c/common changes.

It is a breaking change for users as connections/farms added before this
commit can now no longer be removed or modified directly. However because
the logic keeps reading from containers.conf the old connections can
still be used to connect to a remote host.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-01-31 15:08:41 +01:00
openshift-merge-bot[bot] 1698fa0ad8
Merge pull request #21388 from ashley-cui/healthcheck
Return nil health when inspecting containers without healthchecks
2024-01-31 13:48:36 +00:00
Ashley Cui a1c47f0299 Return nil health when inspecting containers without healthchecks
When inspecting a container that does not define any health check, the health field should return nil. This matches docker behavior.

Signed-off-by: Ashley Cui <acui@redhat.com>
2024-01-30 23:09:13 -05:00
openshift-merge-bot[bot] dabbcb8386
Merge pull request #21339 from mheon/specgen_to_pointer_v2
Convert SpecGen values to be nullable where possible
2024-01-30 19:06:14 +00:00
openshift-merge-bot[bot] a6be5b030c
Merge pull request #21421 from gordonmessmer/ssh-hostname
Fix SSH Host argument in tag command during scp.
2024-01-30 17:13:31 +00:00
Matt Heon 174631f726 Convert SpecGen values to be nullable where possible
SpecGen is our primary container creation abstraction, and is
used to connect our CLI to the Libpod container creation backend.
Because container creation has a million options (I exaggerate
only slightly), the struct is composed of several other structs,
many of which are quite large.

The core problem is that SpecGen is also an API type - it's used
in remote Podman. There, we have a client and a server, and we
want to respect the server's containers.conf. But how do we tell
what parts of SpecGen were set by the client explicitly, and what
parts were not? If we're not using nullable values, an explicit
empty string and a value never being set are identical - and we
can't tell if it's safe to grab a default from the server's
containers.conf.

Fortunately, we only really need to do this for booleans. An
empty string is sufficient to tell us that a string was unset
(even if the user explicitly gave us an empty string for an
option, filling in a default from the config file is acceptable).
This makes things a lot simpler. My initial attempt at this
changed everything, including strings, and it was far larger and
more painful.

Also, begin the first steps of removing all uses of
containers.conf defaults from client-side. Two are gone entirely,
the rest are marked as remove-when-possible.

[NO NEW TESTS NEEDED] This is just a refactor.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-01-30 10:42:24 -05:00
openshift-merge-bot[bot] c41c30bedd
Merge pull request #21180 from rhatdan/nvidia
Make --gpus work with nvidia gpus
2024-01-30 14:59:02 +00:00
Gordon Messmer f8e1ea4140 Fix SSH Host argument in tag command during scp.
[NO NEW TESTS NEEDED]

Signed-off-by: Gordon Messmer <gordon.messmer@gmail.com>
2024-01-29 16:30:39 -08:00
openshift-merge-bot[bot] d418d164a9
Merge pull request #21377 from yyzxw/chore/code-clean
chore: extract duplicate codes
2024-01-29 17:17:17 +00:00
openshift-merge-bot[bot] 37bff82246
Merge pull request #21397 from rhatdan/codespell
Run codespell on code
2024-01-29 09:17:33 +00:00
yyzxw 39e53e6dcf chore: extract duplicate codes
Signed-off-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
2024-01-29 10:10:26 +08:00
openshift-merge-bot[bot] d7bf1385d8
Merge pull request #21260 from umohnani8/img-filters
Fix image filters parsing
2024-01-28 12:39:55 +00:00
Daniel J Walsh 8d14d41555
Run codespell on code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-01-28 07:30:52 -05:00
openshift-merge-bot[bot] 4bef65240e
Merge pull request #21364 from giuseppe/reduce-bindings-deps
reduce binary size for programs using the bindings
2024-01-26 18:22:09 +00:00
openshift-merge-bot[bot] a0ad2cfaa2
Merge pull request #21342 from ygalblum/kube-play-pvc-image-based
Kube Play - allow creating image based volumes
2024-01-25 17:35:20 +00:00
Urvashi Mohnani 848078c938 Fix auto-update digest comparison
Since images can have multiple digests, it is better
to compare the image ID as that will definitely change
on an update and each image can only have one ID.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2024-01-25 12:18:47 -05:00
Giuseppe Scrivano 93510a299d
bindings: suggest using -tags remote to reduce file size
Closes: https://github.com/containers/podman/issues/12548

[NO NEW TESTS NEEDED]

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
Giuseppe Scrivano f18ebad1e6
bindings: pods uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
Giuseppe Scrivano 668d517af9
bindings: volumes uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
Giuseppe Scrivano df6cc8550d
bindings: secrets uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
Giuseppe Scrivano aee733c581
bindings: network uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
Giuseppe Scrivano c736a8e20a
bindings: manifests uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
Giuseppe Scrivano 34cc557411
bindings: play uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
Giuseppe Scrivano 5284149708
bindings: generate uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
Giuseppe Scrivano 5ddc82f7a2
bindings: images uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
Giuseppe Scrivano 08cd7ce41b
specgen: use storageTypes instead of storage package
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:36 +01:00
Giuseppe Scrivano 7aede410da
bindings: containers/update uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:36 +01:00
Giuseppe Scrivano 40cc962a5d
bindings: containers/exec uses directly Docker type
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:36 +01:00
Giuseppe Scrivano 88fb291a39
bindings: containers/create uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:36 +01:00
Giuseppe Scrivano 6c5704a09c
bindings: containers/containers uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:36 +01:00
Giuseppe Scrivano 2d8231efe8
bindings: containers/commit uses directly Docker type
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:36 +01:00
Giuseppe Scrivano 9f0ea0dc87
bindings: containers/checkpoint uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:36 +01:00
Giuseppe Scrivano b304ac1ea8
bindings: containers/archive uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:36 +01:00
Giuseppe Scrivano 9231234203
domain: move system structs to types sub-package
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:36 +01:00
Giuseppe Scrivano 48a99c6514
domain: move Event to types sub-package
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:35 +01:00
Urvashi Mohnani 90867d987e Fix image filters parsing
Fix the image filter parsing in the common libraries
to follow an AND logic for all filters passed in ensuring
compatibility with Docker behavior.
Also fix the filter parsing on the tunnel side so that we grab
all the filters given by the user and not only the last filter
in the list.
Add tests for the fixes.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2024-01-25 11:10:41 -05:00
openshift-merge-bot[bot] 01b2243e73
Merge pull request #21322 from containers/renovate/github.com-docker-docker-25.x
Update module github.com/docker/docker to v25
2024-01-24 16:07:20 +00:00
renovate[bot] 3e6bfb6e99 Update module github.com/docker/docker to v25
[NO NEW TESTS NEEDED]

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2024-01-24 13:21:28 +01:00
openshift-merge-bot[bot] 73a100e907
Merge pull request #21324 from siretart/pkg-fileserver-buildtags
Restrict building the pkg/fileserver implementation to windows
2024-01-24 10:50:20 +00:00
Ygal Blum 269149a9fd Kube Play - allow creating image based volumes
Add volume.podman.io/image annotation to allow setting the source image

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-01-24 11:55:29 +02:00
openshift-merge-bot[bot] 37517d75e8
Merge pull request #21320 from tnk4on/fix-mount-unit-option
Fix Mount Unit Option
2024-01-23 18:07:56 +00:00
Alberto Faria 5cc83da1c6 Pass the OCI runtime an empty entrypoint when there is no entrypoint
Some OCI runtimes (cf. [1]) may tolerate container images that don't
specify an entrypoint even if no entrypoint is given on the command
line. In those cases, it's annoying for the user to have to pass a ""
argument to podman.

If no entrypoint is given, make the behavior the same as if an empty ""
entrypoint was given.

[1] https://github.com/containers/crun-vm

Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-01-23 10:10:44 +00:00
Reinhard Tartler 2e38b9816b Restrict building the pkg/fileserver implementation to windows
This is to avoid p9 dependencies when not building for windows

[NO NEW TESTS NEEDED]

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2024-01-22 17:54:45 -05:00
Shion Tanaka 0e64e107ba Fix Mount Unit Option
Signed-off-by: Shion Tanaka <shtanaka@redhat.com>
2024-01-22 02:41:48 +09:00
openshift-merge-bot[bot] e37752d5a6
Merge pull request #21297 from rhatdan/apple
Label host volume mounted content in machine as nfs_t
2024-01-20 12:35:23 +00:00
openshift-merge-bot[bot] 815ae77ab2
Merge pull request #21291 from kaorihinata/main
Ensure podman temp directory is created on Start as well.
2024-01-19 10:58:53 +00:00
openshift-merge-bot[bot] 75c60d6139
Merge pull request #21295 from sm453/add-makecontainer-error-check
Add missing check for errors returned from SpecGenToOCI to MakeContainer
2024-01-18 18:53:31 +00:00
Daniel J Walsh 75790b42b4
Label host volume mounted content in machine as nfs_t
While this is potentially a security problem, it solves the issues of
users sharing content from the host into containers and attempting to
relabel it. From a security point of view this means all content volume
mounted from the host into the podman machine on apple hypervisor is
read/write from an SELinux point of view if it is volume mounted into
the container. If the user attempts to use :Z or :z it will work and
relabel the content to be only usable bu the specify container.

Helps Fix: https://github.com/containers/podman/issues/21269

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-01-18 12:43:16 -05:00
kaorihinata 7472bdb161 Ensure podman temp directory is created on Start as well.
`getRuntimeDir()` (which is also responsible for creating TMPDIR if it doesn't exist) was being called on `Init()` but not on `Start()` which meant that after the host was restarted and TMPDIR was wiped, `startHostNetworking()` would try to start gvproxy and immediately bail.

Signed-off-by: kaorihinata <kaori.hinata@gmail.com>
2024-01-18 12:37:13 -05:00
Ed Santiago a5612bc540 Quadlet: ensure all keys are documented
New CI validation check: all keys in quadlet.go must be
documented at least once in podman-systemd.unit.5.md.
Adding '// deprecated' next to an enum definition will
exclude said key from the documentation cross-checks.

And, because the md file lists keys in both table and block
form, make sure those all match.

And make sure everything is sorted in lexical order, in
both .go source and in man page.

And add a validation check to make sure it stays that way.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-01-18 06:17:57 -07:00