mirror of https://github.com/docker/compose.git
Fix `docker context ls` that was not displaying legacy context endpoints
This commit is contained in:
parent
667cdfcbf8
commit
d0b2bfbf52
|
@ -94,7 +94,7 @@ func getEndpoint(name string, meta map[string]interface{}) string {
|
|||
if !ok {
|
||||
return ""
|
||||
}
|
||||
data, ok := endpoints.(store.Endpoint)
|
||||
data, ok := endpoints.(*store.Endpoint)
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
|
|
|
@ -211,12 +211,14 @@ func toTypedEndpoints(endpoints map[string]interface{}) (map[string]interface{},
|
|||
return nil, err
|
||||
}
|
||||
typeGetters := getters()
|
||||
if _, ok := typeGetters[k]; !ok {
|
||||
result[k] = v
|
||||
continue
|
||||
typeGetter, ok := typeGetters[k];
|
||||
if !ok {
|
||||
typeGetter = func() interface{} {
|
||||
return &Endpoint{}
|
||||
}
|
||||
}
|
||||
|
||||
val := typeGetters[k]()
|
||||
val := typeGetter()
|
||||
err = json.Unmarshal(bytes, &val)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
@ -58,10 +58,10 @@ func dockerDefaultContext() (*DockerContext, error) {
|
|||
meta := DockerContext{
|
||||
Name: "default",
|
||||
Endpoints: map[string]interface{}{
|
||||
"docker": Endpoint{
|
||||
"docker": &Endpoint{
|
||||
Host: defaultCtx.Endpoints.Docker.Host,
|
||||
},
|
||||
"kubernetes": Endpoint{
|
||||
"kubernetes": &Endpoint{
|
||||
Host: defaultCtx.Endpoints.Kubernetes.Host,
|
||||
DefaultNamespace: defaultCtx.Endpoints.Kubernetes.DefaultNamespace,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue