build(deps): bump the golang group with 5 updates
Bumps the golang group with 5 updates: | Package | From | To | | --- | --- | --- | | [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) | `0.11.4` | `0.12.0` | | [github.com/alexflint/go-filemutex](https://github.com/alexflint/go-filemutex) | `1.2.0` | `1.3.0` | | [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) | `2.13.2` | `2.16.0` | | [github.com/onsi/gomega](https://github.com/onsi/gomega) | `1.30.0` | `1.31.1` | | [golang.org/x/sys](https://github.com/golang/sys) | `0.15.0` | `0.17.0` | Updates `github.com/Microsoft/hcsshim` from 0.11.4 to 0.12.0 - [Release notes](https://github.com/Microsoft/hcsshim/releases) - [Commits](https://github.com/Microsoft/hcsshim/compare/v0.11.4...v0.12.0) Updates `github.com/alexflint/go-filemutex` from 1.2.0 to 1.3.0 - [Release notes](https://github.com/alexflint/go-filemutex/releases) - [Commits](https://github.com/alexflint/go-filemutex/compare/v1.2.0...v1.3.0) Updates `github.com/onsi/ginkgo/v2` from 2.13.2 to 2.16.0 - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/ginkgo/compare/v2.13.2...v2.16.0) Updates `github.com/onsi/gomega` from 1.30.0 to 1.31.1 - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.30.0...v1.31.1) Updates `golang.org/x/sys` from 0.15.0 to 0.17.0 - [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.17.0) --- updated-dependencies: - dependency-name: github.com/Microsoft/hcsshim dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golang - dependency-name: github.com/alexflint/go-filemutex dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golang - dependency-name: github.com/onsi/ginkgo/v2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golang - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golang - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golang ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
12
vendor/github.com/Microsoft/hcsshim/hcn/hcn.go
generated
vendored
12
vendor/github.com/Microsoft/hcsshim/hcn/hcn.go
generated
vendored
@ -312,6 +312,18 @@ func NestedIpSetSupported() error {
|
||||
return platformDoesNotSupportError("NestedIpSet")
|
||||
}
|
||||
|
||||
// DisableHostPortSupported returns an error if the HCN version does not support DisableHostPort flag
|
||||
func DisableHostPortSupported() error {
|
||||
supported, err := GetCachedSupportedFeatures()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if supported.DisableHostPort {
|
||||
return nil
|
||||
}
|
||||
return platformDoesNotSupportError("DisableHostPort")
|
||||
}
|
||||
|
||||
// RequestType are the different operations performed to settings.
|
||||
// Used to update the settings of Endpoint/Namespace objects.
|
||||
type RequestType string
|
||||
|
57
vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go
generated
vendored
57
vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go
generated
vendored
@ -6,11 +6,12 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"golang.org/x/sys/windows"
|
||||
|
||||
"github.com/Microsoft/hcsshim/internal/hcs"
|
||||
"github.com/Microsoft/hcsshim/internal/hcserror"
|
||||
"github.com/Microsoft/hcsshim/internal/interop"
|
||||
"github.com/sirupsen/logrus"
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -63,8 +64,8 @@ func (e *HcnError) Error() string {
|
||||
}
|
||||
|
||||
func CheckErrorWithCode(err error, code ErrorCode) bool {
|
||||
hcnError, ok := err.(*HcnError)
|
||||
if ok {
|
||||
var hcnError *HcnError
|
||||
if errors.As(err, &hcnError) {
|
||||
return hcnError.code == code
|
||||
}
|
||||
return false
|
||||
@ -81,7 +82,7 @@ func IsPortAlreadyExistsError(err error) bool {
|
||||
func new(hr error, title string, rest string) error {
|
||||
err := &HcnError{}
|
||||
hcsError := hcserror.New(hr, title, rest)
|
||||
err.HcsError = hcsError.(*hcserror.HcsError)
|
||||
err.HcsError = hcsError.(*hcserror.HcsError) //nolint:errorlint
|
||||
err.code = ErrorCode(hcserror.Win32FromError(hr))
|
||||
return err
|
||||
}
|
||||
@ -97,6 +98,8 @@ type NetworkNotFoundError struct {
|
||||
NetworkID string
|
||||
}
|
||||
|
||||
var _ error = NetworkNotFoundError{}
|
||||
|
||||
func (e NetworkNotFoundError) Error() string {
|
||||
if e.NetworkName != "" {
|
||||
return fmt.Sprintf("Network name %q not found", e.NetworkName)
|
||||
@ -110,6 +113,8 @@ type EndpointNotFoundError struct {
|
||||
EndpointID string
|
||||
}
|
||||
|
||||
var _ error = EndpointNotFoundError{}
|
||||
|
||||
func (e EndpointNotFoundError) Error() string {
|
||||
if e.EndpointName != "" {
|
||||
return fmt.Sprintf("Endpoint name %q not found", e.EndpointName)
|
||||
@ -122,6 +127,8 @@ type NamespaceNotFoundError struct {
|
||||
NamespaceID string
|
||||
}
|
||||
|
||||
var _ error = NamespaceNotFoundError{}
|
||||
|
||||
func (e NamespaceNotFoundError) Error() string {
|
||||
return fmt.Sprintf("Namespace ID %q not found", e.NamespaceID)
|
||||
}
|
||||
@ -131,6 +138,8 @@ type LoadBalancerNotFoundError struct {
|
||||
LoadBalancerId string
|
||||
}
|
||||
|
||||
var _ error = LoadBalancerNotFoundError{}
|
||||
|
||||
func (e LoadBalancerNotFoundError) Error() string {
|
||||
return fmt.Sprintf("LoadBalancer %q not found", e.LoadBalancerId)
|
||||
}
|
||||
@ -140,6 +149,8 @@ type RouteNotFoundError struct {
|
||||
RouteId string
|
||||
}
|
||||
|
||||
var _ error = RouteNotFoundError{}
|
||||
|
||||
func (e RouteNotFoundError) Error() string {
|
||||
return fmt.Sprintf("SDN Route %q not found", e.RouteId)
|
||||
}
|
||||
@ -147,19 +158,31 @@ func (e RouteNotFoundError) Error() string {
|
||||
// IsNotFoundError returns a boolean indicating whether the error was caused by
|
||||
// a resource not being found.
|
||||
func IsNotFoundError(err error) bool {
|
||||
switch pe := err.(type) {
|
||||
case NetworkNotFoundError:
|
||||
// Calling [errors.As] in a loop over `[]error{NetworkNotFoundError{}, ...}` will not work,
|
||||
// since the loop variable will be an interface type (ie, `error`) and `errors.As(error, *error)` will
|
||||
// always succeed.
|
||||
// Unless golang adds loops over (or arrays of) types, we need to manually call `errors.As` for
|
||||
// each potential error type.
|
||||
//
|
||||
// Also, for T = NetworkNotFoundError and co, the error implementation is for T, not *T
|
||||
if e := (NetworkNotFoundError{}); errors.As(err, &e) {
|
||||
return true
|
||||
case EndpointNotFoundError:
|
||||
return true
|
||||
case NamespaceNotFoundError:
|
||||
return true
|
||||
case LoadBalancerNotFoundError:
|
||||
return true
|
||||
case RouteNotFoundError:
|
||||
return true
|
||||
case *hcserror.HcsError:
|
||||
return pe.Err == hcs.ErrElementNotFound
|
||||
}
|
||||
if e := (EndpointNotFoundError{}); errors.As(err, &e) {
|
||||
return true
|
||||
}
|
||||
if e := (NamespaceNotFoundError{}); errors.As(err, &e) {
|
||||
return true
|
||||
}
|
||||
if e := (LoadBalancerNotFoundError{}); errors.As(err, &e) {
|
||||
return true
|
||||
}
|
||||
if e := (RouteNotFoundError{}); errors.As(err, &e) {
|
||||
return true
|
||||
}
|
||||
if e := (&hcserror.HcsError{}); errors.As(err, &e) {
|
||||
return errors.Is(e.Err, hcs.ErrElementNotFound)
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
3
vendor/github.com/Microsoft/hcsshim/hcn/hcnglobals.go
generated
vendored
3
vendor/github.com/Microsoft/hcsshim/hcn/hcnglobals.go
generated
vendored
@ -84,6 +84,9 @@ var (
|
||||
|
||||
//HNS 15.0 allows for NestedIpSet support
|
||||
NestedIpSetVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 15, Minor: 0}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}}
|
||||
|
||||
//HNS 15.1 allows support for DisableHostPort flag.
|
||||
DisableHostPortVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 15, Minor: 1}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}}
|
||||
)
|
||||
|
||||
// GetGlobals returns the global properties of the HCN Service.
|
||||
|
4
vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go
generated
vendored
4
vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go
generated
vendored
@ -4,6 +4,7 @@ package hcn
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"os"
|
||||
"syscall"
|
||||
|
||||
@ -378,7 +379,8 @@ func (namespace *HostComputeNamespace) Sync() error {
|
||||
shimPath := runhcs.VMPipePath(cfg.HostUniqueID)
|
||||
if err := runhcs.IssueVMRequest(shimPath, &req); err != nil {
|
||||
// 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 {
|
||||
var perr *os.PathError
|
||||
if errors.As(err, &perr) && errors.Is(perr.Err, syscall.ERROR_FILE_NOT_FOUND) {
|
||||
// Remove the reg key there is no point to try again
|
||||
_ = cfg.Remove()
|
||||
return nil
|
||||
|
1
vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go
generated
vendored
1
vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go
generated
vendored
@ -72,6 +72,7 @@ type NetworkFlags uint32
|
||||
const (
|
||||
None NetworkFlags = 0
|
||||
EnableNonPersistent NetworkFlags = 8
|
||||
DisableHostPort NetworkFlags = 1024
|
||||
)
|
||||
|
||||
// HostComputeNetwork represents a network
|
||||
|
2
vendor/github.com/Microsoft/hcsshim/hcn/hcnsupport.go
generated
vendored
2
vendor/github.com/Microsoft/hcsshim/hcn/hcnsupport.go
generated
vendored
@ -37,6 +37,7 @@ type SupportedFeatures struct {
|
||||
TierAcl bool `json:"TierAcl"`
|
||||
NetworkACL bool `json:"NetworkACL"`
|
||||
NestedIpSet bool `json:"NestedIpSet"`
|
||||
DisableHostPort bool `json:"DisableHostPort"`
|
||||
}
|
||||
|
||||
// AclFeatures are the supported ACL possibilities.
|
||||
@ -114,6 +115,7 @@ func getSupportedFeatures() (SupportedFeatures, error) {
|
||||
features.TierAcl = isFeatureSupported(globals.Version, TierAclPolicyVersion)
|
||||
features.NetworkACL = isFeatureSupported(globals.Version, NetworkACLPolicyVersion)
|
||||
features.NestedIpSet = isFeatureSupported(globals.Version, NestedIpSetVersion)
|
||||
features.DisableHostPort = isFeatureSupported(globals.Version, DisableHostPortVersion)
|
||||
|
||||
log.L.WithFields(logrus.Fields{
|
||||
"version": globals.Version,
|
||||
|
Reference in New Issue
Block a user