Skip to content

refactor(endpoint): export ProviderSpecificAlias and consolidate usage#6342

Open
u-kai wants to merge 1 commit intokubernetes-sigs:masterfrom
u-kai:refactor/export-provider-specific-alias
Open

refactor(endpoint): export ProviderSpecificAlias and consolidate usage#6342
u-kai wants to merge 1 commit intokubernetes-sigs:masterfrom
u-kai:refactor/export-provider-specific-alias

Conversation

@u-kai
Copy link
Copy Markdown
Member

@u-kai u-kai commented Apr 2, 2026

What does it do ?

Export providerSpecificAlias as ProviderSpecificAlias in the endpoint package and replace all
hardcoded "alias" string literals and duplicated local definitions across the codebase with
the single exported constant.

Motivation

The "alias" key was defined in multiple places (endpoint/endpoint.go, provider/aws/aws.go) and
used as a raw string literal in many others (registry/txt/registry.go, provider/pdns/pdns.go, source/wrappers/post_processor.go, etc.).

By exporting a single constant, all consumers reference one source of truth, and the TODO comment requesting this consolidation is resolved.

More

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

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>
@k8s-ci-robot k8s-ci-robot requested a review from mloiseleur April 2, 2026 23:02
@k8s-ci-robot k8s-ci-robot added the plan Issues or PRs related to external-dns plan label Apr 2, 2026
@k8s-ci-robot k8s-ci-robot requested a review from vflaux April 2, 2026 23:02
@k8s-ci-robot k8s-ci-robot added provider Issues or PRs related to a provider registry Issues or PRs related to a registry source size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 2, 2026
// RecordTypeNAPTR is a RecordType enum value
RecordTypeNAPTR = "NAPTR"

// TODO: review source/annotations package to consolidate alias key definitions;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

AliasKey and ProviderSpecificAlias are related in that the annotation value set via AliasKey
is eventually converted into a ProviderSpecific property named ProviderSpecificAlias by the
source/annotations package.

However, they are separate definitions serving different purposes — one is a Kubernetes annotation key with a full prefix, the other is an internal property name — so keeping them as independent constants is the right approach.

The original TODO has been removed accordingly.

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 23925973436

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 46 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.004%) to 80.524%

Files with Coverage Reduction New Missed Lines %
openshift_route.go 1 82.93%
aws/aws.go 45 89.22%
Totals Coverage Status
Change from base Build 23903893422: -0.004%
Covered Lines: 17158
Relevant Lines: 21308

💛 - Coveralls

@ivankatliarchuk
Copy link
Copy Markdown
Member

/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ivankatliarchuk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. plan Issues or PRs related to external-dns plan provider Issues or PRs related to a provider registry Issues or PRs related to a registry size/L Denotes a PR that changes 100-499 lines, ignoring generated files. source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants