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

fix 503 error caused by outdated endpooints #4753

Closed
wants to merge 1 commit into from
Closed
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
16 changes: 13 additions & 3 deletions internal/provider/kubernetes/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,22 @@
} else {
for _, endpointSlice := range endpointSliceList.Items {
key := utils.NamespacedName(&endpointSlice).String()
r.log.Info("added EndpointSlice to resource tree",
"namespace", endpointSlice.Namespace,
"name", endpointSlice.Name)

Check warning on line 459 in internal/provider/kubernetes/controller.go

View check run for this annotation

Codecov / codecov/patch

internal/provider/kubernetes/controller.go#L457-L459

Added lines #L457 - L459 were not covered by tests
if !resourceMappings.allAssociatedEndpointSlices.Has(key) {
resourceMappings.allAssociatedEndpointSlices.Insert(key)
r.log.Info("added EndpointSlice to resource tree",
"namespace", endpointSlice.Namespace,
"name", endpointSlice.Name)
gwcResource.EndpointSlices = append(gwcResource.EndpointSlices, &endpointSlice)
} else {
updated := gwcResource.EndpointSlices
for i, es := range gwcResource.EndpointSlices {
if es.Name == endpointSlice.Name && es.Namespace == endpointSlice.Namespace {
updated = append(updated[:i], updated[i+1:]...)
updated = append(updated, &endpointSlice)
break

Check warning on line 469 in internal/provider/kubernetes/controller.go

View check run for this annotation

Codecov / codecov/patch

internal/provider/kubernetes/controller.go#L463-L469

Added lines #L463 - L469 were not covered by tests
}
}
gwcResource.EndpointSlices = updated

Check warning on line 472 in internal/provider/kubernetes/controller.go

View check run for this annotation

Codecov / codecov/patch

internal/provider/kubernetes/controller.go#L472

Added line #L472 was not covered by tests
}
}
}
Expand Down
Loading