-
Notifications
You must be signed in to change notification settings - Fork 29
Importing Headless Services Support for A/AAAA records #180
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #180 +/- ##
==========================================
+ Coverage 72.65% 72.84% +0.19%
==========================================
Files 15 15
Lines 1558 1569 +11
==========================================
+ Hits 1132 1143 +11
Misses 342 342
Partials 84 84
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
@@ -174,6 +174,22 @@ func CreateDerivedServiceStruct(svcImport *multiclusterv1alpha1.ServiceImport, i | |||
svcPorts = append(svcPorts, PortToServicePort(*svcPort)) | |||
} | |||
|
|||
// if svcImport is Headless type, specify ClusterIP field to "None" | |||
if svcImport.Spec.Type == multiclusterv1alpha1.Headless { | |||
return &v1.Service{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate code. Create the struct with the shared values, then conditionally set the differences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also missing unit test coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, thanks for the improvements.
Related to Issue #22: Support for headless services
Description of changes:
ServiceImportController
for detectingServiceType
of importing Service and typingServiceImport
object accordingly (either Headless or ClusterSetIP)Note: This change currently only discovers
A/AAAA
records; support forSRV
records will be added after cluster annotations are added toEndpointSlices
with Source-Cluster label PR (#179). Additionally, the logic currently assumes that all Endpoints have the sameServiceType
, and therefore fetches theServiceType
from the first endpoint in the Service. This may be changed in the conflict resolution story.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.