-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Extract AWS specifics from zone type filter #6009
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
base: master
Are you sure you want to change the base?
Conversation
Fixes: kubernetes-sigs#5983 Signed-off-by: Manuel Rüger <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
|
||
| zoneNameFilter := endpoint.NewDomainFilter(cfg.ZoneNameFilter) | ||
| zoneIDFilter := provider.NewZoneIDFilter(cfg.ZoneIDFilter) | ||
| zoneTypeFilter := provider.NewZoneTypeFilter(cfg.AWSZoneType) |
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.
I moved this below, since it was only used by the aws provider.
| IsPublicZone = zone.Config.PrivateZone | ||
| } | ||
|
|
||
| if !IsPublicZone && !p.zoneTypeFilter.Match(zone) { |
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.
I wonder if the p.zoneTypeFilter.Match(zone) is even necessary here?
| package provider | ||
|
|
||
| import ( | ||
| route53types "github.com/aws/aws-sdk-go-v2/service/route53/types" |
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.
Goal of this exercise is to get this out of the provider package.
Pull Request Test Coverage Report for Build 20077740660Details
💛 - Coveralls |
|
The work make sense to me. I’m not sure if I agree with how this proposal is implemented. It would likely make more sense as an interface rather than a concrete injection into an AWS-specific method. That’s a sign of increased coupling and responsibility leak. ZoneTypeFilter is now tightly bound to AWS semantics. It will not generalise well for:
The fallback/implicit behaviour becomes harder to reason about if zone.Config == nil {
// assume public zone unless config exists
IsPublicZone = p.zoneTypeFilter.ZoneType == provider.ZoneTypePublic
}This is domain-behaviour logic, but it's mixed into:
The boundary between filter logic and provider domain semantics is blurring. This means, from one perspective:
And potentially goes in the opposite direction of:
|
What does it do ?
Fixes: #5983
Motivation
This will reduce dependencies in any external providers importing the provider package.
More