11 Commits

Author SHA1 Message Date
Djordje Lukic
84dbd1467d Move the struct for creating and aci context to azure package 2020-07-13 11:05:19 +02:00
Guillaume Tardif
97d408d25d Replaced map[string] string by existing aciCreateOpts struct for context create 2020-07-10 16:39:09 +02:00
Guillaume Tardif
c36b64c10b Fixing subscription-id parameter not passed to backend... 2020-07-10 15:27:41 +02:00
Guillaume Tardif
2824a7a736 Context aci create : check context name does not exists before starting interactive aci create 2020-06-22 18:20:40 +02:00
Guillaume Tardif
8eb380a5a4 So much for golang error processing... 2020-06-19 11:21:47 +02:00
Djordje Lukic
ad72c866cc Add license headers 2020-06-18 16:48:03 +02:00
Guillaume Tardif
113350a09d Context create aci is now a subcommand, as Moby and example. Root docker context create also allows backward compatibility to create docker contexts as before 2020-06-15 12:19:06 +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
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
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