Add support for exact matching on an element in a delimited label#40166
Merged
rosstimothy merged 1 commit intomasterfrom Apr 3, 2024
Merged
Add support for exact matching on an element in a delimited label#40166rosstimothy merged 1 commit intomasterfrom
rosstimothy merged 1 commit intomasterfrom
Conversation
d69fb80 to
7330d37
Compare
Contributor
|
🤖 Vercel preview here: https://docs-5fhxv19mz-goteleport.vercel.app/docs/ver/preview |
r0mant
approved these changes
Apr 3, 2024
d91a1e3 to
678f400
Compare
Contributor
|
🤖 Vercel preview here: https://docs-kr74pic3s-goteleport.vercel.app/docs/ver/preview |
Contributor
|
🤖 Vercel preview here: https://docs-jkwou3rzq-goteleport.vercel.app/docs/ver/preview |
zmb3
approved these changes
Apr 3, 2024
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)`.
678f400 to
31769c0
Compare
Contributor
|
🤖 Vercel preview here: https://docs-78ezbrgvd-goteleport.vercel.app/docs/ver/preview |
|
@rosstimothy See the table below for backport results.
|
This was referenced Apr 3, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the resource parser with two new functions:
containsandsplit. 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 labelfoo=bar,baz,bangthensplit(labels[foo], ",")would transform the comma label value from a string into a list: ["bar", "baz", "bang"] The list could then be fed tocontainsto determine if bar exists in the list:contains(split(labels[foo], ","), bar).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 labelfoothat contains the elementbarviacontains(split(labels[foo], ","), bar).