21541 Commits

Author SHA1 Message Date
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
c41c30bedd Merge pull request #21180 from rhatdan/nvidia
Make --gpus work with nvidia gpus
2024-01-30 14:59:02 +00:00
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
7ed4478c08 Merge pull request #21412 from umohnani8/farm-engine
Don't require engine connection for farm
2024-01-30 00:06:53 +00:00
d418d164a9 Merge pull request #21377 from yyzxw/chore/code-clean
chore: extract duplicate codes
2024-01-29 17:17:17 +00:00
3136f0fca0 Don't require engine connection for farm
Don't require the need to connect to an engine/podman
machine when doing the farm create, ls, rm, and update
commands.
Connection to the engine is required for the farm build
command.

[NO NEW TESTS NEEDED]

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2024-01-29 11:25:15 -05:00
0ec84b8ec5 Revert "Enable win podman-machine test failure"
This reverts commit f9e8585c5354748b2a77ed65d214adfe7c6ae5fe.

Signed-off-by: Chris Evich <cevich@redhat.com>
2024-01-29 09:30:04 -05:00
2ba3605108 Merge pull request #21292 from yyzxw/chore/remove-unused-file
clean up: remove unused file
2024-01-29 13:45:19 +00:00
37bff82246 Merge pull request #21397 from rhatdan/codespell
Run codespell on code
2024-01-29 09:17:33 +00:00
831fd945c4 Merge pull request #21394 from jameshurst/docs-fix
[CI:DOCS] fix documentation formatting issues
2024-01-29 08:41:43 +00:00
6ed207f443 Merge pull request #21393 from cgwalters/minor-machine-docs
[CI:DOCS] man: Minor wording tweak for host/connection
2024-01-29 08:38:58 +00:00
39e53e6dcf chore: extract duplicate codes
Signed-off-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
2024-01-29 10:10:26 +08:00
d7bf1385d8 Merge pull request #21260 from umohnani8/img-filters
Fix image filters parsing
2024-01-28 12:39:55 +00:00
8d14d41555 Run codespell on code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-01-28 07:30:52 -05:00
d5bed05df7 docs: fix podman-manifest-rm header
Signed-off-by: James Hurst <james@jameshurst.ca>
2024-01-27 19:03:35 -05:00
3592b56c37 docs: fix unclosed code block
Signed-off-by: James Hurst <james@jameshurst.ca>
2024-01-27 19:03:35 -05:00
6678260eb9 man: Minor wording tweak for host/connection
The past tense here doesn't make sense.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-01-27 14:34:39 -05:00
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
56d3d59a7f Merge pull request #21380 from lsm5/podman5-fedora-targets
[CI:DOCS] Packit: podman5 downstream for f40+
2024-01-26 15:13:19 +00:00
cd5982e988 quadlet: Add tests for templates
Signed-off-by: Alexander Larsson <alexl@redhat.com>
2024-01-26 13:57:47 +01:00
dc94a10d68 quadlet: Add documentation about template use to manpage
Signed-off-by: Alexander Larsson <alexl@redhat.com>
2024-01-26 13:57:47 +01:00
01dccba50c quadlet: When loading dropin files for foo@instance, also load those for foo@.
This is how systemd works for templates, and it allows us lots of
flexibilities.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2024-01-26 13:57:39 +01:00
bb6dec46ff quadlet: Support [Install] for templated units
For a base template like `foo@.container` the WantedBy and RequiredBy
keys does nothing. However, if a DefaultInstance= key is specified
that is used by default.

However, even if the DefaultInstance= is not given, the Install
section is still useful, because you can instantiate the generic
template by making a symlink for it, and that symlink will then
pick up the instance id.

So, for example, this foo@.container will not enable anything
on boot.
```
[Container]
Image=foo
Exec=sleep 100

[Install]
WantedBy=other.container
```

But if you have a symlink 'foo@instance.container` -> `foo@.container'
then the `foo@instance` service will be marked as wanted by `other`.

In addition, even if the main template doesn't have an Install
section, you can instantiate it with a symlink like above, and then
enabling it using a dropin file like
foo@instance.container.d/install.conf containing:
```
[Install]
WantedBy=other.container
```

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2024-01-26 13:57:39 +01:00
7e1942ed46 systemd.parser: Add GetTemplateParts()
This helper splits out a templated filename into the base template and
the instance name. This will be used later.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2024-01-26 13:57:39 +01:00
2df994ba0c quadlet: Don't put @ in container names for templated units
This is not supported by podman, so we make "foo@bar" into "foo_bar".

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2024-01-26 13:57:39 +01:00
b73eec88dc [CI:DOCS] Packit: podman5 downstream for f40+
Podman5 will be shipped only on f40 and higher, so packit downstream tasks
should be enabled only for those.

Using `CI:DOCS` as the change only affects downstream Fedora, nothing
worth spending CI minutes on.

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2024-01-26 16:49:21 +05:30
51c1140fcb Merge pull request #21370 from edsantiago/manpage_minor
[CI:DOCS] minor man page cleanup
2024-01-26 10:24:40 +00:00
36c77898b3 Merge pull request #21368 from containers/renovate/github.com-google-uuid-1.x
Update module github.com/google/uuid to v1.6.0
2024-01-26 10:21:47 +00:00
7dcbc75aa0 [CI:DOCS] minor man page cleanup
Followup to #21285. I hope this is easier to review
than a re-push of that one.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-01-25 15:59:18 -07:00
202cab6124 Fix inspect test that rely on digest
Given that we can have multiple image digests,
fix the inspect test to check whether the digest
given matches one of the digests of the image.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2024-01-25 15:05:48 -05:00
fc660a22a4 Merge pull request #21285 from rhatdan/man
[CI:DOCS] Clean up man pages.
2024-01-25 18:41:19 +00:00
ffd7a89985 Update module github.com/google/uuid to v1.6.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-25 18:39:46 +00:00
f7230fa271 Merge pull request #21365 from containers/renovate/github.com-mattn-go-sqlite3-1.x
Update module github.com/mattn/go-sqlite3 to v1.14.20
2024-01-25 18:38:36 +00:00
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
f3f0620043 Merge pull request #21363 from umohnani8/farm-docs
[CI:DOCS] Update farm docs
2024-01-25 17:27:05 +00:00
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
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
f18ebad1e6 bindings: pods uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
668d517af9 bindings: volumes uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
df6cc8550d bindings: secrets uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
aee733c581 bindings: network uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
c736a8e20a bindings: manifests uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
34cc557411 bindings: play uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
5284149708 bindings: generate uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
5ddc82f7a2 bindings: images uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:37 +01:00
08cd7ce41b specgen: use storageTypes instead of storage package
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:36 +01:00
7aede410da bindings: containers/update uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:36 +01:00
40cc962a5d bindings: containers/exec uses directly Docker type
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:36 +01:00
88fb291a39 bindings: containers/create uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:36 +01:00
6c5704a09c bindings: containers/containers uses entities/types
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-25 17:21:36 +01:00