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

[v15] Add support for exact matching on an element in a delimited label #40183

Merged
merged 1 commit into from Apr 4, 2024

Conversation

rosstimothy
Copy link
Contributor

Backport #40166 to branch/v15

changelog: Add new resource filtering predicates to allow exact matches on a single item of a delimited list stored in a label value. For example, if given the following label containing a string separated list of values foo=bar,baz,bang, it is now possible to match on any resources with a label foo that contains the element bar via contains(split(labels[foo], ","), bar).

Updates the resource parser with two new functions: `contains` and
`split`. When used together they provide the ability to
search for resources that have labels with multiple values in a
delimited list. For example, if a resource has label `foo=bar,baz,bang`
then `split(labels[foo], ",")` would transform the
comma label value from a string into a list: ["bar", "baz", "bang"]
The list could then be fed to `contains` to determine if bar exists
in the list: `contains(split(labels[foo], ","), bar)`.
Copy link

github-actions bot commented Apr 3, 2024

🤖 Vercel preview here: https://docs-6zv76yp88-goteleport.vercel.app/docs/ver/preview

@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from zmb3 April 4, 2024 07:21
@rosstimothy rosstimothy added this pull request to the merge queue Apr 4, 2024
Merged via the queue into branch/v15 with commit 6f422b5 Apr 4, 2024
43 checks passed
@rosstimothy rosstimothy deleted the bot/backport-40166-branch/v15 branch April 4, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants