build(deps): bump github.com/Microsoft/hcsshim from 0.9.9 to 0.11.1
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.9.9 to 0.11.1. - [Release notes](https://github.com/Microsoft/hcsshim/releases) - [Commits](https://github.com/Microsoft/hcsshim/compare/v0.9.9...v0.11.1) --- updated-dependencies: - dependency-name: github.com/Microsoft/hcsshim dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
3
vendor/github.com/Microsoft/hcsshim/hcn/doc.go
generated
vendored
Normal file
3
vendor/github.com/Microsoft/hcsshim/hcn/doc.go
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server
|
||||
// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS).
|
||||
package hcn
|
10
vendor/github.com/Microsoft/hcsshim/hcn/hcn.go
generated
vendored
10
vendor/github.com/Microsoft/hcsshim/hcn/hcn.go
generated
vendored
@ -1,5 +1,5 @@
|
||||
// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server
|
||||
// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS).
|
||||
//go:build windows
|
||||
|
||||
package hcn
|
||||
|
||||
import (
|
||||
@ -10,7 +10,7 @@ import (
|
||||
"github.com/Microsoft/go-winio/pkg/guid"
|
||||
)
|
||||
|
||||
//go:generate go run ../mksyscall_windows.go -output zsyscall_windows.go hcn.go
|
||||
//go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go hcn.go
|
||||
|
||||
/// HNS V1 API
|
||||
|
||||
@ -228,7 +228,7 @@ func IPv6DualStackSupported() error {
|
||||
return platformDoesNotSupportError("IPv6 DualStack")
|
||||
}
|
||||
|
||||
//L4proxySupported returns an error if the HCN verison does not support L4Proxy
|
||||
// L4proxySupported returns an error if the HCN version does not support L4Proxy
|
||||
func L4proxyPolicySupported() error {
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
@ -240,7 +240,7 @@ func L4proxyPolicySupported() error {
|
||||
return platformDoesNotSupportError("L4ProxyPolicy")
|
||||
}
|
||||
|
||||
// L4WfpProxySupported returns an error if the HCN verison does not support L4WfpProxy
|
||||
// L4WfpProxySupported returns an error if the HCN version does not support L4WfpProxy
|
||||
func L4WfpProxyPolicySupported() error {
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
|
66
vendor/github.com/Microsoft/hcsshim/hcn/hcnendpoint.go
generated
vendored
66
vendor/github.com/Microsoft/hcsshim/hcn/hcnendpoint.go
generated
vendored
@ -1,3 +1,5 @@
|
||||
//go:build windows
|
||||
|
||||
package hcn
|
||||
|
||||
import (
|
||||
@ -9,7 +11,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// IpConfig is assoicated with an endpoint
|
||||
// IpConfig is associated with an endpoint
|
||||
type IpConfig struct {
|
||||
IpAddress string `json:",omitempty"`
|
||||
PrefixLength uint8 `json:",omitempty"`
|
||||
@ -70,14 +72,14 @@ type PolicyEndpointRequest struct {
|
||||
Policies []EndpointPolicy `json:",omitempty"`
|
||||
}
|
||||
|
||||
func getEndpoint(endpointGuid guid.GUID, query string) (*HostComputeEndpoint, error) {
|
||||
func getEndpoint(endpointGUID guid.GUID, query string) (*HostComputeEndpoint, error) {
|
||||
// Open endpoint.
|
||||
var (
|
||||
endpointHandle hcnEndpoint
|
||||
resultBuffer *uint16
|
||||
propertiesBuffer *uint16
|
||||
)
|
||||
hr := hcnOpenEndpoint(&endpointGuid, &endpointHandle, &resultBuffer)
|
||||
hr := hcnOpenEndpoint(&endpointGUID, &endpointHandle, &resultBuffer)
|
||||
if err := checkForErrors("hcnOpenEndpoint", hr, resultBuffer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -119,8 +121,8 @@ func enumerateEndpoints(query string) ([]HostComputeEndpoint, error) {
|
||||
}
|
||||
|
||||
var outputEndpoints []HostComputeEndpoint
|
||||
for _, endpointGuid := range endpointIds {
|
||||
endpoint, err := getEndpoint(endpointGuid, query)
|
||||
for _, endpointGUID := range endpointIds {
|
||||
endpoint, err := getEndpoint(endpointGUID, query)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -129,22 +131,22 @@ func enumerateEndpoints(query string) ([]HostComputeEndpoint, error) {
|
||||
return outputEndpoints, nil
|
||||
}
|
||||
|
||||
func createEndpoint(networkId string, endpointSettings string) (*HostComputeEndpoint, error) {
|
||||
networkGuid, err := guid.FromString(networkId)
|
||||
func createEndpoint(networkID string, endpointSettings string) (*HostComputeEndpoint, error) {
|
||||
networkGUID, err := guid.FromString(networkID)
|
||||
if err != nil {
|
||||
return nil, errInvalidNetworkID
|
||||
}
|
||||
// Open network.
|
||||
var networkHandle hcnNetwork
|
||||
var resultBuffer *uint16
|
||||
hr := hcnOpenNetwork(&networkGuid, &networkHandle, &resultBuffer)
|
||||
hr := hcnOpenNetwork(&networkGUID, &networkHandle, &resultBuffer)
|
||||
if err := checkForErrors("hcnOpenNetwork", hr, resultBuffer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Create endpoint.
|
||||
endpointId := guid.GUID{}
|
||||
endpointID := guid.GUID{}
|
||||
var endpointHandle hcnEndpoint
|
||||
hr = hcnCreateEndpoint(networkHandle, &endpointId, endpointSettings, &endpointHandle, &resultBuffer)
|
||||
hr = hcnCreateEndpoint(networkHandle, &endpointID, endpointSettings, &endpointHandle, &resultBuffer)
|
||||
if err := checkForErrors("hcnCreateEndpoint", hr, resultBuffer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -178,8 +180,8 @@ func createEndpoint(networkId string, endpointSettings string) (*HostComputeEndp
|
||||
return &outputEndpoint, nil
|
||||
}
|
||||
|
||||
func modifyEndpoint(endpointId string, settings string) (*HostComputeEndpoint, error) {
|
||||
endpointGuid, err := guid.FromString(endpointId)
|
||||
func modifyEndpoint(endpointID string, settings string) (*HostComputeEndpoint, error) {
|
||||
endpointGUID, err := guid.FromString(endpointID)
|
||||
if err != nil {
|
||||
return nil, errInvalidEndpointID
|
||||
}
|
||||
@ -189,7 +191,7 @@ func modifyEndpoint(endpointId string, settings string) (*HostComputeEndpoint, e
|
||||
resultBuffer *uint16
|
||||
propertiesBuffer *uint16
|
||||
)
|
||||
hr := hcnOpenEndpoint(&endpointGuid, &endpointHandle, &resultBuffer)
|
||||
hr := hcnOpenEndpoint(&endpointGUID, &endpointHandle, &resultBuffer)
|
||||
if err := checkForErrors("hcnOpenEndpoint", hr, resultBuffer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -222,13 +224,13 @@ func modifyEndpoint(endpointId string, settings string) (*HostComputeEndpoint, e
|
||||
return &outputEndpoint, nil
|
||||
}
|
||||
|
||||
func deleteEndpoint(endpointId string) error {
|
||||
endpointGuid, err := guid.FromString(endpointId)
|
||||
func deleteEndpoint(endpointID string) error {
|
||||
endpointGUID, err := guid.FromString(endpointID)
|
||||
if err != nil {
|
||||
return errInvalidEndpointID
|
||||
}
|
||||
var resultBuffer *uint16
|
||||
hr := hcnDeleteEndpoint(&endpointGuid, &resultBuffer)
|
||||
hr := hcnDeleteEndpoint(&endpointGUID, &resultBuffer)
|
||||
if err := checkForErrors("hcnDeleteEndpoint", hr, resultBuffer); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -247,12 +249,12 @@ func ListEndpoints() ([]HostComputeEndpoint, error) {
|
||||
|
||||
// ListEndpointsQuery makes a call to query the list of available endpoints.
|
||||
func ListEndpointsQuery(query HostComputeQuery) ([]HostComputeEndpoint, error) {
|
||||
queryJson, err := json.Marshal(query)
|
||||
queryJSON, err := json.Marshal(query)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
endpoints, err := enumerateEndpoints(string(queryJson))
|
||||
endpoints, err := enumerateEndpoints(string(queryJSON))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -260,10 +262,10 @@ func ListEndpointsQuery(query HostComputeQuery) ([]HostComputeEndpoint, error) {
|
||||
}
|
||||
|
||||
// ListEndpointsOfNetwork queries the list of endpoints on a network.
|
||||
func ListEndpointsOfNetwork(networkId string) ([]HostComputeEndpoint, error) {
|
||||
func ListEndpointsOfNetwork(networkID string) ([]HostComputeEndpoint, error) {
|
||||
hcnQuery := defaultQuery()
|
||||
// TODO: Once query can convert schema, change to {HostComputeNetwork:networkId}
|
||||
mapA := map[string]string{"VirtualNetwork": networkId}
|
||||
mapA := map[string]string{"VirtualNetwork": networkID}
|
||||
filter, err := json.Marshal(mapA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -274,9 +276,9 @@ func ListEndpointsOfNetwork(networkId string) ([]HostComputeEndpoint, error) {
|
||||
}
|
||||
|
||||
// GetEndpointByID returns an endpoint specified by Id
|
||||
func GetEndpointByID(endpointId string) (*HostComputeEndpoint, error) {
|
||||
func GetEndpointByID(endpointID string) (*HostComputeEndpoint, error) {
|
||||
hcnQuery := defaultQuery()
|
||||
mapA := map[string]string{"ID": endpointId}
|
||||
mapA := map[string]string{"ID": endpointID}
|
||||
filter, err := json.Marshal(mapA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -288,7 +290,7 @@ func GetEndpointByID(endpointId string) (*HostComputeEndpoint, error) {
|
||||
return nil, err
|
||||
}
|
||||
if len(endpoints) == 0 {
|
||||
return nil, EndpointNotFoundError{EndpointID: endpointId}
|
||||
return nil, EndpointNotFoundError{EndpointID: endpointID}
|
||||
}
|
||||
return &endpoints[0], err
|
||||
}
|
||||
@ -345,15 +347,15 @@ func (endpoint *HostComputeEndpoint) Delete() error {
|
||||
}
|
||||
|
||||
// ModifyEndpointSettings updates the Port/Policy of an Endpoint.
|
||||
func ModifyEndpointSettings(endpointId string, request *ModifyEndpointSettingRequest) error {
|
||||
logrus.Debugf("hcn::HostComputeEndpoint::ModifyEndpointSettings id=%s", endpointId)
|
||||
func ModifyEndpointSettings(endpointID string, request *ModifyEndpointSettingRequest) error {
|
||||
logrus.Debugf("hcn::HostComputeEndpoint::ModifyEndpointSettings id=%s", endpointID)
|
||||
|
||||
endpointSettingsRequest, err := json.Marshal(request)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = modifyEndpoint(endpointId, string(endpointSettingsRequest))
|
||||
_, err = modifyEndpoint(endpointID, string(endpointSettingsRequest))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -364,25 +366,25 @@ func ModifyEndpointSettings(endpointId string, request *ModifyEndpointSettingReq
|
||||
func (endpoint *HostComputeEndpoint) ApplyPolicy(requestType RequestType, endpointPolicy PolicyEndpointRequest) error {
|
||||
logrus.Debugf("hcn::HostComputeEndpoint::ApplyPolicy id=%s", endpoint.Id)
|
||||
|
||||
settingsJson, err := json.Marshal(endpointPolicy)
|
||||
settingsJSON, err := json.Marshal(endpointPolicy)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
requestMessage := &ModifyEndpointSettingRequest{
|
||||
ResourceType: EndpointResourceTypePolicy,
|
||||
RequestType: requestType,
|
||||
Settings: settingsJson,
|
||||
Settings: settingsJSON,
|
||||
}
|
||||
|
||||
return ModifyEndpointSettings(endpoint.Id, requestMessage)
|
||||
}
|
||||
|
||||
// NamespaceAttach modifies a Namespace to add an endpoint.
|
||||
func (endpoint *HostComputeEndpoint) NamespaceAttach(namespaceId string) error {
|
||||
return AddNamespaceEndpoint(namespaceId, endpoint.Id)
|
||||
func (endpoint *HostComputeEndpoint) NamespaceAttach(namespaceID string) error {
|
||||
return AddNamespaceEndpoint(namespaceID, endpoint.Id)
|
||||
}
|
||||
|
||||
// NamespaceDetach modifies a Namespace to remove an endpoint.
|
||||
func (endpoint *HostComputeEndpoint) NamespaceDetach(namespaceId string) error {
|
||||
return RemoveNamespaceEndpoint(namespaceId, endpoint.Id)
|
||||
func (endpoint *HostComputeEndpoint) NamespaceDetach(namespaceID string) error {
|
||||
return RemoveNamespaceEndpoint(namespaceID, endpoint.Id)
|
||||
}
|
||||
|
21
vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go
generated
vendored
21
vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go
generated
vendored
@ -1,5 +1,5 @@
|
||||
// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server
|
||||
// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS).
|
||||
//go:build windows
|
||||
|
||||
package hcn
|
||||
|
||||
import (
|
||||
@ -10,6 +10,7 @@ import (
|
||||
"github.com/Microsoft/hcsshim/internal/hcserror"
|
||||
"github.com/Microsoft/hcsshim/internal/interop"
|
||||
"github.com/sirupsen/logrus"
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -48,8 +49,8 @@ type ErrorCode uint32
|
||||
|
||||
// For common errors, define the error as it is in windows, so we can quickly determine it later
|
||||
const (
|
||||
ERROR_NOT_FOUND = 0x490
|
||||
HCN_E_PORT_ALREADY_EXISTS ErrorCode = 0x803b0013
|
||||
ERROR_NOT_FOUND = ErrorCode(windows.ERROR_NOT_FOUND)
|
||||
HCN_E_PORT_ALREADY_EXISTS ErrorCode = ErrorCode(windows.HCN_E_PORT_ALREADY_EXISTS)
|
||||
)
|
||||
|
||||
type HcnError struct {
|
||||
@ -87,10 +88,10 @@ func new(hr error, title string, rest string) error {
|
||||
|
||||
//
|
||||
// Note that the below errors are not errors returned by hcn itself
|
||||
// we wish to seperate them as they are shim usage error
|
||||
// we wish to separate them as they are shim usage error
|
||||
//
|
||||
|
||||
// NetworkNotFoundError results from a failed seach for a network by Id or Name
|
||||
// NetworkNotFoundError results from a failed search for a network by Id or Name
|
||||
type NetworkNotFoundError struct {
|
||||
NetworkName string
|
||||
NetworkID string
|
||||
@ -103,7 +104,7 @@ func (e NetworkNotFoundError) Error() string {
|
||||
return fmt.Sprintf("Network ID %q not found", e.NetworkID)
|
||||
}
|
||||
|
||||
// EndpointNotFoundError results from a failed seach for an endpoint by Id or Name
|
||||
// EndpointNotFoundError results from a failed search for an endpoint by Id or Name
|
||||
type EndpointNotFoundError struct {
|
||||
EndpointName string
|
||||
EndpointID string
|
||||
@ -116,7 +117,7 @@ func (e EndpointNotFoundError) Error() string {
|
||||
return fmt.Sprintf("Endpoint ID %q not found", e.EndpointID)
|
||||
}
|
||||
|
||||
// NamespaceNotFoundError results from a failed seach for a namsepace by Id
|
||||
// NamespaceNotFoundError results from a failed search for a namsepace by Id
|
||||
type NamespaceNotFoundError struct {
|
||||
NamespaceID string
|
||||
}
|
||||
@ -125,7 +126,7 @@ func (e NamespaceNotFoundError) Error() string {
|
||||
return fmt.Sprintf("Namespace ID %q not found", e.NamespaceID)
|
||||
}
|
||||
|
||||
// LoadBalancerNotFoundError results from a failed seach for a loadbalancer by Id
|
||||
// LoadBalancerNotFoundError results from a failed search for a loadbalancer by Id
|
||||
type LoadBalancerNotFoundError struct {
|
||||
LoadBalancerId string
|
||||
}
|
||||
@ -134,7 +135,7 @@ func (e LoadBalancerNotFoundError) Error() string {
|
||||
return fmt.Sprintf("LoadBalancer %q not found", e.LoadBalancerId)
|
||||
}
|
||||
|
||||
// RouteNotFoundError results from a failed seach for a route by Id
|
||||
// RouteNotFoundError results from a failed search for a route by Id
|
||||
type RouteNotFoundError struct {
|
||||
RouteId string
|
||||
}
|
||||
|
2
vendor/github.com/Microsoft/hcsshim/hcn/hcnglobals.go
generated
vendored
2
vendor/github.com/Microsoft/hcsshim/hcn/hcnglobals.go
generated
vendored
@ -1,3 +1,5 @@
|
||||
//go:build windows
|
||||
|
||||
package hcn
|
||||
|
||||
import (
|
||||
|
34
vendor/github.com/Microsoft/hcsshim/hcn/hcnloadbalancer.go
generated
vendored
34
vendor/github.com/Microsoft/hcsshim/hcn/hcnloadbalancer.go
generated
vendored
@ -1,3 +1,5 @@
|
||||
//go:build windows
|
||||
|
||||
package hcn
|
||||
|
||||
import (
|
||||
@ -28,14 +30,14 @@ type HostComputeLoadBalancer struct {
|
||||
Flags LoadBalancerFlags `json:",omitempty"` // 0: None, 1: EnableDirectServerReturn
|
||||
}
|
||||
|
||||
//LoadBalancerFlags modify settings for a loadbalancer.
|
||||
// LoadBalancerFlags modify settings for a loadbalancer.
|
||||
type LoadBalancerFlags uint32
|
||||
|
||||
var (
|
||||
// LoadBalancerFlagsNone is the default.
|
||||
LoadBalancerFlagsNone LoadBalancerFlags = 0
|
||||
// LoadBalancerFlagsDSR enables Direct Server Return (DSR)
|
||||
LoadBalancerFlagsDSR LoadBalancerFlags = 1
|
||||
LoadBalancerFlagsDSR LoadBalancerFlags = 1
|
||||
LoadBalancerFlagsIPv6 LoadBalancerFlags = 2
|
||||
)
|
||||
|
||||
@ -67,14 +69,14 @@ var (
|
||||
LoadBalancerDistributionSourceIP LoadBalancerDistribution = 2
|
||||
)
|
||||
|
||||
func getLoadBalancer(loadBalancerGuid guid.GUID, query string) (*HostComputeLoadBalancer, error) {
|
||||
func getLoadBalancer(loadBalancerGUID guid.GUID, query string) (*HostComputeLoadBalancer, error) {
|
||||
// Open loadBalancer.
|
||||
var (
|
||||
loadBalancerHandle hcnLoadBalancer
|
||||
resultBuffer *uint16
|
||||
propertiesBuffer *uint16
|
||||
)
|
||||
hr := hcnOpenLoadBalancer(&loadBalancerGuid, &loadBalancerHandle, &resultBuffer)
|
||||
hr := hcnOpenLoadBalancer(&loadBalancerGUID, &loadBalancerHandle, &resultBuffer)
|
||||
if err := checkForErrors("hcnOpenLoadBalancer", hr, resultBuffer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -115,8 +117,8 @@ func enumerateLoadBalancers(query string) ([]HostComputeLoadBalancer, error) {
|
||||
}
|
||||
|
||||
var outputLoadBalancers []HostComputeLoadBalancer
|
||||
for _, loadBalancerGuid := range loadBalancerIds {
|
||||
loadBalancer, err := getLoadBalancer(loadBalancerGuid, query)
|
||||
for _, loadBalancerGUID := range loadBalancerIds {
|
||||
loadBalancer, err := getLoadBalancer(loadBalancerGUID, query)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -132,8 +134,8 @@ func createLoadBalancer(settings string) (*HostComputeLoadBalancer, error) {
|
||||
resultBuffer *uint16
|
||||
propertiesBuffer *uint16
|
||||
)
|
||||
loadBalancerGuid := guid.GUID{}
|
||||
hr := hcnCreateLoadBalancer(&loadBalancerGuid, settings, &loadBalancerHandle, &resultBuffer)
|
||||
loadBalancerGUID := guid.GUID{}
|
||||
hr := hcnCreateLoadBalancer(&loadBalancerGUID, settings, &loadBalancerHandle, &resultBuffer)
|
||||
if err := checkForErrors("hcnCreateLoadBalancer", hr, resultBuffer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -161,13 +163,13 @@ func createLoadBalancer(settings string) (*HostComputeLoadBalancer, error) {
|
||||
return &outputLoadBalancer, nil
|
||||
}
|
||||
|
||||
func deleteLoadBalancer(loadBalancerId string) error {
|
||||
loadBalancerGuid, err := guid.FromString(loadBalancerId)
|
||||
func deleteLoadBalancer(loadBalancerID string) error {
|
||||
loadBalancerGUID, err := guid.FromString(loadBalancerID)
|
||||
if err != nil {
|
||||
return errInvalidLoadBalancerID
|
||||
}
|
||||
var resultBuffer *uint16
|
||||
hr := hcnDeleteLoadBalancer(&loadBalancerGuid, &resultBuffer)
|
||||
hr := hcnDeleteLoadBalancer(&loadBalancerGUID, &resultBuffer)
|
||||
if err := checkForErrors("hcnDeleteLoadBalancer", hr, resultBuffer); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -186,12 +188,12 @@ func ListLoadBalancers() ([]HostComputeLoadBalancer, error) {
|
||||
|
||||
// ListLoadBalancersQuery makes a call to query the list of available loadBalancers.
|
||||
func ListLoadBalancersQuery(query HostComputeQuery) ([]HostComputeLoadBalancer, error) {
|
||||
queryJson, err := json.Marshal(query)
|
||||
queryJSON, err := json.Marshal(query)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
loadBalancers, err := enumerateLoadBalancers(string(queryJson))
|
||||
loadBalancers, err := enumerateLoadBalancers(string(queryJSON))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -199,9 +201,9 @@ func ListLoadBalancersQuery(query HostComputeQuery) ([]HostComputeLoadBalancer,
|
||||
}
|
||||
|
||||
// GetLoadBalancerByID returns the LoadBalancer specified by Id.
|
||||
func GetLoadBalancerByID(loadBalancerId string) (*HostComputeLoadBalancer, error) {
|
||||
func GetLoadBalancerByID(loadBalancerID string) (*HostComputeLoadBalancer, error) {
|
||||
hcnQuery := defaultQuery()
|
||||
mapA := map[string]string{"ID": loadBalancerId}
|
||||
mapA := map[string]string{"ID": loadBalancerID}
|
||||
filter, err := json.Marshal(mapA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -213,7 +215,7 @@ func GetLoadBalancerByID(loadBalancerId string) (*HostComputeLoadBalancer, error
|
||||
return nil, err
|
||||
}
|
||||
if len(loadBalancers) == 0 {
|
||||
return nil, LoadBalancerNotFoundError{LoadBalancerId: loadBalancerId}
|
||||
return nil, LoadBalancerNotFoundError{LoadBalancerId: loadBalancerID}
|
||||
}
|
||||
return &loadBalancers[0], err
|
||||
}
|
||||
|
84
vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go
generated
vendored
84
vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go
generated
vendored
@ -1,3 +1,5 @@
|
||||
//go:build windows
|
||||
|
||||
package hcn
|
||||
|
||||
import (
|
||||
@ -27,7 +29,7 @@ type NamespaceResourceContainer struct {
|
||||
type NamespaceResourceType string
|
||||
|
||||
var (
|
||||
// NamespaceResourceTypeContainer are contianers associated with a Namespace.
|
||||
// NamespaceResourceTypeContainer are containers associated with a Namespace.
|
||||
NamespaceResourceTypeContainer NamespaceResourceType = "Container"
|
||||
// NamespaceResourceTypeEndpoint are endpoints associated with a Namespace.
|
||||
NamespaceResourceTypeEndpoint NamespaceResourceType = "Endpoint"
|
||||
@ -70,14 +72,14 @@ type ModifyNamespaceSettingRequest struct {
|
||||
Settings json.RawMessage `json:",omitempty"`
|
||||
}
|
||||
|
||||
func getNamespace(namespaceGuid guid.GUID, query string) (*HostComputeNamespace, error) {
|
||||
func getNamespace(namespaceGUID guid.GUID, query string) (*HostComputeNamespace, error) {
|
||||
// Open namespace.
|
||||
var (
|
||||
namespaceHandle hcnNamespace
|
||||
resultBuffer *uint16
|
||||
propertiesBuffer *uint16
|
||||
)
|
||||
hr := hcnOpenNamespace(&namespaceGuid, &namespaceHandle, &resultBuffer)
|
||||
hr := hcnOpenNamespace(&namespaceGUID, &namespaceHandle, &resultBuffer)
|
||||
if err := checkForErrors("hcnOpenNamespace", hr, resultBuffer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -118,8 +120,8 @@ func enumerateNamespaces(query string) ([]HostComputeNamespace, error) {
|
||||
}
|
||||
|
||||
var outputNamespaces []HostComputeNamespace
|
||||
for _, namespaceGuid := range namespaceIds {
|
||||
namespace, err := getNamespace(namespaceGuid, query)
|
||||
for _, namespaceGUID := range namespaceIds {
|
||||
namespace, err := getNamespace(namespaceGUID, query)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -135,8 +137,8 @@ func createNamespace(settings string) (*HostComputeNamespace, error) {
|
||||
resultBuffer *uint16
|
||||
propertiesBuffer *uint16
|
||||
)
|
||||
namespaceGuid := guid.GUID{}
|
||||
hr := hcnCreateNamespace(&namespaceGuid, settings, &namespaceHandle, &resultBuffer)
|
||||
namespaceGUID := guid.GUID{}
|
||||
hr := hcnCreateNamespace(&namespaceGUID, settings, &namespaceHandle, &resultBuffer)
|
||||
if err := checkForErrors("hcnCreateNamespace", hr, resultBuffer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -164,8 +166,8 @@ func createNamespace(settings string) (*HostComputeNamespace, error) {
|
||||
return &outputNamespace, nil
|
||||
}
|
||||
|
||||
func modifyNamespace(namespaceId string, settings string) (*HostComputeNamespace, error) {
|
||||
namespaceGuid, err := guid.FromString(namespaceId)
|
||||
func modifyNamespace(namespaceID string, settings string) (*HostComputeNamespace, error) {
|
||||
namespaceGUID, err := guid.FromString(namespaceID)
|
||||
if err != nil {
|
||||
return nil, errInvalidNamespaceID
|
||||
}
|
||||
@ -175,7 +177,7 @@ func modifyNamespace(namespaceId string, settings string) (*HostComputeNamespace
|
||||
resultBuffer *uint16
|
||||
propertiesBuffer *uint16
|
||||
)
|
||||
hr := hcnOpenNamespace(&namespaceGuid, &namespaceHandle, &resultBuffer)
|
||||
hr := hcnOpenNamespace(&namespaceGUID, &namespaceHandle, &resultBuffer)
|
||||
if err := checkForErrors("hcnOpenNamespace", hr, resultBuffer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -208,13 +210,13 @@ func modifyNamespace(namespaceId string, settings string) (*HostComputeNamespace
|
||||
return &outputNamespace, nil
|
||||
}
|
||||
|
||||
func deleteNamespace(namespaceId string) error {
|
||||
namespaceGuid, err := guid.FromString(namespaceId)
|
||||
func deleteNamespace(namespaceID string) error {
|
||||
namespaceGUID, err := guid.FromString(namespaceID)
|
||||
if err != nil {
|
||||
return errInvalidNamespaceID
|
||||
}
|
||||
var resultBuffer *uint16
|
||||
hr := hcnDeleteNamespace(&namespaceGuid, &resultBuffer)
|
||||
hr := hcnDeleteNamespace(&namespaceGUID, &resultBuffer)
|
||||
if err := checkForErrors("hcnDeleteNamespace", hr, resultBuffer); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -233,12 +235,12 @@ func ListNamespaces() ([]HostComputeNamespace, error) {
|
||||
|
||||
// ListNamespacesQuery makes a call to query the list of available namespaces.
|
||||
func ListNamespacesQuery(query HostComputeQuery) ([]HostComputeNamespace, error) {
|
||||
queryJson, err := json.Marshal(query)
|
||||
queryJSON, err := json.Marshal(query)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
namespaces, err := enumerateNamespaces(string(queryJson))
|
||||
namespaces, err := enumerateNamespaces(string(queryJSON))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -246,9 +248,9 @@ func ListNamespacesQuery(query HostComputeQuery) ([]HostComputeNamespace, error)
|
||||
}
|
||||
|
||||
// GetNamespaceByID returns the Namespace specified by Id.
|
||||
func GetNamespaceByID(namespaceId string) (*HostComputeNamespace, error) {
|
||||
func GetNamespaceByID(namespaceID string) (*HostComputeNamespace, error) {
|
||||
hcnQuery := defaultQuery()
|
||||
mapA := map[string]string{"ID": namespaceId}
|
||||
mapA := map[string]string{"ID": namespaceID}
|
||||
filter, err := json.Marshal(mapA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -260,15 +262,15 @@ func GetNamespaceByID(namespaceId string) (*HostComputeNamespace, error) {
|
||||
return nil, err
|
||||
}
|
||||
if len(namespaces) == 0 {
|
||||
return nil, NamespaceNotFoundError{NamespaceID: namespaceId}
|
||||
return nil, NamespaceNotFoundError{NamespaceID: namespaceID}
|
||||
}
|
||||
|
||||
return &namespaces[0], err
|
||||
}
|
||||
|
||||
// GetNamespaceEndpointIds returns the endpoints of the Namespace specified by Id.
|
||||
func GetNamespaceEndpointIds(namespaceId string) ([]string, error) {
|
||||
namespace, err := GetNamespaceByID(namespaceId)
|
||||
func GetNamespaceEndpointIds(namespaceID string) ([]string, error) {
|
||||
namespace, err := GetNamespaceByID(namespaceID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -286,19 +288,19 @@ func GetNamespaceEndpointIds(namespaceId string) ([]string, error) {
|
||||
}
|
||||
|
||||
// GetNamespaceContainerIds returns the containers of the Namespace specified by Id.
|
||||
func GetNamespaceContainerIds(namespaceId string) ([]string, error) {
|
||||
namespace, err := GetNamespaceByID(namespaceId)
|
||||
func GetNamespaceContainerIds(namespaceID string) ([]string, error) {
|
||||
namespace, err := GetNamespaceByID(namespaceID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var containerIds []string
|
||||
for _, resource := range namespace.Resources {
|
||||
if resource.Type == "Container" {
|
||||
var contaienrResource NamespaceResourceContainer
|
||||
if err := json.Unmarshal([]byte(resource.Data), &contaienrResource); err != nil {
|
||||
var containerResource NamespaceResourceContainer
|
||||
if err := json.Unmarshal([]byte(resource.Data), &containerResource); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
containerIds = append(containerIds, contaienrResource.Id)
|
||||
containerIds = append(containerIds, containerResource.Id)
|
||||
}
|
||||
}
|
||||
return containerIds, nil
|
||||
@ -375,7 +377,7 @@ func (namespace *HostComputeNamespace) Sync() error {
|
||||
}
|
||||
shimPath := runhcs.VMPipePath(cfg.HostUniqueID)
|
||||
if err := runhcs.IssueVMRequest(shimPath, &req); err != nil {
|
||||
// The shim is likey gone. Simply ignore the sync as if it didn't exist.
|
||||
// The shim is likely gone. Simply ignore the sync as if it didn't exist.
|
||||
if perr, ok := err.(*os.PathError); ok && perr.Err == syscall.ERROR_FILE_NOT_FOUND {
|
||||
// Remove the reg key there is no point to try again
|
||||
_ = cfg.Remove()
|
||||
@ -394,15 +396,15 @@ func (namespace *HostComputeNamespace) Sync() error {
|
||||
}
|
||||
|
||||
// ModifyNamespaceSettings updates the Endpoints/Containers of a Namespace.
|
||||
func ModifyNamespaceSettings(namespaceId string, request *ModifyNamespaceSettingRequest) error {
|
||||
logrus.Debugf("hcn::HostComputeNamespace::ModifyNamespaceSettings id=%s", namespaceId)
|
||||
func ModifyNamespaceSettings(namespaceID string, request *ModifyNamespaceSettingRequest) error {
|
||||
logrus.Debugf("hcn::HostComputeNamespace::ModifyNamespaceSettings id=%s", namespaceID)
|
||||
|
||||
namespaceSettings, err := json.Marshal(request)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = modifyNamespace(namespaceId, string(namespaceSettings))
|
||||
_, err = modifyNamespace(namespaceID, string(namespaceSettings))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -410,37 +412,37 @@ func ModifyNamespaceSettings(namespaceId string, request *ModifyNamespaceSetting
|
||||
}
|
||||
|
||||
// AddNamespaceEndpoint adds an endpoint to a Namespace.
|
||||
func AddNamespaceEndpoint(namespaceId string, endpointId string) error {
|
||||
logrus.Debugf("hcn::HostComputeEndpoint::AddNamespaceEndpoint id=%s", endpointId)
|
||||
func AddNamespaceEndpoint(namespaceID string, endpointID string) error {
|
||||
logrus.Debugf("hcn::HostComputeEndpoint::AddNamespaceEndpoint id=%s", endpointID)
|
||||
|
||||
mapA := map[string]string{"EndpointId": endpointId}
|
||||
settingsJson, err := json.Marshal(mapA)
|
||||
mapA := map[string]string{"EndpointId": endpointID}
|
||||
settingsJSON, err := json.Marshal(mapA)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
requestMessage := &ModifyNamespaceSettingRequest{
|
||||
ResourceType: NamespaceResourceTypeEndpoint,
|
||||
RequestType: RequestTypeAdd,
|
||||
Settings: settingsJson,
|
||||
Settings: settingsJSON,
|
||||
}
|
||||
|
||||
return ModifyNamespaceSettings(namespaceId, requestMessage)
|
||||
return ModifyNamespaceSettings(namespaceID, requestMessage)
|
||||
}
|
||||
|
||||
// RemoveNamespaceEndpoint removes an endpoint from a Namespace.
|
||||
func RemoveNamespaceEndpoint(namespaceId string, endpointId string) error {
|
||||
logrus.Debugf("hcn::HostComputeNamespace::RemoveNamespaceEndpoint id=%s", endpointId)
|
||||
func RemoveNamespaceEndpoint(namespaceID string, endpointID string) error {
|
||||
logrus.Debugf("hcn::HostComputeNamespace::RemoveNamespaceEndpoint id=%s", endpointID)
|
||||
|
||||
mapA := map[string]string{"EndpointId": endpointId}
|
||||
settingsJson, err := json.Marshal(mapA)
|
||||
mapA := map[string]string{"EndpointId": endpointID}
|
||||
settingsJSON, err := json.Marshal(mapA)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
requestMessage := &ModifyNamespaceSettingRequest{
|
||||
ResourceType: NamespaceResourceTypeEndpoint,
|
||||
RequestType: RequestTypeRemove,
|
||||
Settings: settingsJson,
|
||||
Settings: settingsJSON,
|
||||
}
|
||||
|
||||
return ModifyNamespaceSettings(namespaceId, requestMessage)
|
||||
return ModifyNamespaceSettings(namespaceID, requestMessage)
|
||||
}
|
||||
|
38
vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go
generated
vendored
38
vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go
generated
vendored
@ -1,3 +1,5 @@
|
||||
//go:build windows
|
||||
|
||||
package hcn
|
||||
|
||||
import (
|
||||
@ -110,14 +112,14 @@ type PolicyNetworkRequest struct {
|
||||
Policies []NetworkPolicy `json:",omitempty"`
|
||||
}
|
||||
|
||||
func getNetwork(networkGuid guid.GUID, query string) (*HostComputeNetwork, error) {
|
||||
func getNetwork(networkGUID guid.GUID, query string) (*HostComputeNetwork, error) {
|
||||
// Open network.
|
||||
var (
|
||||
networkHandle hcnNetwork
|
||||
resultBuffer *uint16
|
||||
propertiesBuffer *uint16
|
||||
)
|
||||
hr := hcnOpenNetwork(&networkGuid, &networkHandle, &resultBuffer)
|
||||
hr := hcnOpenNetwork(&networkGUID, &networkHandle, &resultBuffer)
|
||||
if err := checkForErrors("hcnOpenNetwork", hr, resultBuffer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -164,8 +166,8 @@ func enumerateNetworks(query string) ([]HostComputeNetwork, error) {
|
||||
}
|
||||
|
||||
var outputNetworks []HostComputeNetwork
|
||||
for _, networkGuid := range networkIds {
|
||||
network, err := getNetwork(networkGuid, query)
|
||||
for _, networkGUID := range networkIds {
|
||||
network, err := getNetwork(networkGUID, query)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -181,8 +183,8 @@ func createNetwork(settings string) (*HostComputeNetwork, error) {
|
||||
resultBuffer *uint16
|
||||
propertiesBuffer *uint16
|
||||
)
|
||||
networkGuid := guid.GUID{}
|
||||
hr := hcnCreateNetwork(&networkGuid, settings, &networkHandle, &resultBuffer)
|
||||
networkGUID := guid.GUID{}
|
||||
hr := hcnCreateNetwork(&networkGUID, settings, &networkHandle, &resultBuffer)
|
||||
if err := checkForErrors("hcnCreateNetwork", hr, resultBuffer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -216,8 +218,8 @@ func createNetwork(settings string) (*HostComputeNetwork, error) {
|
||||
return &outputNetwork, nil
|
||||
}
|
||||
|
||||
func modifyNetwork(networkId string, settings string) (*HostComputeNetwork, error) {
|
||||
networkGuid, err := guid.FromString(networkId)
|
||||
func modifyNetwork(networkID string, settings string) (*HostComputeNetwork, error) {
|
||||
networkGUID, err := guid.FromString(networkID)
|
||||
if err != nil {
|
||||
return nil, errInvalidNetworkID
|
||||
}
|
||||
@ -227,7 +229,7 @@ func modifyNetwork(networkId string, settings string) (*HostComputeNetwork, erro
|
||||
resultBuffer *uint16
|
||||
propertiesBuffer *uint16
|
||||
)
|
||||
hr := hcnOpenNetwork(&networkGuid, &networkHandle, &resultBuffer)
|
||||
hr := hcnOpenNetwork(&networkGUID, &networkHandle, &resultBuffer)
|
||||
if err := checkForErrors("hcnOpenNetwork", hr, resultBuffer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -266,13 +268,13 @@ func modifyNetwork(networkId string, settings string) (*HostComputeNetwork, erro
|
||||
return &outputNetwork, nil
|
||||
}
|
||||
|
||||
func deleteNetwork(networkId string) error {
|
||||
networkGuid, err := guid.FromString(networkId)
|
||||
func deleteNetwork(networkID string) error {
|
||||
networkGUID, err := guid.FromString(networkID)
|
||||
if err != nil {
|
||||
return errInvalidNetworkID
|
||||
}
|
||||
var resultBuffer *uint16
|
||||
hr := hcnDeleteNetwork(&networkGuid, &resultBuffer)
|
||||
hr := hcnDeleteNetwork(&networkGUID, &resultBuffer)
|
||||
if err := checkForErrors("hcnDeleteNetwork", hr, resultBuffer); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -291,12 +293,12 @@ func ListNetworks() ([]HostComputeNetwork, error) {
|
||||
|
||||
// ListNetworksQuery makes a call to query the list of available networks.
|
||||
func ListNetworksQuery(query HostComputeQuery) ([]HostComputeNetwork, error) {
|
||||
queryJson, err := json.Marshal(query)
|
||||
queryJSON, err := json.Marshal(query)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
networks, err := enumerateNetworks(string(queryJson))
|
||||
networks, err := enumerateNetworks(string(queryJSON))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -408,14 +410,14 @@ func (network *HostComputeNetwork) ModifyNetworkSettings(request *ModifyNetworkS
|
||||
func (network *HostComputeNetwork) AddPolicy(networkPolicy PolicyNetworkRequest) error {
|
||||
logrus.Debugf("hcn::HostComputeNetwork::AddPolicy id=%s", network.Id)
|
||||
|
||||
settingsJson, err := json.Marshal(networkPolicy)
|
||||
settingsJSON, err := json.Marshal(networkPolicy)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
requestMessage := &ModifyNetworkSettingRequest{
|
||||
ResourceType: NetworkResourceTypePolicy,
|
||||
RequestType: RequestTypeAdd,
|
||||
Settings: settingsJson,
|
||||
Settings: settingsJSON,
|
||||
}
|
||||
|
||||
return network.ModifyNetworkSettings(requestMessage)
|
||||
@ -425,14 +427,14 @@ func (network *HostComputeNetwork) AddPolicy(networkPolicy PolicyNetworkRequest)
|
||||
func (network *HostComputeNetwork) RemovePolicy(networkPolicy PolicyNetworkRequest) error {
|
||||
logrus.Debugf("hcn::HostComputeNetwork::RemovePolicy id=%s", network.Id)
|
||||
|
||||
settingsJson, err := json.Marshal(networkPolicy)
|
||||
settingsJSON, err := json.Marshal(networkPolicy)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
requestMessage := &ModifyNetworkSettingRequest{
|
||||
ResourceType: NetworkResourceTypePolicy,
|
||||
RequestType: RequestTypeRemove,
|
||||
Settings: settingsJson,
|
||||
Settings: settingsJSON,
|
||||
}
|
||||
|
||||
return network.ModifyNetworkSettings(requestMessage)
|
||||
|
40
vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go
generated
vendored
40
vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go
generated
vendored
@ -1,3 +1,5 @@
|
||||
//go:build windows
|
||||
|
||||
package hcn
|
||||
|
||||
import (
|
||||
@ -23,7 +25,7 @@ const (
|
||||
// Endpoint and Network have InterfaceConstraint and ProviderAddress
|
||||
NetworkProviderAddress EndpointPolicyType = "ProviderAddress"
|
||||
NetworkInterfaceConstraint EndpointPolicyType = "InterfaceConstraint"
|
||||
TierAcl EndpointPolicyType = "TierAcl"
|
||||
TierAcl EndpointPolicyType = "TierAcl"
|
||||
)
|
||||
|
||||
// EndpointPolicy is a collection of Policy settings for an Endpoint.
|
||||
@ -133,7 +135,7 @@ type AclPolicySetting struct {
|
||||
RemotePorts string `json:",omitempty"`
|
||||
RuleType RuleType `json:",omitempty"`
|
||||
Priority uint16 `json:",omitempty"`
|
||||
}
|
||||
}
|
||||
|
||||
// QosPolicySetting sets Quality of Service bandwidth caps on an Endpoint.
|
||||
type QosPolicySetting struct {
|
||||
@ -166,7 +168,7 @@ type NetworkACLPolicySetting struct {
|
||||
RemotePorts string `json:",omitempty"`
|
||||
RuleType RuleType `json:",omitempty"`
|
||||
Priority uint16 `json:",omitempty"`
|
||||
}
|
||||
}
|
||||
|
||||
// FiveTuple is nested in L4ProxyPolicySetting for WFP support.
|
||||
type FiveTuple struct {
|
||||
@ -284,7 +286,7 @@ type RemoteSubnetRoutePolicySetting struct {
|
||||
type SetPolicyType string
|
||||
|
||||
const (
|
||||
SetPolicyTypeIpSet SetPolicyType = "IPSET"
|
||||
SetPolicyTypeIpSet SetPolicyType = "IPSET"
|
||||
SetPolicyTypeNestedIpSet SetPolicyType = "NESTEDIPSET"
|
||||
)
|
||||
|
||||
@ -292,7 +294,7 @@ const (
|
||||
type SetPolicySetting struct {
|
||||
Id string
|
||||
Name string
|
||||
Type SetPolicyType
|
||||
Type SetPolicyType `json:"PolicyType"`
|
||||
Values string
|
||||
}
|
||||
|
||||
@ -313,32 +315,32 @@ const (
|
||||
ProtocolTypeICMPv6 ProtocolType = 58
|
||||
)
|
||||
|
||||
//L4ProxyPolicySetting applies proxy policy on network/endpoint
|
||||
// L4ProxyPolicySetting applies proxy policy on network/endpoint
|
||||
type L4ProxyPolicySetting struct {
|
||||
IP string `json:",omitempty"`
|
||||
Port string `json:",omitempty"`
|
||||
Protocol ProtocolType `json:",omitempty"`
|
||||
Exceptions []string `json:",omitempty"`
|
||||
Destination string
|
||||
OutboundNAT bool `json:",omitempty"`
|
||||
OutboundNAT bool `json:",omitempty"`
|
||||
}
|
||||
|
||||
// TierAclRule represents an ACL within TierAclPolicySetting
|
||||
type TierAclRule struct {
|
||||
Id string `json:",omitempty"`
|
||||
Protocols string `json:",omitempty"`
|
||||
TierAclRuleAction ActionType `json:","`
|
||||
LocalAddresses string `json:",omitempty"`
|
||||
RemoteAddresses string `json:",omitempty"`
|
||||
LocalPorts string `json:",omitempty"`
|
||||
RemotePorts string `json:",omitempty"`
|
||||
Priority uint16 `json:",omitempty"`
|
||||
Id string `json:",omitempty"`
|
||||
Protocols string `json:",omitempty"`
|
||||
TierAclRuleAction ActionType `json:","`
|
||||
LocalAddresses string `json:",omitempty"`
|
||||
RemoteAddresses string `json:",omitempty"`
|
||||
LocalPorts string `json:",omitempty"`
|
||||
RemotePorts string `json:",omitempty"`
|
||||
Priority uint16 `json:",omitempty"`
|
||||
}
|
||||
|
||||
// TierAclPolicySetting represents a Tier containing ACLs
|
||||
type TierAclPolicySetting struct {
|
||||
Name string `json:","`
|
||||
Direction DirectionType `json:","`
|
||||
Order uint16 `json:""`
|
||||
TierAclRules []TierAclRule `json:",omitempty"`
|
||||
Name string `json:","`
|
||||
Direction DirectionType `json:","`
|
||||
Order uint16 `json:""`
|
||||
TierAclRules []TierAclRule `json:",omitempty"`
|
||||
}
|
||||
|
2
vendor/github.com/Microsoft/hcsshim/hcn/hcnroute.go
generated
vendored
2
vendor/github.com/Microsoft/hcsshim/hcn/hcnroute.go
generated
vendored
@ -1,3 +1,5 @@
|
||||
//go:build windows
|
||||
|
||||
package hcn
|
||||
|
||||
import (
|
||||
|
11
vendor/github.com/Microsoft/hcsshim/hcn/hcnsupport.go
generated
vendored
11
vendor/github.com/Microsoft/hcsshim/hcn/hcnsupport.go
generated
vendored
@ -1,11 +1,14 @@
|
||||
//go:build windows
|
||||
|
||||
package hcn
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Microsoft/hcsshim/internal/log"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -112,9 +115,9 @@ func getSupportedFeatures() (SupportedFeatures, error) {
|
||||
features.NetworkACL = isFeatureSupported(globals.Version, NetworkACLPolicyVersion)
|
||||
features.NestedIpSet = isFeatureSupported(globals.Version, NestedIpSetVersion)
|
||||
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"version": fmt.Sprintf("%+v", globals.Version),
|
||||
"supportedFeatures": fmt.Sprintf("%+v", features),
|
||||
log.L.WithFields(logrus.Fields{
|
||||
"version": globals.Version,
|
||||
"supportedFeatures": features,
|
||||
}).Info("HCN feature check")
|
||||
|
||||
return features, nil
|
||||
|
1457
vendor/github.com/Microsoft/hcsshim/hcn/zsyscall_windows.go
generated
vendored
1457
vendor/github.com/Microsoft/hcsshim/hcn/zsyscall_windows.go
generated
vendored
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user