guillaume.tardif
df6fc2f18f
Fix volume path setting for linux containers from windows host
2020-06-11 10:44:30 +02:00
Guillaume Tardif
819a7389f7
Fix login error when login to an azure account having no associated tenant.
...
This was encountered by @lorenrh with stack :
```
docker login azure
panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
github.com/docker/api/azure/login.AzureLoginService.Login(0xc0004cc2a0, 0x2d, 0xe8b8a0, 0x1476830, 0xe8e4e0, 0xc000498ff0, 0x0, 0x0)
github.com/docker/api/azure/login/login.go:130 +0x1057
github.com/docker/api/azure.(*aciCloudService).Login(0xc0004888c0, 0xe8e4e0, 0xc000498ff0, 0x0, 0xe82720, 0xc0004888c0)
github.com/docker/api/azure/backend.go:283 +0x64
github.com/docker/api/cli/cmd/login.cloudLogin(0xc0004eb600, 0xd422a4, 0x3, 0x1, 0xffffffffffffffff)
github.com/docker/api/cli/cmd/login/login.go:53 +0xae
github.com/docker/api/cli/cmd/login.runLogin(0xc0004eb600, 0xc00049c5f0, 0x1, 0x1, 0x0, 0x0)
github.com/docker/api/cli/cmd/login/login.go:39 +0x15e
github.com/spf13/cobra.(*Command).execute(0xc0004eb600, 0xc00049c5d0, 0x1, 0x1, 0xc0004eb600, 0xc00049c5d0)
github.com/spf13/cobra@v1.0.0/command.go:842 +0x45a
github.com/spf13/cobra.(*Command).ExecuteC(0xc0004a8580, 0xc000498fc0, 0xc41160, 0x1476830)
github.com/spf13/cobra@v1.0.0/command.go:950 +0x350
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra@v1.0.0/command.go:887
github.com/spf13/cobra.(*Command).ExecuteContext(...)
github.com/spf13/cobra@v1.0.0/command.go:880
main.main()
github.com/docker/api/cli/main.go:167 +0x68f
```
2020-06-10 10:15:03 +02:00
Guillaume Tardif
e77513c1c8
Merge pull request #165 from docker/azure_private_images
...
Allow pulling private images from hub or other registries
2020-06-04 15:43:42 +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
39140c8ea0
Refactoring, add unit test or various interactive context creation
2020-06-03 12:05:58 +02:00
Guillaume Tardif
774bfea341
Refactoring, add unit test or various interactive context creation
2020-06-03 10:55:55 +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
11f1c057dc
Allow pulling private images from hub or other registries, as long as the user is logged in against the registry(ies).
...
Registry creds are passed along with the ACI payload (cf https://docs.microsoft.com/en-us/azure/container-registry/container-registry-auth-aci ).
Manually tested against hub & ACR private repo
2020-06-02 15:56:24 +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
a948b6e1d0
Remove azure resourceGroupClient from backend initialisation. Several advantages :
...
- less dependencies to init backend. (Will need to work more on this to make login command not need an existing subscription ID)
- backend does not get login token at init time. For a long running process (grace server) this would cause issues with token lifetime
- we benefit from the client config (polling options especially) set in aci.go, without duplicating stuff
2020-05-28 10:16:42 +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
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
Guillaume Tardif
186289b75f
Fix ace e2e tests : also use context store with config dir when registering aci backend
2020-05-20 17:15:56 +02:00
Ulysses Souza
70bcdca2c2
Add tests to volume convertion
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-20 10:13:12 +02:00
Ulysses Souza
b68c019e93
Implement ErrParsingFailed error
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-20 10:13:12 +02:00
Ulysses Souza
bdd987f246
Refactor placement and method name
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-20 10:13:12 +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
a26dd81307
Add timeout as a parameter to the stop action
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
Ulysses Souza
872e81862a
Fix typo (and refactor the method name)
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-18 14:56:32 +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
5effbdc31f
Add ACI public ip
2020-05-18 11:36:46 +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
7cf2309ca6
Separate azure login bits in LocalServer + Helper (mocked part)
2020-05-15 10:40:48 +02:00
Guillaume Tardif
7edc6659a2
Add unit tests for login process
2020-05-15 10:28:31 +02:00
Guillaume Tardif
146dd3e639
Fix tokenStore not creating ~/.azure folder if not exist
2020-05-15 10:15:56 +02:00
Guillaume Tardif
8b116b7c73
get an available port for login localhost server, instead of hardcoded port
2020-05-15 10:15:56 +02:00
Guillaume Tardif
d49773e348
Use cli context for login
2020-05-15 10:15:56 +02:00
Guillaume Tardif
bd5e3af2d4
Plug new authorizer and remove az dependency
2020-05-15 10:15:56 +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
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
Guillaume Tardif
13db3437fd
ACI Container ids work fine between ps, log & exec, either from single container (docker run) of multi-container compose stack
2020-05-06 22:15:33 +02:00
Guillaume Tardif
eb712ac75f
Added aci e2e tests, not run in CI since requiring azure login.
...
Need a `docker rm` command to add nginx e2e test, and compose sample to follow
2020-05-06 15:48:01 +02:00
Djordje Lukic
d30239a1e6
Change the default polling delays
...
So that the backend knows that the container(s) are running faster
2020-05-05 17:30:00 +02:00
Ulysses Souza
b6b6fe5baa
Merge pull request #43 from rumpl/fix-exec-commands
...
Fix execution of a list of commands
2020-05-05 17:24:37 +02:00
Djordje Lukic
5d5fe69300
Fix execution of a list of commands
...
The io.Reader interface now returns only bytes up to len(p) (as it
should)
2020-05-05 17:21:54 +02:00
Ulysses Souza
73529cc264
Refactor example/backend
...
Also promote init function from returning
interface{} to backend.Service to avoid
typecasting
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-05 17:14:26 +02:00
Ulysses Souza
e075df6f8f
Fix linter issues
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-05 16:27:22 +02:00
Ulysses Souza
ba455916c6
Refactor on services
...
This refactors the interfaces and implementations of
services
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-05 15:37:12 +02:00
Ulysses Souza
03e418cbbb
Add compose up and down
...
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-05 14:03:14 +02:00
Djordje Lukic
4e9a4185af
Add `make lint` and run it on CI
2020-05-05 10:50:30 +02:00
Djordje Lukic
24c035e822
Add comments on exported items, remove example command
...
Also add `make lint` to run the linter
2020-05-05 10:27:44 +02:00