go.mod github.com/Microsoft/hcsshim v0.8.16
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
16
vendor/github.com/Microsoft/hcsshim/hnsendpoint.go
generated
vendored
16
vendor/github.com/Microsoft/hcsshim/hnsendpoint.go
generated
vendored
@ -39,11 +39,27 @@ func HNSListEndpointRequest() ([]HNSEndpoint, error) {
|
||||
|
||||
// HotAttachEndpoint makes a HCS Call to attach the endpoint to the container
|
||||
func HotAttachEndpoint(containerID string, endpointID string) error {
|
||||
endpoint, err := GetHNSEndpointByID(endpointID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
isAttached, err := endpoint.IsAttached(containerID)
|
||||
if isAttached {
|
||||
return err
|
||||
}
|
||||
return modifyNetworkEndpoint(containerID, endpointID, Add)
|
||||
}
|
||||
|
||||
// HotDetachEndpoint makes a HCS Call to detach the endpoint from the container
|
||||
func HotDetachEndpoint(containerID string, endpointID string) error {
|
||||
endpoint, err := GetHNSEndpointByID(endpointID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
isAttached, err := endpoint.IsAttached(containerID)
|
||||
if !isAttached {
|
||||
return err
|
||||
}
|
||||
return modifyNetworkEndpoint(containerID, endpointID, Remove)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user