|
@@ -66,6 +66,7 @@ type hnsEndpoint struct {
|
|
nid string
|
|
nid string
|
|
profileID string
|
|
profileID string
|
|
Type string
|
|
Type string
|
|
|
|
+ containerID string
|
|
macAddress net.HardwareAddr
|
|
macAddress net.HardwareAddr
|
|
epOption *endpointOption // User specified parameters
|
|
epOption *endpointOption // User specified parameters
|
|
epConnectivity *EndpointConnectivity // User specified parameters
|
|
epConnectivity *EndpointConnectivity // User specified parameters
|
|
@@ -730,7 +731,15 @@ func (d *driver) Join(nid, eid string, sboxKey string, jinfo driverapi.JoinInfo,
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
|
|
- // This is just a stub for now
|
|
|
|
|
|
+ endpoint.containerID = sboxKey
|
|
|
|
+
|
|
|
|
+ err = hcsshim.HotAttachEndpoint(endpoint.containerID, endpoint.profileID)
|
|
|
|
+ if err != nil {
|
|
|
|
+ // If container doesn't exists in hcs, do not throw error for hot add/remove
|
|
|
|
+ if err != hcsshim.ErrComputeSystemDoesNotExist {
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
jinfo.DisableGatewayService()
|
|
jinfo.DisableGatewayService()
|
|
return nil
|
|
return nil
|
|
@@ -744,13 +753,18 @@ func (d *driver) Leave(nid, eid string) error {
|
|
}
|
|
}
|
|
|
|
|
|
// Ensure that the endpoint exists
|
|
// Ensure that the endpoint exists
|
|
- _, err = network.getEndpoint(eid)
|
|
|
|
|
|
+ endpoint, err := network.getEndpoint(eid)
|
|
if err != nil {
|
|
if err != nil {
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
|
|
- // This is just a stub for now
|
|
|
|
-
|
|
|
|
|
|
+ err = hcsshim.HotDetachEndpoint(endpoint.containerID, endpoint.profileID)
|
|
|
|
+ if err != nil {
|
|
|
|
+ // If container doesn't exists in hcs, do not throw error for hot add/remove
|
|
|
|
+ if err != hcsshim.ErrComputeSystemDoesNotExist {
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|