spiegel_podman/libpod
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
..
define Add podman farm build command 2023-10-24 12:58:39 -04:00
driver bump go module to version 4 2022-01-18 12:47:07 +01:00
events Run codespell on podman 2023-11-06 09:23:16 -06:00
layers Initial checkin from CRI-O repo 2017-11-01 11:24:59 -04:00
linkmode go fmt: use go 1.18 conditional-build syntax 2022-03-18 09:11:53 +01:00
lock lint: fix warnings found by perfsprint 2023-10-20 16:27:46 +02:00
logs file logger: fix podman logs --tail with partial lines 2023-08-09 14:48:01 +02:00
plugin bump golangci-lint to v1.49.0 2022-10-17 09:19:41 +02:00
shutdown play kube: Add --wait option 2023-02-28 13:45:36 -05:00
boltdb_state.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
boltdb_state_internal.go Handle symlinks when checking DB vs runtime configs 2023-12-03 11:50:47 +00:00
common_test.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container.go libpod: Detect whether we have a private UTS namespace on FreeBSD 2023-12-01 17:24:06 +00:00
container_api.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_commit.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_config.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_copy_common.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_copy_freebsd.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_copy_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_exec.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_freebsd.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_graph.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_graph_test.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_inspect.go Automatic code cleanups - JetBrains 2023-11-07 14:05:15 -06:00
container_inspect_freebsd.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_inspect_linux.go container.conf: support attributed string slices 2023-10-27 12:44:33 +02:00
container_internal.go Merge pull request #20369 from cgiradkar/Issue-16759-docs 2023-10-30 10:22:00 +00:00
container_internal_common.go Merge pull request #19879 from rhatdan/ulimits 2023-11-10 10:47:43 +00:00
container_internal_freebsd.go libpod: Detect whether we have a private UTS namespace on FreeBSD 2023-12-01 17:24:06 +00:00
container_internal_linux.go libpod: Detect whether we have a private UTS namespace on FreeBSD 2023-12-01 17:24:06 +00:00
container_internal_linux_test.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_internal_test.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_log.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_log_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_log_unsupported.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_path_resolution.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_path_resolution_test.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_stat_common.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_stat_freebsd.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_stat_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_top_freebsd.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_top_linux.c libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_top_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_top_unsupported.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
container_validate.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
diff.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
doc.go document that using libpod package directly is not supported 2022-03-23 19:05:29 +01:00
events.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
healthcheck.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
healthcheck_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
healthcheck_nosystemd_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
healthcheck_unsupported.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
info.go Add podman farm build command 2023-10-24 12:58:39 -04:00
info_freebsd.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
info_linux.go vendor: update c/common 2023-11-02 19:46:22 +01:00
info_test.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
kube.go container.conf: support attributed string slices 2023-10-27 12:44:33 +02:00
mounts_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
networking_common.go container.conf: support attributed string slices 2023-10-27 12:44:33 +02:00
networking_freebsd.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
networking_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
networking_linux_test.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
networking_machine.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
networking_pasta_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
networking_slirp4netns.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
oci.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
oci_conmon.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
oci_conmon_attach_common.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
oci_conmon_attach_freebsd.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
oci_conmon_attach_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
oci_conmon_common.go container.conf: support attributed string slices 2023-10-27 12:44:33 +02:00
oci_conmon_exec_common.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
oci_conmon_exec_freebsd.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
oci_conmon_exec_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
oci_conmon_freebsd.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
oci_conmon_linux.go Support passing of Ulimits as -1 to mean max 2023-11-01 08:46:55 -04:00
oci_missing.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
oci_util.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
options.go Remove Libpod special-init conditions 2024-01-15 12:14:17 -05:00
pod.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
pod_api.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
pod_internal.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
pod_internal_freebsd.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
pod_internal_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
pod_status.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
pod_top_freebsd.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
pod_top_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
reset.go Remove Libpod special-init conditions 2024-01-15 12:14:17 -05:00
rlimit_int64.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
rlimit_uint64.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
runtime.go Remove Libpod special-init conditions 2024-01-15 12:14:17 -05:00
runtime_cstorage.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
runtime_ctr.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
runtime_ctr_freebsd.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
runtime_ctr_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
runtime_img.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
runtime_migrate_linux.go Remove Libpod special-init conditions 2024-01-15 12:14:17 -05:00
runtime_migrate_unsupported.go Remove Libpod special-init conditions 2024-01-15 12:14:17 -05:00
runtime_pod.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
runtime_pod_common.go libpod: make removePodCgroup linux specific 2023-11-02 14:55:33 +01:00
runtime_pod_freebsd.go libpod: make removePodCgroup linux specific 2023-11-02 14:55:33 +01:00
runtime_pod_linux.go libpod: make removePodCgroup linux specific 2023-11-02 14:55:33 +01:00
runtime_pre_go1.20.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
runtime_renumber.go Remove Libpod special-init conditions 2024-01-15 12:14:17 -05:00
runtime_test.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
runtime_volume.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
runtime_volume_common.go Merge pull request #20451 from rhatdan/volume 2023-10-24 15:40:50 +00:00
runtime_worker.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
service.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
sqlite_state.go Handle symlinks when checking DB vs runtime configs 2023-12-03 11:50:47 +00:00
sqlite_state_internal.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
state.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
state_test.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
stats_common.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
stats_freebsd.go freebsd: drop dead code 2023-11-02 14:55:33 +01:00
stats_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
storage.go image: replace GetStoreImage with ResolveReference 2023-11-02 11:22:02 +05:30
util.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
util_freebsd.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
util_linux.go vendor: update c/common 2023-11-02 19:46:22 +01:00
util_linux_test.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
util_test.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
volume.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
volume_inspect.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
volume_internal.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
volume_internal_common.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
volume_internal_freebsd.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00
volume_internal_linux.go libpod: add !remote tag 2023-10-24 12:11:34 +02:00