Skip to content

feat: introduce a Tags field to the Endpoint struct to support DNS record tags #5478

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AndrewCharlesHay
Copy link
Contributor

What does it do ?

Fixes #5442

Motivation

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 szuecs 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 requested a review from mloiseleur May 28, 2025 13:34
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 28, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @AndrewCharlesHay. 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 the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 28, 2025
@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 May 28, 2025
@@ -36,6 +36,9 @@ type Endpoint struct {
// ProviderSpecific stores provider specific config
// +optional
ProviderSpecific ProviderSpecific `json:"providerSpecific,omitempty"`
// Tags stores DNS record tags (supported by some providers, e.g., Cloudflare)
// +optional
Tags []string `json:"tags,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm unsure here, what the right design should be. Tags are prodiver specific, so most likely it should be part of ProviderSpecific, unfortunately ProviderSpecific is Name,Value. We may need a better ProviderSpecific abstraction. But this will be a refactoring of current code, more effort then current solution.

This is just my 50 cents

@mloiseleur @7onn wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

As well as at the moment not sure how many providers do support tags, it's a great feature by itself, but gcp or aws do not support tagging individual DNS resource records

Copy link
Collaborator

Choose a reason for hiding this comment

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

🤔 Rework correctly the abstraction would be simpler when we have multiple providers supporting tags. So, how about keep existing CRD and use it like that:

spec:
  endpoints:
    - dnsName: foo.com
      providerSpecific:
         name: "tags"
         value: "[\"taga:valuea\", \"tagb:valueb\"]"

ie: convert the providerSpecific value named tags as the expected array ?

And when we have multiple providers with tags, we can introduce a dedicated field to it, with better schema and CEL validation ?

Copy link
Contributor

@7onn 7onn May 31, 2025

Choose a reason for hiding this comment

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

I'm unsure here, what the right design should be. Tags are prodiver specific, so most likely it should be part of ProviderSpecific

Making this provider specific helps with decoupling the code but also foments redundancy. So unless the majority of the providers supports it, I'd argue for keeping it provider specific for the sake of implementation simplicity (even though increasing the amount of code).

Unfortunately, I had opened this before checking this notification and realizing tagging was to be handled in this PR, so we might have worked redundantly. Looking forward to coordinate how to proceed with this :)

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

cloudflare: Support tagging for DNS records
5 participants