Skip to content

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

Merged
rosstimothy merged 1 commit intobranch/v15from
bot/backport-40166-branch/v15
Apr 4, 2024
Merged

[v15] Add support for exact matching on an element in a delimited label#40183
rosstimothy merged 1 commit intobranch/v15from
bot/backport-40166-branch/v15

Conversation

@rosstimothy
Copy link
Copy Markdown
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)`.
@github-actions
Copy link
Copy Markdown
Contributor

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
@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.

3 participants