podman/pkg/specgen
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
..
generate Convert SpecGen values to be nullable where possible 2024-01-30 10:42:24 -05:00
container_validate.go Convert SpecGen values to be nullable where possible 2024-01-30 10:42:24 -05:00
namespaces.go specgen: use storageTypes instead of storage package 2024-01-25 17:21:36 +01:00
namespaces_test.go libpod: Add pasta networking mode 2022-11-08 00:16:35 +01:00
pod_validate.go libpod: Add pasta networking mode 2022-11-08 00:16:35 +01:00
podspecgen.go Add --restart flag to pod create 2023-05-02 10:29:58 -04:00
resources_freebsd.go specgen/generate: Factor out setting resource limits from CompleteSpec 2022-09-08 08:24:18 +01:00
resources_linux.go specgen/generate: Factor out setting resource limits from CompleteSpec 2022-09-08 08:24:18 +01:00
specgen.go Convert SpecGen values to be nullable where possible 2024-01-30 10:42:24 -05:00
specgen_local.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
specgen_remote.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
specgen_test.go Convert SpecGen values to be nullable where possible 2024-01-30 10:42:24 -05:00
utils.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
utils_linux.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
volumes.go add support for subpath in play kube for named volumes 2022-12-12 09:54:00 -05:00
winpath.go pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
winpath_linux.go refactor(machine): improve machine marker value 2023-11-28 21:47:12 +08:00
winpath_unsupported.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
winpath_windows.go Implements Windows volume/mount support 2022-04-25 13:52:27 -05:00