9 Commits

Author SHA1 Message Date
Djordje Lukic
ad72c866cc Add license headers 2020-06-18 16:48:03 +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
Ulysses Souza
d2fece3311 Fix linter problems
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-20 10:16:36 +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
Djordje Lukic
a26dd81307 Add timeout as a parameter to the stop action 2020-05-18 15:31:59 +02:00
Guillaume Tardif
69f10fe80c Extract interface / types to allow unit tests / mock 2020-05-15 10:15:56 +02:00
Christopher Crone
96907f13e1 Add forbidden error
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-14 17:10:24 +02:00
Christopher Crone
b55f4b0547 Add common error definitions
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-12 12:04:57 +02:00