-
Notifications
You must be signed in to change notification settings - Fork 246
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
source/custom: expression based label rules #639
source/custom: expression based label rules #639
Conversation
Depends on #604 |
[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 |
ce80feb
to
92dc724
Compare
e2e-tests were failing but fixed, now |
92dc724
to
c586018
Compare
e2e-test Ran 2 of 230 Specs in 26.560 seconds
SUCCESS! -- 2 Passed | 0 Failed | 0 Pending | 228 Skipped
--- PASS: TestE2E (26.58s)
PASS
ok sigs.k8s.io/node-feature-discovery/test/e2e 26.615s test go test ./cmd/... ./pkg/... ./source/...
? sigs.k8s.io/node-feature-discovery/cmd/nfd-master [no test files]
ok sigs.k8s.io/node-feature-discovery/cmd/nfd-topology-updater (cached)
ok sigs.k8s.io/node-feature-discovery/cmd/nfd-worker 0.009s
? sigs.k8s.io/node-feature-discovery/pkg/api/feature [no test files]
? sigs.k8s.io/node-feature-discovery/pkg/apihelper [no test files]
? sigs.k8s.io/node-feature-discovery/pkg/cpuid [no test files]
ok sigs.k8s.io/node-feature-discovery/pkg/kubeconf (cached)
? sigs.k8s.io/node-feature-discovery/pkg/labeler [no test files]
? sigs.k8s.io/node-feature-discovery/pkg/nfd-client [no test files]
ok sigs.k8s.io/node-feature-discovery/pkg/nfd-client/topology-updater (cached)
ok sigs.k8s.io/node-feature-discovery/pkg/nfd-client/worker 3.088s
ok sigs.k8s.io/node-feature-discovery/pkg/nfd-master (cached)
? sigs.k8s.io/node-feature-discovery/pkg/podres [no test files]
ok sigs.k8s.io/node-feature-discovery/pkg/resourcemonitor (cached)
? sigs.k8s.io/node-feature-discovery/pkg/topologypolicy [no test files]
? sigs.k8s.io/node-feature-discovery/pkg/topologyupdater [no test files]
ok sigs.k8s.io/node-feature-discovery/pkg/utils (cached)
? sigs.k8s.io/node-feature-discovery/pkg/version [no test files]
ok sigs.k8s.io/node-feature-discovery/source 0.004s
ok sigs.k8s.io/node-feature-discovery/source/cpu (cached)
? sigs.k8s.io/node-feature-discovery/source/custom [no test files]
ok sigs.k8s.io/node-feature-discovery/source/custom/expression 0.078s
? sigs.k8s.io/node-feature-discovery/source/custom/rules [no test files]
? sigs.k8s.io/node-feature-discovery/source/fake [no test files]
? sigs.k8s.io/node-feature-discovery/source/iommu [no test files]
ok sigs.k8s.io/node-feature-discovery/source/kernel (cached)
ok sigs.k8s.io/node-feature-discovery/source/local (cached)
? sigs.k8s.io/node-feature-discovery/source/memory [no test files]
? sigs.k8s.io/node-feature-discovery/source/network [no test files]
ok sigs.k8s.io/node-feature-discovery/source/pci (cached)
? sigs.k8s.io/node-feature-discovery/source/storage [no test files]
ok sigs.k8s.io/node-feature-discovery/source/system (cached)
ok sigs.k8s.io/node-feature-discovery/source/usb (cached) test image = |
/assign |
/unhold |
Implement a framework for more flexible rule configuration and matching, mimicking the MatchExpressions pattern from K8s nodeselector. The basic building block is MatchExpression which contains an operator and a list of values. The operator specifies that "function" that is applied when evaluating a given input agains the list of values. Available operators are: - MatchIn - MatchNotIn - MatchInRegexp - MatchExists - MatchDoesNotExist - MatchGt - MatchLt - MatchIsTrue - MatchIsFalse Another building block of the framework is MatchExpressionSet which is a map of string-MatchExpression pairs. It is a helper for specifying multiple expressions that can be matched against a set of set of features. This patch converts all existing custom rules to utilize the new expression-based framework.
A new operator for checking that an input (integer) is between two values.
c586018
to
689703b
Compare
/assign @zvonkok |
Tested and works.
/lgtm |
Implement a framework for more flexible rule configuration and matching,
mimicking the MatchExpressions pattern from K8s nodeselector.
The basic building block is MatchExpression which contains an operator
and a list of values. The operator specifies that "function" that is
applied when evaluating a given input agains the list of values.
Available operators are:
Another building block of the framework is MatchExpressionSet which is a
map of string-MatchExpression pairs. It is a helper for specifying
multiple expressions that can be matched against a set of set of
features.
This patch converts all existing custom rules to utilize the new
expression-based framework.
The PR also contains a separate patch that implement
GtLt
, an operator for checking that an input (integer) is between two values. The purpose of keeping this patch separate is to demonstrate the addition of new operators