Guillaume Tardif
336df897c1
Merge pull request #207 from docker/version_cli
...
version command adding azure integration beta version in textual output
2020-06-15 12:02:33 +02:00
Guillaume Tardif
afa205be95
Server version : will be 1.0.0-beta1, -beta2, …
2020-06-15 11:51:03 +02:00
Guillaume Tardif
98f7a8e1aa
When can not load config file, the previous cli is displaying a WARNING message, but continues with default context, we should do the same.
...
This happened in some desktop e2e tests where the config file is not set properly in WSL2 environment, see
https://github.com/docker/pinata/pull/14062
2020-06-15 11:41:26 +02:00
Guillaume Tardif
dda4b0f3bf
Wrap error cause so that we can understand why the cli cannot determine current context.
...
This happened in Desktop WSL2 tests, we’re blind here : https://ci-next.docker.com/teams-desktop/blue/organizations/jenkins/desktop%2Fdesktop-test-single-pr-win/detail/desktop-test-single-pr-win/120692/pipeline
2020-06-14 19:38:29 +02:00
Guillaume Tardif
376a4b671c
version command adding azure integration beta version in textual output
2020-06-13 10:47:05 +02:00
Guillaume Tardif
f8ea0934f0
Align login success message with old cli (& with “canceled” message)
2020-06-12 14:50:35 +02:00
Guillaume Tardif
3c2eb067bc
Fix typo in DOCKER ENPOINT
2020-06-12 14:50:35 +02:00
Guillaume Tardif
93623dc5aa
Merge pull request #200 from docker/context_store_type
...
Store context type in metadata to make retrocompatibility with previous contexts easier (potentially switching back and forth)
2020-06-11 13:34:05 +02:00
Guillaume Tardif
e7682682fb
Store context type in metadata to make retrocompatibility with previous contexts easier (potentially switching back and forth)
2020-06-10 18:17:48 +02:00
Guillaume Tardif
72bae873c5
Do not delegate to old cli if cobra fails before invoking the PreRun or SetHelp hook that call isOwnCommand(). Find the command from root.Find(args).
...
Tried to use `cmd, err := root.ExecuteC()` but I can’t pass the context like with `root.ExecuteContext(ctx)`, could not find a way without and explicit call to root.Find(args)
2020-06-10 17:25:52 +02:00
Djordje Lukic
8400795caf
Add the store to the gRPC context
...
The contexts service needs it
2020-06-09 12:11:59 +02:00
Djordje Lukic
bb69de1db3
Add context endpoint to set the current context
2020-06-08 16:01:43 +02:00
Djordje Lukic
22d4d250a9
Move the config into own package and outside of cli
2020-06-08 16:01:36 +02:00
Djordje Lukic
67fb49c98c
Merge pull request #179 from rumpl/feat-stream
...
Feat stream
2020-06-08 06:52:56 -07:00
Guillaume Tardif
f1a5f2d6cf
Backend is responsible for generating containers IDs and truncate them if wanted/supported for docker ps
2020-06-08 12:37:33 +02:00
Djordje Lukic
c34d016fdb
Unify protos with client interfaces
...
* change function names in containers.proto
* add streams proto
2020-06-08 09:43:19 +02:00
Guillaume Tardif
f939dd4d47
Display friendly message if unknown command is available in default context
2020-06-05 18:24:08 +02:00
Guillaume Tardif
54141a9bdd
Do not display exit status when classic cli exit in error
2020-06-05 18:17:18 +02:00
Djordje Lukic
e84b508e80
Merge pull request #171 from docker/windows_kill_child_processes
...
Windows : kill child processes
2020-06-05 00:42:21 -07:00
guillaume.tardif
995d047608
Windows specific : ensure all child processes are killed when parent exits (also works when killing parent). From Desktop code
2020-06-04 17:58:24 +02:00
Guillaume Tardif
b91eab0544
Merge pull request #170 from docker/context_create_check
...
Do not allow context creation for unknown types
2020-06-04 16:51:11 +02:00
Guillaume Tardif
4a4b62ded2
Do not allow context creation for unknown types
2020-06-04 16:44:08 +02:00
Guillaume Tardif
427527d197
Merge pull request #146 from docker/chore-refactor-azure-login
...
Refactor Azure login local server
2020-06-04 10:39:30 +02:00
Christopher Crone
e5335adedd
Azure: Refactor login errors
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-06-04 10:20:39 +02:00
Christopher Crone
35789ace12
Azure: Refactor creation of login server
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-06-03 17:10:54 +02:00
Guillaume Tardif
5675763856
Interactive context create, adding method CreateContextData to CloudService interface, so Cloud Backends can provide a custom context creation method.
2020-06-02 16:04:08 +02:00
Guillaume Tardif
e2b9f5bc57
Move login to root command, delegate to classic login when only one arg and not dot in it
2020-06-01 22:55:46 +02:00
Guillaume Tardif
f1fb80ecc5
Merge pull request #161 from docker/context_inspect
...
Add docker context inspect command relying on classic docker
2020-05-29 15:51:10 +02:00
Guillaume Tardif
528d47ce08
Add docker context inspect command relying on classic docker
2020-05-29 12:02:14 +02:00
Guillaume Tardif
01aaec2dbe
Fix Azure login : allow getting a backend when no corresponding context already exists with an explicit call from the login command. Will be usefull next for context creation with azure interactive things
2020-05-29 11:35:35 +02:00
Guillaume Tardif
ea98a2dd78
Fix docker-classic creation makefile target
2020-05-27 21:14:07 +02:00
Guillaume Tardif
cc46f84043
Forward closing signal to docker-classic when closing docker. Note this will not forward Kill signal, impossible to intercept / process this one.
2020-05-27 18:38:51 +02:00
Guillaume Tardif
e630ace677
Merge pull request #154 from docker/fix_context_inspect_shellout
...
Fix shell out to docker-classic when invoking
2020-05-27 17:02:01 +02:00
Guillaume Tardif
d2648da2d9
Fix shell out to docker-classic when invoking
2020-05-27 16:12:40 +02:00
Guillaume Tardif
66a83410dd
Ensure we have a clear error message in case of wrong setup (previously it would just exit with no error message)
2020-05-26 23:46:02 +02:00
Djordje Lukic
cb14c05e74
Move the context server into own package
...
It had notthing to do in the cli package
2020-05-26 10:31:14 +02:00
Djordje Lukic
b8658b3f54
Rename cli protos to contexts
2020-05-26 10:20:13 +02:00
Djordje Lukic
129e675932
Put all protos inside the `protos` package
2020-05-25 15:04:28 +02:00
Djordje Lukic
11339761ca
Change the way a context is stored
...
Initially we stored the context data in the `Metadata` of the context
but in hindsight this data would be better of in the `Endpoints` because
that's what it is used for.
Before:
```json
{
"Name": "aci",
"Metadata": {
"Type": "aci",
"Data": {
"key": "value"
}
},
"Endpoints": {
"docker": {}
}
}
```
After:
```json
{
"Name": "aci",
"Type": "aci",
"Metadata": {},
"Endpoints": {
"aci": {
"key": "value"
},
"docker": {}
}
}
```
With this change the contexts that we create are more in line with the contexts the docker cli creates.
It also makes the code less complicated since we don't need to marsal twice any more. The API is nicer too:
```go
// Get a context:
c, err := store.Get(contextName)
// Get the stored endpoint:
var aciContext store.AciContext
if err := contextStore.GetEndpoint(currentContext, &aciContext); err != nil {
return nil, err
}
```
2020-05-22 16:32:43 +02:00
Djordje Lukic
de33f183df
Merge pull request #139 from rumpl/feat-log-stream
...
Implement gRPC logging
2020-05-22 06:23:47 -07:00
Chris Crone
0917acfb01
Merge pull request #142 from chris-crone/fix-141
...
Set random container name if not set
2020-05-22 11:31:16 +02:00
Christopher Crone
88ba591fc3
Seed random with nanosecond time
...
It's possible that users will run commands more than once a second.
Thus, seeding the random number generator with the current time in
seconds could produce results like the same container name in subsequent
commands.
Seeding with the current time in nanoseconds reduces the probability of
this.
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-22 10:46:54 +02:00
Djordje Lukic
36c01f511b
Refactor the interceptors
...
Avoid having a function that takes in two contexts as parameters
2020-05-22 10:16:04 +02:00
Djordje Lukic
8495500aa2
Add a CliSuite for cli unit tests
...
Makes writing unit tests for commands quite easier
2020-05-22 10:13:56 +02:00
Christopher Crone
dd66646c06
Unit test run help
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-21 20:03:06 +02:00
Christopher Crone
0efa67f7d2
Set random container name if not set
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-21 19:28:42 +02:00
Djordje Lukic
fe36c49246
Use alpine as base image
...
Installing docker on buster is a pain, use alpine to install it
2020-05-20 18:39:10 +02:00
Djordje Lukic
95e07a2134
Add default context to the context ls output
2020-05-20 18:39:10 +02:00
Christopher Crone
ebe3fbc180
Use config dir for serving API
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-20 15:56:07 +02:00
Christopher Crone
058e6203a7
Store config dir in CLI context
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-20 15:55:05 +02:00
Christopher Crone
b7fb7e2e84
Allow setting config dir with env var
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-20 14:39:02 +02:00
Guillaume Tardif
d218c0745e
Merge pull request #121 from gtardif/docker-classic
...
delegate Moby to docker-classic binary, link docker-classic in e2e tests
2020-05-20 14:28:35 +02:00
Guillaume Tardif
2610b986fd
delegate Moby to docker-classic binary, link docker-classic in e2e tests
2020-05-20 14:23:29 +02:00
Ulysses Souza
d2fece3311
Fix linter problems
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-20 10:16:36 +02:00
Ulysses Souza
d28e5fd742
Add e2e-aci tests for volumes
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-20 10:13:08 +02:00
Ulysses Souza
b25a6b4bd6
Add volumes to run command
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-20 10:06:12 +02:00
Djordje Lukic
0bd18986dd
Add "*" for the current context
2020-05-18 16:42:06 +02:00
Djordje Lukic
cf1be96833
Merge pull request #99 from docker/feat-stop
...
Add `Stop` command on the gRPC side.
2020-05-18 07:40:39 -07:00
Djordje Lukic
a0dda2d094
Add tests for ps --all
2020-05-18 15:31:59 +02:00
Djordje Lukic
ce7cbd4463
Add `Stop` command on the gRPC side.
2020-05-18 15:31:59 +02:00
Christopher Crone
ad0fd73c31
Add config file tests
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-18 15:28:45 +02:00
Christopher Crone
292b6cbd84
Use const for default context name
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-18 15:27:47 +02:00
Chris Crone
cd6d192d07
Merge pull request #113 from chris-crone/appease-linter-main-test
...
Appease linter in main test
2020-05-18 15:26:59 +02:00
Guillaume Tardif
2e8251fb2d
Merge pull request #100 from gtardif/windows_grpc
...
Allow server to start on tcp port or if windows, named pipe rather than unix socket
2020-05-18 15:18:51 +02:00
Christopher Crone
7e81f9e147
Appease linter
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-18 15:12:52 +02:00
Christopher Crone
6d2f085717
Do not pass global flags to context show
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-18 14:58:03 +02:00
Djordje Lukic
7cbbab1739
Merge pull request #109 from chris-crone/context-show
...
Add context show command
2020-05-18 05:50:20 -07:00
Christopher Crone
10d826eb10
Add context show command
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-18 14:48:02 +02:00
Christopher Crone
f6fcd27a09
Factor determination of current context
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-18 14:40:15 +02:00
guillaume.tardif
ecfffc6feb
Allow server to start on tcp port or if windows, named pipe rather than unix socket. could not yet make it work on named pipe from js client (connects but error)
2020-05-18 14:14:52 +02:00
Djordje Lukic
fcb4b606e2
Add labels to containers on run
2020-05-18 13:54:03 +02:00
Djordje Lukic
6fd290e2b1
Add ports convet tests
2020-05-18 12:21:27 +02:00
Djordje Lukic
d8a38afecc
Implement printing published ports
2020-05-16 10:41:35 +02:00
Djordje Lukic
23d2eacf84
Merge pull request #97 from docker/feat-port-parsing
...
Port parsing on the comand line
2020-05-15 17:49:18 +02:00
Djordje Lukic
52f7902d40
Port parsing on the comand line
2020-05-15 15:04:09 +02:00
Guillaume Tardif
7edc6659a2
Add unit tests for login process
2020-05-15 10:28:31 +02:00
Guillaume Tardif
69f10fe80c
Extract interface / types to allow unit tests / mock
2020-05-15 10:15:56 +02:00
Guillaume Tardif
1e19d977e0
Initial functional login command : added Cloud API with generic Login()
2020-05-15 10:04:22 +02:00
Guillaume Tardif
eea84cd487
move context cmd to its own folder ; initial `docker context login` command
2020-05-15 10:04:22 +02:00
Djordje Lukic
15fb6f63c3
Add licenses
2020-05-15 09:14:52 +02:00
Djordje Lukic
0765b08309
Put each compose command in own file
2020-05-15 09:14:51 +02:00
Djordje Lukic
962efef48c
Commands run and rm only call a func
2020-05-15 09:14:51 +02:00
Djordje Lukic
42c72c365c
Split context comands into own files
2020-05-15 09:14:51 +02:00
Djordje Lukic
6b435cf802
Merge pull request #86 from rumpl/feat-multierror
...
Add multierror
2020-05-14 21:14:32 +02:00
Christopher Crone
19baa17246
Fix import order of cli/options
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-14 19:28:57 +02:00
Christopher Crone
11b4bd19f5
Refactor global CLI options
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-14 18:29:09 +02:00
Christopher Crone
8720a62c37
Add context use command
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-14 17:10:24 +02:00
Christopher Crone
c92a9b12d9
Add help to context commands
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-14 17:10:24 +02:00
Christopher Crone
9bf2924c24
Remove logrus.Fatal
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-14 17:10:24 +02:00
Christopher Crone
d46398dbef
Refactor config into package
...
* Move CLI config management into cli/config
* Add ability to save current context
* Remove ability to rename the config file as this was never used
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-14 17:10:20 +02:00
Djordje Lukic
6486f199e2
Add multierror
...
docker/api/multierror wraps go-multierror from hashicorp with
our default error formating
2020-05-13 18:37:41 +02:00
Djordje Lukic
2d14bfeb38
Merge pull request #85 from ulyssessouza/add-run-output
...
WIP - Missing e2e - Print container name when successful
2020-05-13 14:30:58 +02:00
Guillaume Tardif
67a7c96dc4
Merge pull request #84 from rumpl/chore-remove-util
...
Remove util package, it was only used by cli/main.go
2020-05-13 14:23:36 +02:00
Ulysses Souza
507caabf49
Add id to the error output
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-13 12:37:18 +02:00
Ulysses Souza
b98f45eb28
Enable "run->rm" cycle on e2e-aci
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-13 10:44:04 +02:00
Ulysses Souza
14fb12c8c8
Let `make protos` affect host files
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-13 10:44:04 +02:00
Ulysses Souza
40fa78ac5d
Add rm command
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-13 10:44:04 +02:00
Ulysses Souza
80bc3f3620
Print container name when successful
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-13 10:27:39 +02:00
Djordje Lukic
33b9525c9e
Remove util package, it was only used by cli/main.go
...
`util` is not a great name, it has no context and can quickly become a
place where we put everything and anything.
2020-05-13 10:24:16 +02:00
Christopher Crone
c93d2e9180
Context should always be handled by new CLI
...
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-12 18:05:02 +02:00