spiegel_podman/pkg
Matt Heon 023a354de7 Remove Libpod special-init conditions
Before this, for some special Podman commands (system reset,
system migrate, system renumber), Podman would create a first
Libpod runtime to do initialization and flag parsing, then stop
that runtime and create an entirely new runtime to perform the
actual task. This is an artifact of the pre-Podman 2.0 days, when
there was almost no indirection between Libpod and the CLI, and
we only used one runtime because we didn't need a second runtime
for flag parsing and basic init.

This system was clunky, and apparently, very buggy. When we
migrated to SQLite, some logic was introduced where we'd select a
different database location based on whether or not Libpod's
StaticDir was manually set - which differed between the first
invocation of Libpod and the second. So we'd get a different
database for some commands (like `system reset`) and they would
not be able to see existing containers, meaning they would not
function properly.

The immediate cause is obviously the SQLite behavior, but I'm
certain there's a lot more baggage hiding behind this multiple
Libpod runtime logic, so let's just refactor it out. It doesn't
make sense, and complicates the code. Instead, make Reset,
Renumber, and Migrate methods of the libpod Runtime. For Reset
and Renumber, we can shut the runtime down afterwards to achieve
the desired effect (no valid runtime after). Then pipe all of
them through the ContainerEngine so cmd/podman can access them.

As part of this, remove the SystemEngine part of pkg/domain. This
was supposed to encompass these "special" commands, but every
command in SystemEngine is actually a ContainerEngine command.
Reset, Renumber, Migrate - they all need a full Libpod and access
to all containers. There's no point to a separate engine if it
just wraps Libpod in the exact same way as ContainerEngine. This
consolidation saves us a bit more code and complexity.

Signed-off-by: Matt Heon <mheon@redhat.com>

<MH: Fixed cherry-pick conflicts for v4.8 branch>

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-01-15 12:14:17 -05:00
..
annotations Remove ReservedAnnotations from kube generate specification 2023-01-18 08:46:24 -05:00
api Automatic code cleanups - JetBrains 2023-11-07 14:05:15 -06:00
auth fix(deps): update module github.com/docker/docker to v24 2023-05-22 15:32:12 +02:00
autoupdate pkg/autoupdate: add !remote tag 2023-10-24 12:11:10 +02:00
bindings pkg/bindings: add new APIVersionError error type 2023-12-01 10:00:07 +00:00
channel bump golangci-lint to v1.50.1 2022-12-15 13:39:56 +01:00
checkpoint Merge pull request #19951 from Luap99/small-remote 2023-09-14 15:27:45 +02:00
copy pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
criu lint: fix warnings found by protogetter 2023-10-20 16:26:10 +02:00
ctime Replace deprecated ioutil 2022-09-20 15:34:27 -04:00
domain Remove Libpod special-init conditions 2024-01-15 12:14:17 -05:00
emulation Add podman farm build command 2023-10-24 12:58:39 -04:00
env Revert "feat(env): support multiline in env-file" 2023-10-04 17:06:21 +02:00
errorhandling Fix typos 2023-02-11 18:23:24 +01:00
farm Add podman farm build command 2023-10-24 12:58:39 -04:00
fileserver Initial addition of 9p code to Podman 2023-10-31 10:14:02 -04:00
inspect pkg/inspect: remove unused ImageResult type 2022-05-24 16:07:39 +02:00
k8s.io Automatic code cleanups - JetBrains 2023-11-07 14:05:15 -06:00
lookup source code comments and docs: fix typos, language, Markdown layout 2023-05-22 07:52:16 +02:00
machine feat: disable pid max in the podman machine 2024-01-10 11:20:39 -05:00
namespaces source code comments and docs: fix typos, language, Markdown layout 2023-05-22 07:52:16 +02:00
parallel pkg/parallel/ctr: add !remote tag 2023-10-24 12:23:17 +02:00
ps pkg/ps: add !remote tag 2023-10-24 12:21:31 +02:00
rctl pkg/rctl: Remove unused cgo dependency 2022-10-31 15:13:48 +00:00
rootless rootless: use functionalities from c/storage 2023-11-10 22:03:47 +01:00
seccomp pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
selinux Fix SELinux functions names to not be repetitive 2020-04-23 15:57:34 -04:00
signal Run codespell on code 2022-11-04 10:57:41 -04:00
specgen Merge pull request #19879 from rhatdan/ulimits 2023-11-10 10:47:43 +00:00
specgenutil Merge pull request #20149 from ygalblum/quadlet-container-mount 2023-09-28 05:38:52 -04:00
specgenutilexternal Quadlet container mount - support non key=val options 2023-09-27 16:20:00 +03:00
strongunits introduce pkg/strongunits 2023-09-20 11:19:41 -05:00
systemd Quadlet - add support for UID and GID Mapping 2023-11-15 12:10:22 +02:00
terminal podman ssh work, using new c/common interface 2022-08-09 14:00:58 -04:00
timetype lint: fix warnings found by perfsprint 2023-10-20 16:27:46 +02:00
trust Revert the usage of home.GetConfigHome() 2023-07-17 18:29:06 +02:00
util Change to using gopsutil for cross-OS process ops 2023-10-31 10:14:06 -04:00