Skip to content
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

fix(kubeapiserver): validate group resource strings to support groups with periods #33647

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

jscaltreto
Copy link

What does this PR do?

Improves the parsing of "group resource" strings when using kubernetes_resources_annotations_as_tags/kubernetes_resources_labels_as_tags to support groups that contain periods. The updated code uses Kubernetes' own validations to ensure that the resource and group are RFC1123-compliant Labels and Subdomains, respectively.

Fixes #33646

Motivation

The current validation logic requires that the key will contain only one period, meaning it's not currently possible to specify resources whose groups contain periods as is common with CRDs.

Describe how you validated your changes

Updated tests and included additional negative tests for invalid entries.

Possible Drawbacks / Trade-offs

None known

@jscaltreto jscaltreto requested review from a team as code owners February 2, 2025 00:08
@bits-bot
Copy link
Collaborator

bits-bot commented Feb 2, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added community team/container-platform The Container Platform Team labels Feb 2, 2025
Copy link
Contributor

@buraizu buraizu left a comment

Choose a reason for hiding this comment

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

Approving with a minor update suggested for the release note

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community team/container-platform The Container Platform Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Unable to use DD_KUBERNETES_RESOURCES_LABELS_AS_TAGS with resources whose groups contain periods
3 participants