moby--moby/integration-cli
Sebastiaan van Stijn 45067cda33
client: remove wrapResponseError()
The wrapResponseError() utility converted some specific errors, but in
doing so, could hide the actual error message returned by the daemon.
In addition, starting with 38e6d474af,
HTTP status codes were already mapped to their corresponding errdefs
types on the client-side, making this conversion redundant.

This patch removes the wrapResponseError() utility; it's worth noting
that some error-messages will change slightly (as they now return the
error as returned by the daemon), but may cointain more details as
before, and in some cases prevents hiding the actual error.

Before this change:

    docker container rm nosuchcontainer
    Error: No such container: nosuchcontainer

    docker container cp mycontainer:/no/such/path .
    Error: No such container:path: mycontainer:/no/such/path

    docker container cp ./Dockerfile mycontainer:/no/such/path
    Error: No such container:path: mycontainer:/no/such

    docker image rm nosuchimage
    Error: No such image: nosuchimage

    docker network rm nosuchnetwork
    Error: No such network: nosuchnetwork

    docker volume rm nosuchvolume
    Error: No such volume: nosuchvolume

    docker plugin rm nosuchplugin
    Error: No such plugin: nosuchplugin

    docker checkpoint rm nosuchcontainer nosuchcheckpoint
    Error response from daemon: No such container: nosuchcontainer

    docker checkpoint rm mycontainer nosuchcheckpoint
    Error response from daemon: checkpoint nosuchcheckpoint does not exist for container mycontainer

    docker service rm nosuchservice
    Error: No such service: nosuchservice

    docker node rm nosuchnode
    Error: No such node: nosuchnode

    docker config rm nosuschconfig
    Error: No such config: nosuschconfig

    docker secret rm nosuchsecret
    Error: No such secret: nosuchsecret

