Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions network/endpoint_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,17 @@ func (nw *network) newEndpointImpl(epInfo *EndpointInfo) (*endpoint, error) {
}
}()

// Attach the endpoint.
log.Printf("[net] Attaching endpoint %v to container %v.", hnsResponse.Id, epInfo.ContainerID)
err = hcsshim.HotAttachEndpoint(epInfo.ContainerID, hnsResponse.Id)
if err != nil {
log.Printf("[net] Failed to attach endpoint: %v.", err)
return nil, err
// Attach the endpoint happens on join
if len(epInfo.ContainerID) > 0 {
log.Printf("[net] Attaching endpoint %v to container %v.", hnsResponse.Id, epInfo.ContainerID)
err = hcsshim.HotAttachEndpoint(epInfo.ContainerID, hnsResponse.Id)
if err != nil {
log.Printf("[net] Failed to attach endpoint: %v.", err)
return nil, err
}
} else {
// Attach the endpoint happens on join
log.Printf("[net] Skipping Attaching endpoint %v to container %v, as this will happen in NetworkDriver/Join", hnsResponse.Id, epInfo.ContainerID)
}

// Create the endpoint object.
Expand Down