podman/test/e2e
Matthew Heon e19e0de5fa Introduce graph-based pod container removal
Originally, during pod removal, we locked every container in the
pod at once, did a number of validity checks to ensure everything
was safe, and then removed all the containers in the pod.

A deadlock was recently discovered with this approach. In brief,
we cannot lock the entire pod (or much more than a single
container at a time) without causing a deadlock. As such, we
converted to an approach where we just looped over each container
in the pod, removing them individually. Unfortunately, this
removed a lot of the validity checking of the earlier approach,
allowing for a lot of unintended bad things. Infra containers
could be removed while containers in the pod still depended on
them, for example.

There's no easy way to do validity checks while in a simple loop,
so I implemented a version of our graph-traversal logic that
currently handles pod start. This version acts in the reverse
order of startup: startup starts from containers which depend on
nothing and moves outwards, while removal acts on containers which
have nothing depend on them and moves inwards. By doing graph
traversal, we can guarantee that nothing is removed while
something that depends on it still exists - so the infra
container should be the last thing in a pod that is removed, for
example.

In the (unlikely) case that a graph of the pod's containers
cannot be built (most likely impossible without database editing)
the old method of pod removal has been retained to ensure that
even misbehaving pods can be forcibly evicted from the state.

I'm fairly confident that this resolves the problem, but there
are a lot of assumptions around dependency structure built into
the original pod removal code and I am not 100% sure I have
captured all of them.

