moby/integration-cli
Cory Snider 0f6eeecac0 daemon: consolidate runtimes config validation
The daemon has made a habit of mutating the DefaultRuntime and Runtimes
values in the Config struct to merge defaults. This would be fine if it
was a part of the regular configuration loading and merging process,
as is done with other config options. The trouble is it does so in
surprising places, such as in functions with 'verify' or 'validate' in
their name. It has been necessary in order to validate that the user has
not defined a custom runtime named "runc" which would shadow the
built-in runtime of the same name. Other daemon code depends on the
runtime named "runc" always being defined in the config, but merging it
with the user config at the same time as the other defaults are merged
would trip the validation. The root of the issue is that the daemon has
used the same config values for both validating the daemon runtime
configuration as supplied by the user and for keeping track of which
runtimes have been set up by the daemon. Now that a completely separate
value is used for the latter purpose, surprising contortions are no
longer required to make the validation work as intended.

Consolidate the validation of the runtimes config and merging of the
built-in runtimes into the daemon.setupRuntimes() function. Set the
result of merging the built-in runtimes config and default default
runtime on the returned runtimes struct, without back-propagating it
onto the config.Config argument.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-06-01 14:45:25 -04:00
..
checker bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
cli integration-cli: remove cli.Build(), cli.Inspect() 2022-12-28 09:25:27 +01:00
daemon integration-cli: update error-assertions in tests 2023-05-10 22:13:50 +02:00
environment testutil: make testing packages public 2019-09-11 07:47:23 -05:00
fixtures integration-cli: fix test rogue certs 2022-05-19 10:54:31 +02:00
requirement integration-cli: make testRequires() a Helper 2019-10-09 21:44:22 +02:00
testdata Clean some integration-cli/fixtures package/files 2018-04-16 10:48:58 +02:00
benchmark_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
check_test.go [chore] clean up reexec.Init() calls 2023-05-09 19:13:17 -04:00
daemon_swarm_hack_test.go rm-gocheck: run goimports to compile successfully 2019-09-09 21:06:12 +00:00
docker_api_attach_test.go integration-cli: rename vars that collided with imports 2023-04-03 20:01:05 +02:00
docker_api_build_test.go integration-cli: fix empty-lines (revive) 2022-09-28 01:58:49 +02:00
docker_api_build_windows_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_api_containers_test.go integration-cli: update error-assertions in tests 2023-05-10 22:13:50 +02:00
docker_api_containers_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_api_containers_windows_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_api_exec_resize_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_api_exec_test.go integration-cli: rename vars that collided with imports 2023-04-03 20:01:05 +02:00
docker_api_images_test.go integration-cli: inline filters in tests 2023-04-25 15:14:27 +02:00
docker_api_inspect_test.go integration-cli: rename vars that collided with imports 2023-04-03 20:01:05 +02:00
docker_api_logs_test.go integration-cli: rename vars that collided with imports 2023-04-03 20:01:05 +02:00
docker_api_network_test.go integration-cli: inline filters in tests 2023-04-25 15:14:27 +02:00
docker_api_stats_test.go integration-cli: rename vars that collided with imports 2023-04-03 20:01:05 +02:00
docker_api_swarm_node_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_api_swarm_service_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_api_swarm_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_api_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_attach_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_attach_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_build_test.go integration-cli: remove cli.Build(), cli.Inspect() 2022-12-28 09:25:27 +01:00
docker_cli_build_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_by_digest_test.go integration-cli: fix empty-lines (revive) 2022-09-28 01:58:49 +02:00
docker_cli_commit_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_cp_from_container_test.go gofmt GoDoc comments with go1.19 2022-07-08 19:56:23 +02:00
docker_cli_cp_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_cp_to_container_test.go integration-cli: remove isCpCannotCopyReadOnly utility 2022-09-27 22:15:19 +02:00
docker_cli_cp_to_container_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_cp_utils_test.go integration-cli: remove isCpCannotCopyReadOnly utility 2022-09-27 22:15:19 +02:00
docker_cli_create_test.go remove deprecated devicemapper storage-driver 2023-04-20 23:51:54 +02:00
docker_cli_daemon_plugins_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_daemon_test.go daemon: consolidate runtimes config validation 2023-06-01 14:45:25 -04:00
docker_cli_events_test.go integration-cli: rename vars that collided with imports 2023-04-03 20:01:05 +02:00
docker_cli_events_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_exec_test.go integration-cli: rename vars that collided with imports 2023-04-03 20:01:05 +02:00
docker_cli_exec_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_external_volume_driver_test.go gofmt GoDoc comments with go1.19 2022-07-08 19:56:23 +02:00
docker_cli_health_test.go integration-cli: fix empty-lines (revive) 2022-09-28 01:58:49 +02:00
docker_cli_history_test.go integration-cli: fix empty-lines (revive) 2022-09-28 01:58:49 +02:00
docker_cli_images_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_import_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_info_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_info_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_inspect_test.go remove deprecated devicemapper storage-driver 2023-04-20 23:51:54 +02:00
docker_cli_links_test.go integration-cli: links: use gotest.tools compare and assert.Check 2022-12-21 11:09:02 +01:00
docker_cli_login_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_logout_test.go test: use T.Setenv to set env vars in tests 2022-04-23 17:44:16 +08:00
docker_cli_logs_test.go integration-cli: Fix hanging TestLogsFollowGoroutines* 2023-01-05 18:10:32 +01:00
docker_cli_netmode_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_network_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_network_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_plugins_logdriver_test.go integration-cli: rename vars that collided with imports 2023-04-03 20:01:05 +02:00
docker_cli_plugins_test.go integration-cli: DockerPluginSuite: use gotest.tools compare utilities 2022-11-01 17:27:18 +01:00
docker_cli_port_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_proxy_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_prune_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_prune_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_ps_test.go integration-cli: fix empty-lines (revive) 2022-09-28 01:58:49 +02:00
docker_cli_pull_local_test.go Remove uses of deprecated go-digest.NewDigestFromHex, go-digest.Digest.Hex 2022-11-08 16:42:13 +01:00
docker_cli_pull_test.go integration-cli: fix empty-lines (revive) 2022-09-28 01:58:49 +02:00
docker_cli_push_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_registry_user_agent_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_cli_restart_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_rmi_test.go integration-cli: fix empty-lines (revive) 2022-09-28 01:58:49 +02:00
docker_cli_run_test.go integration-cli: rename vars that collided with imports 2023-04-03 20:01:05 +02:00
docker_cli_run_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_save_load_test.go Remove uses of deprecated go-digest.NewDigestFromHex, go-digest.Digest.Hex 2022-11-08 16:42:13 +01:00
docker_cli_save_load_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_search_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_service_create_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_service_health_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_service_logs_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_service_scale_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_sni_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_start_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_stats_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_swarm_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_swarm_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_top_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_update_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_cli_update_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_userns_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_cli_v2_only_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_cli_volume_test.go integration-cli: rename vars that collided with imports 2023-04-03 20:01:05 +02:00
docker_deprecated_api_v124_test.go integration-cli: split DockerSuite into subsequent build suites 2022-06-17 10:59:04 +02:00
docker_deprecated_api_v124_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
docker_hub_pull_suite_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_utils_test.go integration-cli: rename vars that collided with imports 2023-04-03 20:01:05 +02:00
events_utils_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
fixtures_linux_daemon_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
requirements_test.go remove deprecated devicemapper storage-driver 2023-04-20 23:51:54 +02:00
requirements_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
test_vars_test.go Remove deprecated environment.DaemonPlatform() 2018-01-15 15:32:06 +01:00
test_vars_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
test_vars_windows_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
utils_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
utils_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
utils_windows_test.go pkg/system: move GetLongPathName to integration-cli 2022-11-29 17:02:53 +01:00