support set-based label selectors #36
Merged
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.
Adds a flexible label selector functionality to the
gdt-kubeplugin.When selecting objects from the Kubernetes API, you can use a label selector in the
kube.getandkube.deletetest spec actions. This label selector functionality is incredibly flexible. You can use akubectl-style label selector string, like so:The
kube.get.labelsfield can also be a map of string to string, which is more aligned with howgdt's YAML syntax is structured. This example selects pods that have both theapp=myappand theregion=myregionlabel:The
kube.get.labels-infield is a map of string to slice of strings and gets translated into a "label IN (val1, val2)" expression. This example selects pods that have either theapp=myapplabel or theapp=testlabel:The
kube.get.labels-not-infield is also a map of string to slice of strings and gets translated into alabel NOTIN (val1, val2)expression. This example selects pods that do not have either theapp=myappor theapp=testlabel.You can combine the
kube.get.labels,kube.get.labels-inandkube.get.labels-not-infields to create complex querying expressions. This example selects pods that have theapp=myapplabel and have either thecategory=testorcategory=staginglabel and do not have apersonal=truelabel:Issue #35