Implement CNM GetEndpointInfo on Windows
This commit is contained in:
Родитель
7d51908c36
Коммит
672ddf2ef2
|
@ -340,12 +340,15 @@ func (plugin *netPlugin) endpointOperInfo(w http.ResponseWriter, r *http.Request
|
|||
return
|
||||
}
|
||||
|
||||
value := make(map[string]interface{})
|
||||
//value["com.docker.network.endpoint.macaddress"] = macAddress
|
||||
//value["MacAddress"] = macAddress
|
||||
// Process request.
|
||||
epInfo, err := plugin.nm.GetEndpointInfo(req.NetworkID, req.EndpointID)
|
||||
if err != nil {
|
||||
plugin.SendErrorResponse(w, err)
|
||||
return
|
||||
}
|
||||
|
||||
// Encode response.
|
||||
resp := endpointOperInfoResponse{Value: value}
|
||||
resp := endpointOperInfoResponse{Value: epInfo.Data}
|
||||
err = plugin.Listener.Encode(w, &resp)
|
||||
|
||||
log.Response(plugin.Name, &resp, err)
|
||||
|
|
|
@ -30,6 +30,7 @@ type EndpointInfo struct {
|
|||
IPAddresses []net.IPNet
|
||||
Routes []RouteInfo
|
||||
DNS DNSInfo
|
||||
Data map[string]interface{}
|
||||
}
|
||||
|
||||
// RouteInfo contains information about an IP route.
|
||||
|
@ -117,8 +118,12 @@ func (ep *endpoint) getInfo() *EndpointInfo {
|
|||
info := &EndpointInfo{
|
||||
Id: ep.Id,
|
||||
IPAddresses: ep.IPAddresses,
|
||||
Data: make(map[string]interface{}),
|
||||
}
|
||||
|
||||
// Call the platform implementation.
|
||||
ep.getInfoImpl(info)
|
||||
|
||||
return info
|
||||
}
|
||||
|
||||
|
|
|
@ -214,3 +214,7 @@ func (nw *network) deleteEndpointImpl(ep *endpoint) error {
|
|||
cleanup:
|
||||
return err
|
||||
}
|
||||
|
||||
// getInfoImpl returns information about the endpoint.
|
||||
func (ep *endpoint) getInfoImpl(epInfo *EndpointInfo) {
|
||||
}
|
||||
|
|
|
@ -51,7 +51,6 @@ func (nw *network) newEndpointImpl(epInfo *EndpointInfo) (*endpoint, error) {
|
|||
err = hcsshim.HotAttachEndpoint(epInfo.ContainerID, hnsResponse.Id)
|
||||
if err != nil {
|
||||
log.Printf("[net] Failed to attach endpoint: %v.", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Create the endpoint object.
|
||||
|
@ -78,3 +77,8 @@ func (nw *network) deleteEndpointImpl(ep *endpoint) error {
|
|||
|
||||
return err
|
||||
}
|
||||
|
||||
// getInfoImpl returns information about the endpoint.
|
||||
func (ep *endpoint) getInfoImpl(epInfo *EndpointInfo) {
|
||||
epInfo.Data["hnsid"] = ep.HnsId
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче