Skip to content

Conversation

hanapedia
Copy link
Contributor

What does it do ?

This PR fixes an overlooked usage of the old IDNA logic in FindZone() that still emits warning logs when parsing hostnames containing the * character. Although PR #5685 addressed this issue in some parts of the code by using a new IDNA profile that allows characters like *, one remaining path still uses the old profile, resulting in warning logs like:
Failed to convert label “*” of hostname “*.example.com” to its Unicode form: idna: disallowed rune U+002A
This PR updates the logic to consistently use the intended IDNA profile and avoid logging spurious warnings for wildcard hostnames.

Motivation

This PR follows up on the changes in #5685 , which partially addressed unnecessary warning logs for hostnames with characters like *. However, the FindZone() function still uses the outdated IDNA conversion logic, causing the warning to appear even after #5685 was merged.

Suppressing these unnecessary warnings improves log clarity and avoids confusion for users working with wildcard DNS entries.

More

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

Copy link

linux-foundation-easycla bot commented Aug 1, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: hanapedia / name: Hiroki Hanada (d4a6294)

@k8s-ci-robot k8s-ci-robot added the provider Issues or PRs related to a provider label Aug 1, 2025
@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Aug 1, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @hanapedia!

It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/external-dns has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @hanapedia. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 1, 2025
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Aug 1, 2025
@ivankatliarchuk
Copy link
Contributor

I'm not sure if this required. Could you share a real case end evidences. I did explicitly a validation. Which image you are using btw.

@ivankatliarchuk
Copy link
Contributor

Share arguments as well, not helm please.

@ivankatliarchuk
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 1, 2025
@hanapedia
Copy link
Contributor Author

@ivankatliarchuk
Sorry for the lack of context in the original PR 🙏.

I haven’t run against the current master branch in production yet—the logs I referred to were observed in v0.17.0 and v0.18.0 when creating or deleting a DNSEndpoint with * in the domain name (e.g. "*.sandbox.example.com").

The exact warning logs (domain masked) were:

{"level":"warning","msg":"Failed to convert label '*' of hostname '*.helloworld.sandbox.somedomain.com.' to its Unicode form: idna: disallowed rune U+002A","time":"2025-07-31T06:03:03Z"}
{"level":"warning","msg":"Failed to convert label 'a-*' of hostname 'a-*.helloworld.sandbox.somedomain.com.' to its Unicode form: idna: disallowed rune U+002A","time":"2025-07-31T06:03:03Z"}

Arguments used (running on bare metal Kubernetes with CloudDNS provider):

args:
  - --source=crd
  - --source=service
  - --provider=google
  - --registry=txt
  - --log-format=json
  - --publish-internal-services

I also verified that this behavior still exists in current master by adding new test cases with "*" in the domain name to zonefinder_test.go—the warnings still appear there.
I confirmed it by using testutils.LogsUnderTestWithLogLevel and testutils.TestHelperLogContains like so in zonefinder_test.go:

	hook := testutils.LogsUnderTestWithLogLevel(log.WarnLevel, t)
	zoneID, zoneName = z.FindZone("*.example.com")
	assert.Equal(t, "*.example.com", zoneName)
	assert.Equal(t, "123412", zoneID)
	testutils.TestHelperLogContains("Failed to convert label \"*\" of hostname \"*.example.com\" to its Unicode form: idna: disallowed rune U+002A", hook, t)

@ivankatliarchuk
Copy link
Contributor

Will double check when have time just in case.

Fixes #5706

@ivankatliarchuk
Copy link
Contributor

So I did testing once again. Was not able to reproduce
Screenshot 2025-08-01 at 18 37 34

There's one catch: I was testing with the AWS provider, which doesn't actually use this method, which I was not aware off ;-)

Copy link
Contributor

@ivankatliarchuk ivankatliarchuk left a comment

Choose a reason for hiding this comment

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

/lgtm

cc: @mloiseleur

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 1, 2025
Copy link
Collaborator

@mloiseleur mloiseleur left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mloiseleur

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 1, 2025
@mloiseleur mloiseleur changed the title fix: IDNA awareness in the zone finder fix(provider): IDNA awareness in the zone finder Aug 1, 2025
@k8s-ci-robot k8s-ci-robot merged commit 498bb87 into kubernetes-sigs:master Aug 1, 2025
14 checks passed
troll-os pushed a commit to FiligranHQ/external-dns that referenced this pull request Aug 28, 2025
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. provider Issues or PRs related to a provider size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants