-
Notifications
You must be signed in to change notification settings - Fork 249
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
Wildcard for matching against all keys in label rules #662
Conversation
/hold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: marquiz The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Unknown CLA label state. Rechecking for CLA labels. Send feedback to sig-contributor-experience at kubernetes/community. /check-cla |
Extend the feature rule format with a special wildcard that can be used in matchExpressions. By using '*' as the field name in an expressoin makes is possible to run the expression agains all feature names, instead of the value of one feature. This can be useful in template rules for creating per-feature labels, based on feature names (instead of values) and in "normal" (non-template) rules for checking if (at least) one of certain feature names are present. An example of creating an "avx512" label if any AVX512* CPUID feature is present: - name: "avx512-any-feature" labels: {avx512: "true"} matchFeatures: - feature: cpu.cpuid: matchExpressions: "*": {op: InRegexp, value: ["^AVX512"]} An example of a template rule creating a dynamic set of labels based on the existence of kconfig options. - name: "kconfig-template-features" labelsTemplate: | {{range .kernel.config}}kconfig-{{.Name}}={{.Value}} {{end}} matchFeatures: - feature: kernel.config matchExpressions: "*": {op: In, value: [SWAP, X86, ARM]}
68f69a5
to
7f253e4
Compare
@marquiz: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I don't like this approach myself. Possibly something like this would be more comprehensive:
|
@marquiz: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Moving milestone to v0.12.0 |
Supserseded by #788 |
@marquiz: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Extend the feature rule format with a special wildcard that can be used
in matchExpressions. By using '*' as the field name in an expressoin
makes is possible to run the expression agains all feature names,
instead of the value of one feature.
This can be useful in template rules for creating per-feature labels,
based on feature names (instead of values) and in "normal"
(non-template) rules for checking if (at least) one of certain feature
names are present.
An example of creating an "avx512" label if any AVX512* CPUID feature is
present:
An example of a template rule creating a dynamic set of labels based on
the existence of kconfig options.
Depends on #550