mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Changing containerID to sandboxID based off feedback/conversation with Madhu.
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
This commit is contained in:
parent
b0888450a9
commit
955b8b4593
4 changed files with 21 additions and 32 deletions
|
@ -62,11 +62,17 @@ type EndpointConnectivity struct {
|
|||
}
|
||||
|
||||
type hnsEndpoint struct {
|
||||
id string
|
||||
nid string
|
||||
profileID string
|
||||
Type string
|
||||
containerID string
|
||||
id string
|
||||
nid string
|
||||
profileID string
|
||||
Type string
|
||||
//Note: Currently, the sandboxID is the same as the containerID since windows does
|
||||
//not expose the sandboxID.
|
||||
//In the future, windows will support a proper sandboxID that is different
|
||||
//than the containerID.
|
||||
//Therefore, we are using sandboxID now, so that we won't have to change this code
|
||||
//when windows properly supports a sandboxID.
|
||||
sandboxID string
|
||||
macAddress net.HardwareAddr
|
||||
epOption *endpointOption // User specified parameters
|
||||
epConnectivity *EndpointConnectivity // User specified parameters
|
||||
|
@ -731,9 +737,9 @@ func (d *driver) Join(nid, eid string, sboxKey string, jinfo driverapi.JoinInfo,
|
|||
return err
|
||||
}
|
||||
|
||||
endpoint.containerID = sboxKey
|
||||
endpoint.sandboxID = sboxKey
|
||||
|
||||
err = hcsshim.HotAttachEndpoint(endpoint.containerID, endpoint.profileID)
|
||||
err = hcsshim.HotAttachEndpoint(endpoint.sandboxID, endpoint.profileID)
|
||||
if err != nil {
|
||||
// If container doesn't exists in hcs, do not throw error for hot add/remove
|
||||
if err != hcsshim.ErrComputeSystemDoesNotExist {
|
||||
|
@ -758,7 +764,7 @@ func (d *driver) Leave(nid, eid string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
err = hcsshim.HotDetachEndpoint(endpoint.containerID, endpoint.profileID)
|
||||
err = hcsshim.HotDetachEndpoint(endpoint.sandboxID, endpoint.profileID)
|
||||
if err != nil {
|
||||
// If container doesn't exists in hcs, do not throw error for hot add/remove
|
||||
if err != hcsshim.ErrComputeSystemDoesNotExist {
|
||||
|
|
|
@ -144,6 +144,13 @@ func (sb *sandbox) ContainerID() string {
|
|||
return sb.containerID
|
||||
}
|
||||
|
||||
func (sb *sandbox) Key() string {
|
||||
if sb.config.useDefaultSandBox {
|
||||
return osl.GenerateKey("default")
|
||||
}
|
||||
return osl.GenerateKey(sb.id)
|
||||
}
|
||||
|
||||
func (sb *sandbox) Labels() map[string]interface{} {
|
||||
sb.Lock()
|
||||
defer sb.Unlock()
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
// +build !windows
|
||||
|
||||
package libnetwork
|
||||
|
||||
import "github.com/docker/libnetwork/osl"
|
||||
|
||||
func (sb *sandbox) Key() string {
|
||||
if sb.config.useDefaultSandBox {
|
||||
return osl.GenerateKey("default")
|
||||
}
|
||||
return osl.GenerateKey(sb.id)
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
// +build windows
|
||||
|
||||
package libnetwork
|
||||
|
||||
import "github.com/docker/libnetwork/osl"
|
||||
|
||||
func (sb *sandbox) Key() string {
|
||||
if sb.config.useDefaultSandBox {
|
||||
return osl.GenerateKey("default")
|
||||
}
|
||||
return osl.GenerateKey(sb.containerID)
|
||||
}
|
Loading…
Reference in a new issue