Skip to content

Conversation

@bansal19
Copy link
Contributor

@bansal19 bansal19 commented Dec 6, 2022

Issue #, if available: #254

Description of changes:
When exporting a service from Cluster A, we call DiscoverInstances on an entire clusterset in order to determine if there are any changes for the service we wish to export. If there are any changes, all endpoints in that service will be wiped by the endpoints being exported by Cluster A for this service. In order to mitigate this, we must check for the current cluster's endpoints only when calling DiscoverInstances to Cloud Map.

To make sure we obtain the correct endpoints, we will need to invalidate the cache.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@bansal19 bansal19 requested a review from CurtisThe December 8, 2022 20:57
@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2022

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 70.59%. Comparing base (ba90126) to head (b094033).
⚠️ Report is 161 commits behind head on main.

Files with missing lines Patch % Lines
...ntrollers/multicluster/serviceexport_controller.go 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #255      +/-   ##
==========================================
- Coverage   70.86%   70.59%   -0.28%     
==========================================
  Files          17       17              
  Lines        1713     1724      +11     
==========================================
+ Hits         1214     1217       +3     
- Misses        417      423       +6     
- Partials       82       84       +2     
Files with missing lines Coverage Δ
pkg/model/types.go 66.47% <100.00%> (+1.22%) ⬆️
...ntrollers/multicluster/serviceexport_controller.go 37.37% <90.90%> (-1.67%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba90126...b094033. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bansal19 bansal19 requested a review from jaywasd December 8, 2022 20:57
Copy link
Contributor

@astaticvoid astaticvoid left a comment

Choose a reason for hiding this comment

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

Thanks for the fix and improvements :)

@astaticvoid astaticvoid linked an issue Dec 8, 2022 that may be closed by this pull request
@bansal19 bansal19 merged commit d68c768 into aws:main Dec 8, 2022
@bansal19 bansal19 deleted the beshard/service-export-bug-fix branch December 8, 2022 23:23
runakash pushed a commit to runakash/aws-cloud-map-mcs-controller-for-k8s that referenced this pull request Jun 20, 2025
Check cluster ID during service export
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Service's endpoints being replaced during export

6 participants