Commit Graph

45 Commits

Author SHA1 Message Date
Amine Chouki 5c427ef702 Move pat_suggest.go into `cli` package
Signed-off-by: Amine Chouki <amine.chouki@docker.com>
2021-07-23 10:55:31 -04:00
Amine Chouki 906e1b4305 Add a post-login message to promote personal access tokens
Signed-off-by: Amine Chouki <amine.chouki@docker.com>
2021-07-22 16:58:00 -04:00
Mathieu Champlon 313de1de4a Look for docker cli next to the current executable
Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
2021-06-22 10:39:04 +02:00
Nicolas De Loof 49e7f2d45d Move compose v2 implementation under pkg/compose with dependencies
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-06-15 15:52:48 +02:00
Sebastiaan van Stijn b4c8a9dc5f
mobycli: ignore SIGURG on Linux and Darwin
Equivalent of fff164c22e
and cedaf44ea2

In go1.14+, SIGURG is used by the runtime to handle preemtable system calls.
In practice this signal is caught *frequently*.

For reference:

https://go.googlesource.com/proposal/+/master/design/24543-non-cooperative-preemption.md
golang/go#37942

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-07 12:44:55 +02:00
Guillaume Tardif 0496f29a53 Display PATH when not finding com.docker.cli, to help debugging
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-05-03 14:55:41 +02:00
Nicolas De Loof db38d1244c
Retrieve compose failure category by exit code
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-04-22 18:01:28 +02:00
Nicolas De loof 0b968395dd
Merge pull request #1516 from docker/version_json
don't include stderr in moby exec output
2021-04-13 15:43:27 +02:00
Nicolas De Loof 4916b36b99
don't include stderr in moby exec output
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-04-13 15:35:26 +02:00
Chris Crone 411612ed8d Fix scan message with quiet flag
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2021-04-13 14:30:27 +02:00
Guillaume Tardif 6465bfec82 track cancel exit code from docker cli shellout to report correct status in metrics
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-04-06 10:19:27 +02:00
Guillaume Tardif 2b1158f4c2 Adapt cli/mobycli to avoid duplicating shellout code
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-03-30 13:45:05 +02:00
Guillaume Tardif 435a51f9e4 Add scan message after docker build, add e2e tests
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-03-29 19:12:06 +02:00
Nicolas De Loof 48402585fd
replace passing parameters by context with singletons
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-03-12 15:28:17 +01:00
Guillaume Tardif 0ea97920c1 Move Context & context/store => api/context & api/context/store
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-15 16:31:59 +01:00
Guillaume Tardif 65f53dff43 move metrics => cli
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-15 15:26:35 +01:00
Guillaume Tardif f55823b70f Make Moby command detection (based on help output) more robust. It seems some tabs have been replaced by spaces in CLI 20.10. Covered with e2e test TestUnsupportedCommand.
We need to install docker CLI ourselves in Github actions nodes.

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2020-12-15 12:32:13 +01:00
Guillaume Tardif 66a1263342 No specific case for windows, always resolve binary name before executing command
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-11-05 17:38:03 +01:00
Guillaume Tardif 41a1553dab No specific case for windows, always resolve binary name before executing command
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-11-05 17:31:26 +01:00
guillaume.tardif 4489f39e5d duplicate windows os/exec.LookPath() and do not resolve files in current working dir if CWD is not explicitly in PATH.
Signed-off-by: guillaume.tardif <guillaume.tardif@gmail.com>
2020-11-05 16:43:17 +01:00
Guillaume Tardif 0d3f7186c5 Hardcoded list of commands and simplified metrics gathering.
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-10-08 11:59:12 +02:00
Ulysses Souza 8961805412 Add json output format to several commands
- docker context ls
- docker ps
- docker compose ls
- docker compose ps
- docker secret ls
- docker volume ls
- docker version

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-10-01 15:41:18 +02:00
Guillaume Tardif 8302266212 In metrics, send context type, not context name (metrics for Moby calls)
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-09-23 16:12:09 +02:00
Chris Crone d154c41586 Update copyright
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-09-22 12:13:00 +02:00
Guillaume Tardif a71b2a39bd Add status field in API metrics
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-09-18 15:22:34 +02:00
Guillaume Tardif 3ccc603461 Add status field in CLI metrics : success, failure, cancelled
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-09-18 10:47:50 +02:00
Guillaume Tardif adeba9b124 Fix bug not allowing users to run any context command when set to an aws context type.
When users have an “aws" context type, we try to exec the command (will execute context ls, context use, etc.) and when it fails because it doesn’t find the aws backend, then display the custom error for aws context type.

Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-09-04 11:01:55 +02:00
Chris Crone 4c6280b0e9 Rename docker/api -> docker/compose-cli
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-08-21 17:28:39 +02:00
Guillaume Tardif 4c3b563182 ECS context type is not for delegation to Moby !
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-08-21 14:32:46 +02:00
Guillaume Tardif b060d8acfc Do not display warning if cannot forward signal to child. See https://github.com/docker/pinata/pull/14327 2020-08-13 14:06:52 +02:00
Djordje Lukic 88c405e025 Use buffered channels for signals 2020-08-13 10:34:42 +02:00
Guillaume Tardif cdd4028788 Fix flaky nil pointer in signal forwarding to child process (see https://github.com/docker/api/runs/949400778) 2020-08-06 10:23:12 +02:00
Guillaume Tardif 29fe26620a Stop forwarding signals to child process when the child terminates 2020-08-05 15:05:32 +02:00
Guillaume Tardif 05a8582126 Forward all signals to child process 2020-08-05 15:05:32 +02:00
aiordache d1b8bcb2c7 fix signal passing to mobycli
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-08-05 15:05:32 +02:00
aiordache 87245ef727 rename packages ( amazon to ecs and azure to aci )
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-07-30 11:34:34 +02:00
aiordache 355295696f Create aws context
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-07-30 11:34:34 +02:00
Djordje Lukic 98976e4cb4 Cleanup entrypoint
* use the `fatal` function when we can
* rename moby.ExecRegardlessContext to Exec
2020-06-26 10:23:37 +02:00
Guillaume Tardif 839b1b0b44 Delegate to Moby CLI, to allow executing ecs CLI plugin if user has switched to the AWS context (created by the plugin) 2020-06-25 11:49:28 +02:00
Guillaume Tardif 38d4f8d25a Shell out to Moby cli if user uses -H, regardless of context set. Moby cli will refuse both options (context & host) to be set at the same time 2020-06-23 12:00:46 +02:00
Djordje Lukic ad72c866cc Add license headers 2020-06-18 16:48:03 +02:00
Guillaume Tardif ab3cd0fec1 Renamed ExecIfDefaultCtxType for more explicit behaviour 2020-06-18 09:29:01 +02:00
Guillaume Tardif 3981244701 Fix bug where we shell out to Moby cli only if context == default. We must shell out to Moby cli for any context of type “Moby”, not only the default context. 2020-06-18 09:25:28 +02:00
Guillaume Tardif fe57e4c159 Fix a bug where calling login, context inspect did not do anything if not on default context. These command will shell out to Moby cli regardless of current context 2020-06-18 09:25:28 +02:00
Guillaume Tardif bbcdad39d5 Renamed docker-classic to “com.docker.com”. 2020-06-17 17:57:53 +02:00