Skip to content

source/crd: allow SRV targets with trailing dot in DNSEndpoint#6383

Open
SAY-5 wants to merge 1 commit intokubernetes-sigs:masterfrom
SAY-5:fix/crd-allow-srv-trailing-dot-6357
Open

source/crd: allow SRV targets with trailing dot in DNSEndpoint#6383
SAY-5 wants to merge 1 commit intokubernetes-sigs:masterfrom
SAY-5:fix/crd-allow-srv-trailing-dot-6357

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented Apr 21, 2026

Description

The DNSEndpoint CRD validator warned and skipped SRV targets that ended with a trailing dot, telling the user to remove it. Dropping the dot satisfied source/crd.go's default branch, but then Endpoint.ValidateSRVRecord rejected the endpoint in CheckEndpoint because RFC 2782 requires the target host to be an absolute FQDN with a trailing dot. The net effect: SRV records could not be created via a DNSEndpoint CRD — the user looped between both errors.

Fix

Treat SRV like CNAME in the crd.go validator. The SRV record format is <prio> <weight> <port> <host> and ValidateSRVRecord already enforces the trailing dot on the host, so crd.go should accept it and let the downstream validator decide.

Fixes

Fixes #6357

Checklist

  • go test ./source/... green (including CRD suite).
  • go build clean.
  • gofmt clean.

Signed-off-by: SAY-5 SAY-5@users.noreply.github.com

The DNSEndpoint CRD validator warned and skipped SRV targets that
ended with a trailing dot, telling the user to remove it. Dropping
the dot satisfied crd.go's default branch, but then
Endpoint.ValidateSRVRecord(Targets) rejected the endpoint in
CheckEndpoint because RFC 2782 requires the target host to be an
absolute FQDN with a trailing dot. Users who tried to create an SRV
record via a DNSEndpoint CRD ended up in a loop between both errors
(kubernetes-sigs#6357).

Treat SRV like CNAME in the crd.go validator: the SRV record format
is <prio> <weight> <port> <host> and ValidateSRVRecord already
enforces the trailing dot, so crd.go should accept it here.

Fixes kubernetes-sigs#6357.

Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>
@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Apr 21, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Invalid commit message issues detected

Invalid commit messages

Keywords which can automatically close issues and hashtag(#) mentions are not allowed.

  • d4858dc source/crd: allow SRV targets with trailing dot in DNSEndpoint

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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot requested a review from vflaux April 21, 2026 19:18
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 21, 2026
@k8s-ci-robot
Copy link
Copy Markdown
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 ivankatliarchuk for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 21, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @SAY-5. 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.

Details

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 the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 21, 2026
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. do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SRV records cannot be created using DNSEndpoint CRD

2 participants