Fixes #15526

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2022-09-14 13:44:48 -04:00
..
build remote: fix implementation of build with --userns=auto for API 2022-08-26 16:53:40 +05:30
cdi Add support for CDI device configuration 2021-04-20 09:18:52 -04:00
config Add support for containers.conf volume timeouts 2022-08-23 15:42:00 -04:00
sign fix e2e sign tests 2022-08-01 16:21:55 +02:00
testdata Add support for creating sigstore signatures, and providing passphrases 2022-07-30 17:26:08 +02:00
attach_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
benchmarks_test.go refactor: use `os.ReadDir` for lightweight directory reading 2022-09-11 15:58:31 +08:00
build_test.go Bump VMs, to Ubuntu 2204 with cgroups v1 2022-07-21 20:08:32 -06:00
checkpoint_image_test.go Bump VMs, to Ubuntu 2204 with cgroups v1 2022-07-21 20:08:32 -06:00
checkpoint_test.go I believe that these tests will now run with crun. 2022-08-09 15:41:33 -04:00
cleanup_test.go Output messages display rawInput 2022-08-02 18:28:37 +09:00
commit_test.go e2e tests: cleanup: capitalize CONSTANTS 2022-07-05 15:36:08 -06:00
common_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
config.go e2e tests: cleanup: capitalize CONSTANTS 2022-07-05 15:36:08 -06:00
config_amd64.go Update the registry server we test against from 2.6 to 2.8 2022-07-30 17:24:31 +02:00
config_arm64.go Update the registry server we test against from 2.6 to 2.8 2022-07-30 17:24:31 +02:00
config_ppc64le.go e2e tests: cleanup: capitalize CONSTANTS 2022-07-05 15:36:08 -06:00
container_clone_test.go Merge pull request #15415 from cdoern/clone 2022-08-23 11:04:31 -04:00
container_create_volume_test.go refactor: use `os.ReadDir` for lightweight directory reading 2022-09-11 15:58:31 +08:00
container_inspect_test.go e2e tests: cleanup: capitalize CONSTANTS 2022-07-05 15:36:08 -06:00
containers_conf_test.go Semiperiodoc cleanup of obsolete FIXMEs 2022-07-25 13:08:35 -06:00
cp_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
create_staticip_test.go Fix spelling "setup" -> "set up" and similar 2022-06-22 18:39:21 +02:00
create_staticmac_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
create_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
diff_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
events_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
exec_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
exists_test.go bump go module to version 4 2022-01-18 12:47:07 +01:00
export_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
generate_kube_test.go generate, kube: plug HostUsers 2022-09-08 22:55:52 +02:00
generate_spec_test.go Warning messages are printed and ignored if we use an unsupported option 2022-08-23 11:54:31 +09:00
generate_systemd_test.go Merge pull request #15777 from vrothberg/fix-14546 2022-09-14 13:08:04 +02:00
healthcheck_run_test.go inspect, image: alias .Config.HealthCheck to .HealthCheck for compatibility 2022-08-23 13:39:01 +05:30
history_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
image_scp_test.go podman ssh work, using new c/common interface 2022-08-09 14:00:58 -04:00
image_sign_test.go refactor: use `os.ReadDir` for lightweight directory reading 2022-09-11 15:58:31 +08:00
images_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
import_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
info_test.go Bump VMs, to Ubuntu 2204 with cgroups v1 2022-07-21 20:08:32 -06:00
init_test.go Output messages display rawInput 2022-08-02 18:28:37 +09:00
inspect_test.go e2e tests: cleanup: capitalize CONSTANTS 2022-07-05 15:36:08 -06:00
kill_test.go Bump VMs, to Ubuntu 2204 with cgroups v1 2022-07-21 20:08:32 -06:00
libpod_suite_remote_test.go integration test: fix network backend option with remote 2022-07-22 15:29:18 +02:00
libpod_suite_test.go manifest_test: safer registry setup and teardown 2022-07-07 14:03:42 -06:00
load_test.go enable gocritic linter 2022-04-26 18:12:22 +02:00
login_logout_test.go Use existing REGISTRY_IMAGE variables in more places 2022-07-30 17:23:38 +02:00
logs_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
manifest_test.go refactor: use `os.ReadDir` for lightweight directory reading 2022-09-11 15:58:31 +08:00
mount_rootless_test.go Cirrus: Fix e2e tests for "mount_rootless_test" 2022-08-03 17:01:18 +09:00
mount_test.go bump go module to version 4 2022-01-18 12:47:07 +01:00
namespace_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
negative_test.go bump go module to version 4 2022-01-18 12:47:07 +01:00
network_connect_disconnect_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
network_create_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
network_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
pause_test.go Add pause/unpause --latest, --cidfile, --filter 2022-07-20 19:30:11 +09:00
play_build_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
play_kube_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
pod_clone_test.go [minor] fix duplicate test name 2022-07-07 11:23:17 -06:00
pod_create_test.go Bump VMs, to Ubuntu 2204 with cgroups v1 2022-07-21 20:08:32 -06:00
pod_infra_container_test.go pod create --share none should not create infra 2022-07-25 13:11:06 -04:00
pod_initcontainers_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
pod_inspect_test.go fix podman pod inspect to support multiple pods 2022-09-08 10:28:42 +02:00
pod_kill_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
pod_pause_test.go Fix podman pod unpaue TODO 2022-07-05 10:32:49 -04:00
pod_pod_namespaces_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
pod_prune_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
pod_ps_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
pod_restart_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
pod_rm_test.go Introduce graph-based pod container removal 2022-09-14 13:44:48 -04:00
pod_start_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
pod_stats_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
pod_stop_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
pod_top_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
port_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
prune_test.go prune filter handling 2022-07-25 09:28:26 -04:00
ps_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
pull_test.go Add ProgressWriter to PullOptions 2022-08-19 00:41:22 +03:00
push_test.go refactor: use `os.ReadDir` for lightweight directory reading 2022-09-11 15:58:31 +08:00
rename_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
restart_test.go Run codespell 2022-08-25 16:32:31 -04:00
rm_test.go Add rm --filter option 2022-07-30 10:59:59 +09:00
rmi_test.go remove image podman no prune 2022-08-04 14:55:03 -04:00
run_aardvark_test.go e2e tests: cleanup: capitalize CONSTANTS 2022-07-05 15:36:08 -06:00
run_apparmor_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
run_cgroup_parent_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
run_cleanup_test.go e2e: Add rootless mount cleanup test 2022-08-05 12:01:51 +09:00
run_cpu_test.go Ignore cpu realtime options on cgroups V2 systems 2022-09-09 17:33:43 +09:00
run_device_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
run_dns_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
run_entrypoint_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
run_env_test.go Merge pull request #15434 from rhatdan/manifest1 2022-08-24 13:29:20 -04:00
run_exit_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
run_memory_test.go e2e: Add run --memory-swap test 2022-08-24 18:15:21 +09:00
run_networking_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
run_ns_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
run_passwd_test.go libpod: create /etc/passwd if missing 2022-07-21 17:58:16 +02:00
run_privileged_test.go Privileged containers can now restart if the host devices change 2022-06-06 14:14:22 -04:00
run_restart_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
run_seccomp_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
run_security_labels_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
run_selinux_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
run_signal_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
run_staticip_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
run_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
run_userns_test.go podman: add uid and gid options to keep-id 2022-08-30 14:39:27 +02:00
run_volume_test.go e2e tests: cleanup: capitalize CONSTANTS 2022-07-05 15:36:08 -06:00
run_working_dir_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
runlabel_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
save_test.go e2e tests: try to deflake 5000 2022-08-29 14:11:46 -06:00
search_test.go e2e tests: cleanup: capitalize CONSTANTS 2022-07-05 15:36:08 -06:00
secret_test.go Fixes for vendoring Buildah 2022-09-09 11:59:27 +02:00
start_test.go Merge pull request #15134 from sstosh/improve-output 2022-08-09 06:13:10 +00:00
stats_test.go Add podman stats --no-trunc option 2022-08-17 13:16:01 -04:00
stop_test.go Output messages display rawInput 2022-08-02 18:28:37 +09:00
system_connection_test.go fix system connection and scp testing 2022-06-23 11:26:19 -04:00
system_df_test.go Merge pull request #14805 from jakecorrenti/df-format-output 2022-07-05 13:34:45 +00:00
system_dial_stdio_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
system_reset_test.go Only allow Rootless runs of Podman Machine 2022-06-29 09:19:09 -04:00
system_service_test.go Report correct RemoteURI 2022-05-04 12:11:32 -04:00
systemd_activate_test.go golangci-lint: update to v1.46.2 2022-06-15 19:58:30 +02:00
systemd_test.go e2e tests: cleanup: capitalize CONSTANTS 2022-07-05 15:36:08 -06:00
tag_test.go bump go module to version 4 2022-01-18 12:47:07 +01:00
toolbox_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
top_test.go vendor containers/psgo@v1.7.3 2022-08-24 17:13:58 +02:00
tree_test.go e2e tests: cleanup: capitalize CONSTANTS 2022-07-05 15:36:08 -06:00
trust_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
unshare_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
untag_test.go e2e tests: cleanup: capitalize CONSTANTS 2022-07-05 15:36:08 -06:00
update_test.go implement podman update 2022-09-01 13:02:01 -04:00
version_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
volume_create_test.go Add support for containers.conf volume timeouts 2022-08-23 15:42:00 -04:00
volume_exists_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
volume_inspect_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
volume_ls_test.go podman volume ls: use report.Formatter over Template 2022-09-13 10:33:13 +02:00
volume_plugin_test.go all: stop using deprecated GenerateNonCryptoID 2022-09-13 16:26:26 -07:00
volume_prune_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
volume_rm_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00
wait_test.go enable errcheck linter 2022-04-29 14:06:38 +02:00