Skip to content

fix(multicluster): make service cleanup logic respect namespaces#15201

Open
cbond-cohere wants to merge 1 commit intolinkerd:mainfrom
cbond-cohere:cleanup-namespaced-mirror-services
Open

fix(multicluster): make service cleanup logic respect namespaces#15201
cbond-cohere wants to merge 1 commit intolinkerd:mainfrom
cbond-cohere:cleanup-namespaced-mirror-services

Conversation

@cbond-cohere
Copy link
Copy Markdown

@cbond-cohere cbond-cohere commented Apr 22, 2026

createOrUpdateHeadlessEndpoints and handleRemoteServiceUnexported compare a list of namespace-level endpoint mirror services to a cluster-wide list of services that match the headless mirror name. This results in unintended service deletion when multiple headless mirror services of the same name exist in different namespaces. Fix this by restricting the list call to the namespace of the exported service.

Fixes #15200

@cbond-cohere cbond-cohere force-pushed the cleanup-namespaced-mirror-services branch 3 times, most recently from 7a4c271 to df7b53f Compare April 23, 2026 13:07
@cbond-cohere cbond-cohere marked this pull request as ready for review April 23, 2026 13:09
@cbond-cohere cbond-cohere requested a review from a team as a code owner April 23, 2026 13:09
Copy link
Copy Markdown
Contributor

@maxbrunet maxbrunet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for debugging and fixing this!

Comment thread multicluster/service-mirror/cluster_watcher_headless.go
@unleashed unleashed requested review from adleong April 24, 2026 16:16
@cbond-cohere cbond-cohere force-pushed the cleanup-namespaced-mirror-services branch from df7b53f to 8e84987 Compare April 24, 2026 16:35
Copy link
Copy Markdown
Member

@adleong adleong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find and nice fix!

@adleong
Copy link
Copy Markdown
Member

adleong commented Apr 25, 2026

It looks like there's a lint error where one of the test parameter can be removed.

@cbond-cohere cbond-cohere force-pushed the cleanup-namespaced-mirror-services branch from 8e84987 to 675055d Compare April 27, 2026 13:43
@cbond-cohere
Copy link
Copy Markdown
Author

cbond-cohere commented Apr 27, 2026

It looks like there's a lint error where one of the test parameter can be removed.

Thanks @adleong! I ended up putting in an ignore directive for these warnings since other functions in the test suite ignore this particular check. Happy to remove the parameters altogether if you prefer.

createOrUpdateHeadlessEndpoints and handleRemoteServiceUnexported compare a list of namespace-level endpoint mirror services to a cluster-wide list of services that match the headless mirror name. This results in unintended service deletion when multiple headless mirror services of the same name exist in different namespaces. Fix this by restricting the list call to the namespace of the exported service.

Signed-off-by: Cody Bond <cody.bond@cohere.com>
@cbond-cohere cbond-cohere force-pushed the cleanup-namespaced-mirror-services branch from 675055d to 61b1755 Compare April 27, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Service mirror cleanup logic does not respect namespaces

4 participants