vendor: bump hcsshim to v0.8.22
This tag of hcsshim brings in a couple welcome features/improvements. One being exposing a way to query for hns endpoint statistics (Packets received/sent etc.). This tag also contains some optimizations for querying whether a certain HCN feature is supported, which is a common workflow in kube-proxy on Windows. The first result from querying HCN is now cached so further calls can skip the hcn query as well as the version range parsing that was performed. This also gets rid of some redundant logs that used to hit everytime the version range parsing occurred. The Go-winio dep bump, and all of the ctrd deps are transitive only. Nothing new is needed/intended to be used. Signed-off-by: Daniel Canter <dcanter@microsoft.com>
This commit is contained in:
117
vendor/github.com/Microsoft/hcsshim/hcn/hcn.go
generated
vendored
117
vendor/github.com/Microsoft/hcsshim/hcn/hcn.go
generated
vendored
@@ -64,12 +64,6 @@ import (
|
||||
//sys hcnDeleteRoute(id *_guid, result **uint16) (hr error) = computenetwork.HcnDeleteSdnRoute?
|
||||
//sys hcnCloseRoute(route hcnRoute) (hr error) = computenetwork.HcnCloseSdnRoute?
|
||||
|
||||
// Service
|
||||
//sys hcnOpenService(service *hcnService, result **uint16) (hr error) = computenetwork.HcnOpenService?
|
||||
//sys hcnRegisterServiceCallback(service hcnService, callback int32, context int32, callbackHandle *hcnCallbackHandle) (hr error) = computenetwork.HcnRegisterServiceCallback?
|
||||
//sys hcnUnregisterServiceCallback(callbackHandle hcnCallbackHandle) (hr error) = computenetwork.HcnUnregisterServiceCallback?
|
||||
//sys hcnCloseService(service hcnService) (hr error) = computenetwork.HcnCloseService?
|
||||
|
||||
type _guid = guid.GUID
|
||||
|
||||
type hcnNetwork syscall.Handle
|
||||
@@ -77,8 +71,6 @@ type hcnEndpoint syscall.Handle
|
||||
type hcnNamespace syscall.Handle
|
||||
type hcnLoadBalancer syscall.Handle
|
||||
type hcnRoute syscall.Handle
|
||||
type hcnService syscall.Handle
|
||||
type hcnCallbackHandle syscall.Handle
|
||||
|
||||
// SchemaVersion for HCN Objects/Queries.
|
||||
type SchemaVersion = Version // hcnglobals.go
|
||||
@@ -101,6 +93,20 @@ type HostComputeQuery struct {
|
||||
Filter string `json:",omitempty"`
|
||||
}
|
||||
|
||||
type ExtraParams struct {
|
||||
Resources json.RawMessage `json:",omitempty"`
|
||||
SharedContainers json.RawMessage `json:",omitempty"`
|
||||
LayeredOn string `json:",omitempty"`
|
||||
SwitchGuid string `json:",omitempty"`
|
||||
UtilityVM string `json:",omitempty"`
|
||||
VirtualMachine string `json:",omitempty"`
|
||||
}
|
||||
|
||||
type Health struct {
|
||||
Data interface{} `json:",omitempty"`
|
||||
Extra ExtraParams `json:",omitempty"`
|
||||
}
|
||||
|
||||
// defaultQuery generates HCN Query.
|
||||
// Passed into get/enumerate calls to filter results.
|
||||
func defaultQuery() HostComputeQuery {
|
||||
@@ -114,15 +120,6 @@ func defaultQuery() HostComputeQuery {
|
||||
return query
|
||||
}
|
||||
|
||||
func defaultQueryJson() string {
|
||||
query := defaultQuery()
|
||||
queryJson, err := json.Marshal(query)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return string(queryJson)
|
||||
}
|
||||
|
||||
// PlatformDoesNotSupportError happens when users are attempting to use a newer shim on an older OS
|
||||
func platformDoesNotSupportError(featureName string) error {
|
||||
return fmt.Errorf("Platform does not support feature %s", featureName)
|
||||
@@ -130,7 +127,10 @@ func platformDoesNotSupportError(featureName string) error {
|
||||
|
||||
// V2ApiSupported returns an error if the HCN version does not support the V2 Apis.
|
||||
func V2ApiSupported() error {
|
||||
supported := GetSupportedFeatures()
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if supported.Api.V2 {
|
||||
return nil
|
||||
}
|
||||
@@ -146,7 +146,10 @@ func V2SchemaVersion() SchemaVersion {
|
||||
|
||||
// RemoteSubnetSupported returns an error if the HCN version does not support Remote Subnet policies.
|
||||
func RemoteSubnetSupported() error {
|
||||
supported := GetSupportedFeatures()
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if supported.RemoteSubnet {
|
||||
return nil
|
||||
}
|
||||
@@ -155,7 +158,10 @@ func RemoteSubnetSupported() error {
|
||||
|
||||
// HostRouteSupported returns an error if the HCN version does not support Host Route policies.
|
||||
func HostRouteSupported() error {
|
||||
supported := GetSupportedFeatures()
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if supported.HostRoute {
|
||||
return nil
|
||||
}
|
||||
@@ -164,7 +170,10 @@ func HostRouteSupported() error {
|
||||
|
||||
// DSRSupported returns an error if the HCN version does not support Direct Server Return.
|
||||
func DSRSupported() error {
|
||||
supported := GetSupportedFeatures()
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if supported.DSR {
|
||||
return nil
|
||||
}
|
||||
@@ -173,7 +182,10 @@ func DSRSupported() error {
|
||||
|
||||
// Slash32EndpointPrefixesSupported returns an error if the HCN version does not support configuring endpoints with /32 prefixes.
|
||||
func Slash32EndpointPrefixesSupported() error {
|
||||
supported := GetSupportedFeatures()
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if supported.Slash32EndpointPrefixes {
|
||||
return nil
|
||||
}
|
||||
@@ -182,7 +194,10 @@ func Slash32EndpointPrefixesSupported() error {
|
||||
|
||||
// AclSupportForProtocol252Supported returns an error if the HCN version does not support HNS ACL Policies to support protocol 252 for VXLAN.
|
||||
func AclSupportForProtocol252Supported() error {
|
||||
supported := GetSupportedFeatures()
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if supported.AclSupportForProtocol252 {
|
||||
return nil
|
||||
}
|
||||
@@ -191,7 +206,10 @@ func AclSupportForProtocol252Supported() error {
|
||||
|
||||
// SessionAffinitySupported returns an error if the HCN version does not support Session Affinity.
|
||||
func SessionAffinitySupported() error {
|
||||
supported := GetSupportedFeatures()
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if supported.SessionAffinity {
|
||||
return nil
|
||||
}
|
||||
@@ -200,16 +218,46 @@ func SessionAffinitySupported() error {
|
||||
|
||||
// IPv6DualStackSupported returns an error if the HCN version does not support IPv6DualStack.
|
||||
func IPv6DualStackSupported() error {
|
||||
supported := GetSupportedFeatures()
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if supported.IPv6DualStack {
|
||||
return nil
|
||||
}
|
||||
return platformDoesNotSupportError("IPv6 DualStack")
|
||||
}
|
||||
|
||||
//L4proxySupported returns an error if the HCN verison does not support L4Proxy
|
||||
func L4proxyPolicySupported() error {
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if supported.L4Proxy {
|
||||
return nil
|
||||
}
|
||||
return platformDoesNotSupportError("L4ProxyPolicy")
|
||||
}
|
||||
|
||||
// L4WfpProxySupported returns an error if the HCN verison does not support L4WfpProxy
|
||||
func L4WfpProxyPolicySupported() error {
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if supported.L4WfpProxy {
|
||||
return nil
|
||||
}
|
||||
return platformDoesNotSupportError("L4WfpProxyPolicy")
|
||||
}
|
||||
|
||||
// SetPolicySupported returns an error if the HCN version does not support SetPolicy.
|
||||
func SetPolicySupported() error {
|
||||
supported := GetSupportedFeatures()
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if supported.SetPolicy {
|
||||
return nil
|
||||
}
|
||||
@@ -218,13 +266,28 @@ func SetPolicySupported() error {
|
||||
|
||||
// VxlanPortSupported returns an error if the HCN version does not support configuring the VXLAN TCP port.
|
||||
func VxlanPortSupported() error {
|
||||
supported := GetSupportedFeatures()
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if supported.VxlanPort {
|
||||
return nil
|
||||
}
|
||||
return platformDoesNotSupportError("VXLAN port configuration")
|
||||
}
|
||||
|
||||
// TierAclPolicySupported returns an error if the HCN version does not support configuring the TierAcl.
|
||||
func TierAclPolicySupported() error {
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if supported.TierAcl {
|
||||
return nil
|
||||
}
|
||||
return platformDoesNotSupportError("TierAcl")
|
||||
}
|
||||
|
||||
// RequestType are the different operations performed to settings.
|
||||
// Used to update the settings of Endpoint/Namespace objects.
|
||||
type RequestType string
|
||||
|
||||
Reference in New Issue
Block a user