Skip to content

Commit

Permalink
Revert hcsshim version bump
Browse files Browse the repository at this point in the history
Revert hcsshim version bump from v0.11.6 back to v0.11.4,
as this was breaking Windows policies.

(original PR #8913)
  • Loading branch information
coutinhop committed Jul 26, 2024
1 parent 54a77c0 commit 00b78af
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 33 deletions.
5 changes: 1 addition & 4 deletions felix/dataplane/windows/endpoint_mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,7 @@ 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.
// 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" {
if len(endpoint.SharedContainers) == 0 {
log.WithFields(log.Fields{
"id": endpoint.Id,
"name": endpoint.Name,
Expand Down
25 changes: 2 additions & 23 deletions felix/dataplane/windows/hns/hns_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,26 +119,6 @@ type Policy struct {

// Types from hnsendpoint.go.

// EndpointState represents the states of an HNS Endpoint lifecycle.
type EndpointState uint16

const (
Uninitialized EndpointState = iota
Created EndpointState = 1
Attached EndpointState = 2
AttachedSharing EndpointState = 3
Detached EndpointState = 4
Degraded EndpointState = 5
Destroyed EndpointState = 6
)

// EndpointState const
// The lifecycle of an Endpoint goes through created, attached, AttachedSharing - endpoint is being shared with other containers,
// detached, after being attached, degraded and finally destroyed.
func (es EndpointState) String() string {
return [...]string{"Uninitialized", "Attached", "AttachedSharing", "Detached", "Degraded", "Destroyed"}[es]
}

// HNSEndpoint represents a network endpoint in HNS
type HNSEndpoint struct {
Id string `json:"ID,omitempty"`
Expand All @@ -161,9 +141,8 @@ type HNSEndpoint struct {
IsRemoteEndpoint bool `json:",omitempty"`
EnableLowMetric bool `json:",omitempty"`
//Namespace *Namespace `json:",omitempty"`
EncapOverhead uint16 `json:",omitempty"`
SharedContainers []string `json:",omitempty"`
State EndpointState `json:",omitempty"`
EncapOverhead uint16 `json:",omitempty"`
SharedContainers []string `json:",omitempty"`
}

// ApplyACLPolicy applies a set of ACL Policies on the Endpoint
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22

require (
github.com/BurntSushi/toml v1.3.2
github.com/Microsoft/hcsshim v0.11.6
github.com/Microsoft/hcsshim v0.11.4
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
Expand Down Expand Up @@ -120,7 +120,7 @@ require (
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/GoogleCloudPlatform/k8s-cloud-provider v1.18.1-0.20220218231025-f11817397a1b // indirect
github.com/JeffAshton/win_pdh v0.0.0-20161109143554-76bb4ee9f0ab // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705 // indirect
github.com/alessio/shellescape v1.4.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ github.com/JeffAshton/win_pdh v0.0.0-20161109143554-76bb4ee9f0ab/go.mod h1:3VYc5
github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
github.com/Microsoft/go-winio v0.4.15/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
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/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8=
github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w=
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=
Expand Down

0 comments on commit 00b78af

Please sign in to comment.