mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
Bump microsoft/hcsshim to v0.8.7
Signed-off-by: ulyssessouza <ulyssessouza@gmail.com>
This commit is contained in:
22
vendor/github.com/Microsoft/hcsshim/internal/hns/hnsendpoint.go
generated
vendored
22
vendor/github.com/Microsoft/hcsshim/internal/hns/hnsendpoint.go
generated
vendored
@ -3,6 +3,7 @@ package hns
|
||||
import (
|
||||
"encoding/json"
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@ -94,6 +95,27 @@ func GetHNSEndpointByName(endpointName string) (*HNSEndpoint, error) {
|
||||
return nil, EndpointNotFoundError{EndpointName: endpointName}
|
||||
}
|
||||
|
||||
type endpointAttachInfo struct {
|
||||
SharedContainers json.RawMessage `json:",omitempty"`
|
||||
}
|
||||
|
||||
func (endpoint *HNSEndpoint) IsAttached(vID string) (bool, error) {
|
||||
attachInfo := endpointAttachInfo{}
|
||||
err := hnsCall("GET", "/endpoints/"+endpoint.Id, "", &attachInfo)
|
||||
|
||||
// Return false allows us to just return the err
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
if strings.Contains(strings.ToLower(string(attachInfo.SharedContainers)), strings.ToLower(vID)) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
return false, nil
|
||||
|
||||
}
|
||||
|
||||
// Create Endpoint by sending EndpointRequest to HNS. TODO: Create a separate HNS interface to place all these methods
|
||||
func (endpoint *HNSEndpoint) Create() (*HNSEndpoint, error) {
|
||||
operation := "Create"
|
||||
|
Reference in New Issue
Block a user