Skip to content

Conversation

@mrueg
Copy link
Member

@mrueg mrueg commented Dec 9, 2025

What does it do ?

Fixes: #5983

Motivation

This will reduce dependencies in any external providers importing the provider package.

More

  • Yes, this PR title follows Conventional Commits
  • Yes, I added unit tests
  • Yes, I updated end user documentation accordingly

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mloiseleur for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the controller Issues or PRs related to the controller label Dec 9, 2025
@k8s-ci-robot k8s-ci-robot requested a review from szuecs December 9, 2025 20:36
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. provider Issues or PRs related to a provider labels Dec 9, 2025
@k8s-ci-robot k8s-ci-robot requested a review from vflaux December 9, 2025 20:36
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 9, 2025

zoneNameFilter := endpoint.NewDomainFilter(cfg.ZoneNameFilter)
zoneIDFilter := provider.NewZoneIDFilter(cfg.ZoneIDFilter)
zoneTypeFilter := provider.NewZoneTypeFilter(cfg.AWSZoneType)
Copy link
Member Author

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) {
Copy link
Member Author

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"
Copy link
Member Author

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.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 20077740660

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 68 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.008%) to 78.687%

Files with Coverage Reduction New Missed Lines %
execute.go 24 64.92%
aws/aws.go 44 90.78%
Totals Coverage Status
Change from base Build 20069516202: 0.008%
Covered Lines: 16012
Relevant Lines: 20349

💛 - Coveralls

@ivankatliarchuk
Copy link
Member

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:

  • Google Cloud DNS
  • Azure Private DNS
  • other providers if we going to add filters

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:

  • provider implementation
  • filter implementation
  • zone loop

The boundary between filter logic and provider domain semantics is blurring.

This means, from one perspective:

  • Harder to maintain
  • Harder to introduce new filters
  • Harder to test filter construction and logic in isolation

And potentially goes in the opposite direction of:

  • Clean architecture
  • Provider and filters abstraction
  • Pluggable filter interfaces
  • Testability across providers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. controller Issues or PRs related to the controller provider Issues or PRs related to a provider size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop aws-specifics from provider/zone_type_filter.go

4 participants