Skip to content
Merged
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
10 changes: 10 additions & 0 deletions network/endpoint_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,16 @@ func (nw *network) deleteEndpointImplHnsV1(ep *endpoint) error {
hnsResponse, err := hcsshim.HNSEndpointRequest("DELETE", ep.HnsId, "")
log.Printf("[net] HNSEndpointRequest DELETE response:%+v err:%v.", hnsResponse, err)

// todo: may need to improve error handling if hns or hcsshim change their error bubbling.
// hcsshim bubbles up a generic error when delete fails with message "The endpoint was not found".
// the best we can do at the moment is string comparison, which is never great for error checking
if err != nil {
if strings.Contains(strings.ToLower(err.Error()), "not found") {
log.Printf("[net] HNS endpoint id %s not found", ep.HnsId)
return nil
}
}

return err
}

Expand Down