Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3.26] [CORE-10548] Revert windows endpoint mgr logic change #9071

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions felix/dataplane/windows/endpoint_mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,20 @@ func (m *endpointManager) RefreshHnsEndpointCache(forceRefresh bool) error {
continue
}

// 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" {
// 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 {
log.WithFields(log.Fields{
"id": endpoint.Id,
"name": endpoint.Name,
}).Warn("This is a stale endpoint with no container attached")
log.WithFields(log.Fields{
"id": endpoint.Id,
"name": endpoint.Name,
"state": endpoint.State.String(),
"sharedcontainers": endpoint.SharedContainers,
}).Debug("Stale endpoint debug information")
continue
}
ip := endpoint.IPAddress.String() + ipv4AddrSuffix
Expand Down