diff --git a/felix/dataplane/windows/endpoint_mgr.go b/felix/dataplane/windows/endpoint_mgr.go index df0b6984971..7dcc2beeb41 100644 --- a/felix/dataplane/windows/endpoint_mgr.go +++ b/felix/dataplane/windows/endpoint_mgr.go @@ -194,7 +194,10 @@ func (m *endpointManager) RefreshHnsEndpointCache(forceRefresh bool) error { // Some CNI plugins do not clear endpoint properly when a pod has been torn down. // In that case, it is possible Felix sees multiple endpoints with the same IP. // We need to filter out inactive endpoints that do not attach to any container. - if len(endpoint.SharedContainers) == 0 { + // An endpoint is considered to be active if its state is Attached or AttachedSharing. + // Note: Endpoint.State attribute is dependent on HNS v1 api. If hcsshim upgrades to HNS v2 + // api this will break. We then need to Reach out to Microsoft to facilate the change via HNS. + if endpoint.State.String() != "Attached" && endpoint.State.String() != "AttachedSharing" { log.WithFields(log.Fields{ "id": endpoint.Id, "name": endpoint.Name, diff --git a/go.mod b/go.mod index 02d22f61d41..a23cdbe1f9b 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.23.2 require ( github.com/BurntSushi/toml v1.3.2 github.com/Masterminds/semver/v3 v3.2.1 - github.com/Microsoft/hcsshim v0.11.6 + github.com/Microsoft/hcsshim v0.11.8 github.com/apparentlymart/go-cidr v1.1.0 github.com/aws/aws-sdk-go-v2 v1.25.0 github.com/aws/aws-sdk-go-v2/config v1.27.0 @@ -149,7 +149,7 @@ require ( github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b // indirect github.com/containerd/cgroups v1.1.0 // indirect github.com/containerd/console v1.0.3 // indirect - github.com/containerd/containerd v1.6.26 // indirect + github.com/containerd/errdefs v0.1.0 // indirect github.com/containerd/ttrpc v1.2.2 // indirect github.com/coreos/go-iptables v0.6.0 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect @@ -277,6 +277,7 @@ require ( gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.5.0 // indirect k8s.io/cloud-provider v0.30.5 // indirect k8s.io/component-helpers v0.30.5 // indirect k8s.io/controller-manager v0.30.5 // indirect diff --git a/go.sum b/go.sum index 499cea42d59..e4297f38282 100644 --- a/go.sum +++ b/go.sum @@ -62,8 +62,8 @@ github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0 github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= -github.com/Microsoft/hcsshim v0.11.6 h1:qxVO1cqHMQFm11vXklhRIYu/qiukJCqccjQAOddolvk= -github.com/Microsoft/hcsshim v0.11.6/go.mod h1:MV8xMfmECjl5HdO7U/3/hFVnkmSBjAjmA09d4bExKcU= +github.com/Microsoft/hcsshim v0.11.8 h1:EkF8Ock/nbiyvJiDQSx6BrKxRfhWM6vMReYxdEnnxlM= +github.com/Microsoft/hcsshim v0.11.8/go.mod h1:7WoMmKab3539VyLrzI8XBZsoxMHl11ei6ADhND/zEa8= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -161,8 +161,8 @@ github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaD github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/containerd v1.6.26 h1:VVfrE6ZpyisvB1fzoY8Vkiq4sy+i5oF4uk7zu03RaHs= -github.com/containerd/containerd v1.6.26/go.mod h1:I4TRdsdoo5MlKob5khDJS2EPT1l1oMNaE2MBm6FrwxM= +github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM= +github.com/containerd/errdefs v0.1.0/go.mod h1:YgWiiHtLmSeBrvpw+UfPijzbLaB77mEG1WwJTDETIV0= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/ttrpc v1.2.2 h1:9vqZr0pxwOF5koz6N0N3kJ0zDHokrcPxIR/ZR2YFtOs=