After this change:

    docker container rm nosuchcontainer
    Error response from daemon: No such container: nosuchcontainer

    docker container cp mycontainer:/no/such/path .
    Error response from daemon: Could not find the file /no/such/path in container mycontainer

    docker container cp ./Dockerfile mycontainer:/no/such/path
    Error response from daemon: Could not find the file /no/such in container mycontainer

    docker image rm nosuchimage
    Error response from daemon: No such image: nosuchimage:latest

    docker network rm nosuchnetwork
    Error response from daemon: network nosuchnetwork not found

    docker volume rm nosuchvolume
    Error response from daemon: get nosuchvolume: no such volume

    docker plugin rm nosuchplugin
    Error response from daemon: plugin "nosuchplugin" not found

    docker checkpoint rm nosuchcontainer nosuchcheckpoint
    Error response from daemon: No such container: nosuchcontainer

    docker checkpoint rm mycontainer nosuchcheckpoint
    Error response from daemon: checkpoint nosuchcheckpoint does not exist for container mycontainer

    docker service rm nosuchservice
    Error response from daemon: service nosuchservice not found

    docker node rm nosuchnode
    Error response from daemon: node nosuchnode not found

    docker config rm nosuchconfig
    Error response from daemon: config nosuchconfig not found

    docker secret rm nosuchsecret
    Error response from daemon: secret nosuchsecret not found

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-20 19:04:52 +01:00
..
checker bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
cli TestPushMultipleTags: Add support for 20.10 CLI 2021-03-18 19:26:17 +00:00
daemon integration-cli: remove some redundant fmt.Sprintf()'s 2022-02-15 12:50:21 +01:00
environment testutil: make testing packages public 2019-09-11 07:47:23 -05:00
fixtures run shfmt 2020-03-03 12:27:49 +09:00
requirement integration-cli: make testRequires() a Helper 2019-10-09 21:44:22 +02:00
testdata
benchmark_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
check_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08: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 Merge pull request #40595 from sfzhu93/GL_2_25 2020-05-08 16:00:52 +02:00
docker_api_build_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_api_build_windows_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
docker_api_containers_test.go client: remove wrapResponseError() 2022-03-20 19:04:52 +01:00
docker_api_containers_unix_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
docker_api_containers_windows_test.go Windows: require Windows Server RS5 / ltsc2019 (build 17763) as minimum 2022-02-18 22:58:28 +01:00
docker_api_exec_resize_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_api_exec_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_api_images_test.go Windows: require Windows Server RS5 / ltsc2019 (build 17763) as minimum 2022-02-18 22:58:28 +01:00
docker_api_inspect_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_api_logs_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_api_network_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_api_stats_test.go Windows CI: Add support for testing with containerd 2021-08-17 07:09:40 -07:00
docker_api_swarm_node_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
docker_api_swarm_service_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
docker_api_swarm_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_api_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_cli_attach_test.go test: add buffer to prevent goroutine leak 2020-02-27 21:37:26 -05:00
docker_cli_attach_unix_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_cli_build_test.go remove unneeded "digest" alias for "go-digest" 2022-03-04 14:49:42 +01:00
docker_cli_build_unix_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_cli_by_digest_test.go remove unneeded "digest" alias for "go-digest" 2022-03-04 14:49:42 +01:00
docker_cli_commit_test.go Windows CI: Add support for testing with containerd 2021-08-17 07:09:40 -07:00
docker_cli_cp_from_container_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_cli_cp_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_cli_cp_to_container_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_cli_cp_to_container_unix_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
docker_cli_cp_utils_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_cli_create_test.go some cleaning up of isolation checks, and platform information 2022-02-18 22:58:37 +01:00
docker_cli_daemon_plugins_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
docker_cli_daemon_test.go integration-cli: use unique names for custom bridges 2022-01-06 18:28:19 +01:00
docker_cli_events_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_cli_events_unix_test.go integration(-cli): remove discovery related tests 2022-01-06 18:28:13 +01:00
docker_cli_exec_test.go test: add buffer to prevent goroutine leak 2020-02-27 21:37:26 -05:00
docker_cli_exec_unix_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
docker_cli_external_volume_driver_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_cli_health_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_cli_history_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_cli_images_test.go filters: lowercase error 2022-03-18 09:44:53 +01:00
docker_cli_import_test.go integration-cli: TestImportBadURL: use proper rfc6761 "invalid domain" 2022-01-24 17:00:57 +01:00
docker_cli_info_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_cli_info_unix_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
docker_cli_inspect_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_cli_links_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_cli_login_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_cli_logout_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_cli_logs_bench_test.go rm-gocheck: run goimports to compile successfully 2019-09-09 21:06:12 +00:00
docker_cli_logs_test.go test: add buffer to prevent goroutine leak 2020-02-27 21:37:26 -05:00
docker_cli_netmode_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_cli_network_test.go Setup tests 2019-09-09 21:09:57 +00:00
docker_cli_network_unix_test.go TestConntrackFlowsLeak: use busybox "nc" 2021-11-19 09:27:12 +01:00
docker_cli_plugins_logdriver_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_cli_plugins_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_cli_port_test.go vendor: docker/libnetwork b3507428be5b458cb0e2b4086b13531fb0706e46 2021-03-25 00:19:35 +01:00
docker_cli_proxy_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_cli_prune_unix_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_cli_ps_test.go filters: lowercase error 2022-03-18 09:44:53 +01:00
docker_cli_pull_local_test.go remove unneeded "digest" alias for "go-digest" 2022-03-04 14:49:42 +01:00
docker_cli_pull_test.go remove unneeded "digest" alias for "go-digest" 2022-03-04 14:49:42 +01:00
docker_cli_push_test.go integration-cli: remove manifest v2 schema 1 push tests 2021-11-18 12:26:13 +01: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 some cleaning up of isolation checks, and platform information 2022-02-18 22:58:37 +01:00
docker_cli_rmi_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_cli_run_test.go Merge pull request #43264 from thaJeztah/fix_TestSlowStdinClosing 2022-03-03 21:22:41 +01:00
docker_cli_run_unix_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_cli_save_load_test.go remove unneeded "digest" alias for "go-digest" 2022-03-04 14:49:42 +01:00
docker_cli_save_load_unix_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_cli_search_test.go filters: lowercase error 2022-03-18 09:44:53 +01:00
docker_cli_service_create_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
docker_cli_service_health_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
docker_cli_service_logs_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
docker_cli_service_scale_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
docker_cli_sni_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
docker_cli_start_test.go Windows: require Windows Server RS5 / ltsc2019 (build 17763) as minimum 2022-02-18 22:58:28 +01:00
docker_cli_stats_test.go test: add buffer to prevent goroutine leak 2020-02-27 21:37:26 -05:00
docker_cli_swarm_test.go integration(-cli): remove discovery related tests 2022-01-06 18:28:13 +01:00
docker_cli_swarm_unix_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
docker_cli_top_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
docker_cli_update_unix_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
docker_cli_userns_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08: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 filters: lowercase error 2022-03-18 09:44:53 +01:00
docker_deprecated_api_v124_test.go Set minimum memory limit to 6M, to account for higher startup memory use 2020-07-01 13:29:07 +02:00
docker_deprecated_api_v124_unix_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +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: remove some redundant fmt.Sprintf()'s 2022-02-15 12:50:21 +01: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 some cleaning up of isolation checks, and platform information 2022-02-18 22:58:37 +01:00
requirements_unix_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
test_vars_noseccomp_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
test_vars_seccomp_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
test_vars_test.go
test_vars_unix_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
test_vars_windows_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +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