9 Commits

Author SHA1 Message Date
Guillaume Tardif
2a49c3b32f added -q flag to docker context ls. (This is now used in desktop e2e wsl2 tests)
See https://ci-next.docker.com/teams-desktop/blue/organizations/jenkins/desktop%2Fdesktop-test-single-branch-win/detail/desktop-test-single-branch-win/274982/pipeline/
2020-06-17 07:40:27 +02:00
Guillaume Tardif
d0b2bfbf52 Fix docker context ls that was not displaying legacy context endpoints 2020-06-15 12:10:54 +02:00
Guillaume Tardif
3c2eb067bc Fix typo in DOCKER ENPOINT 2020-06-12 14:50:35 +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
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
95e07a2134 Add default context to the context ls output 2020-05-20 18:39:10 +02:00
Djordje Lukic
0bd18986dd Add "*" for the current context 2020-05-18 16:42:06 +02:00
Djordje Lukic
15fb6f63c3 Add licenses 2020-05-15 09:14:52 +02:00
Djordje Lukic
42c72c365c Split context comands into own files 2020-05-15 09:14:51 +02:00