2022-07-07 10:40:19 +03:00
|
|
|
apiVersion: nfd.k8s-sigs.io/v1alpha1
|
|
|
|
kind: NodeFeatureRule
|
|
|
|
metadata:
|
|
|
|
name: e2e-test-2
|
|
|
|
spec:
|
|
|
|
rules:
|
|
|
|
#
|
|
|
|
# More complex rule testing backreferencing and matchAny field
|
|
|
|
#
|
|
|
|
- name: "e2e-matchany-test-1"
|
|
|
|
labels:
|
|
|
|
e2e-matchany-test-1: "true"
|
2023-05-24 11:56:36 +01:00
|
|
|
dynamic-label: "@rule.matched.e2e-attribute-test-1"
|
2022-07-07 10:40:19 +03:00
|
|
|
vars:
|
|
|
|
e2e-instance-test-1.not: "false"
|
|
|
|
matchFeatures:
|
|
|
|
- feature: "rule.matched"
|
|
|
|
matchExpressions:
|
|
|
|
"e2e-attribute-test-1": {op: InRegexp, value: ["^tru"]}
|
|
|
|
"e2e-instance-test-1.123": {op: In, value: ["1", "12", "123"]}
|
|
|
|
matchAny:
|
|
|
|
- matchFeatures:
|
|
|
|
- feature: "fake.instance"
|
|
|
|
matchExpressions:
|
|
|
|
"attr_1": {op: In, value: ["nomatch"]}
|
|
|
|
- matchFeatures:
|
|
|
|
- feature: "fake.instance"
|
|
|
|
matchExpressions:
|
|
|
|
"attr_3": {op: In, value: ["100"]}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Simple test for templating
|
|
|
|
#
|
|
|
|
- name: "e2e-template-test-1"
|
|
|
|
labelsTemplate: |
|
|
|
|
{{ range .fake.instance }}e2e-template-test-1-{{ .name }}=found
|
|
|
|
{{ end }}
|
|
|
|
matchFeatures:
|
|
|
|
- feature: "fake.instance"
|
|
|
|
matchExpressions:
|
|
|
|
"attr_1": {op: In, value: ["true"]}
|
|
|
|
|
2022-03-17 18:30:32 +02:00
|
|
|
- name: "e2e-template-test-2"
|
|
|
|
labelsTemplate: |
|
|
|
|
{{ range .fake.attribute }}e2e-template-test-2-{{ .Name }}={{ .Value }}
|
|
|
|
{{ end }}
|
|
|
|
matchFeatures:
|
|
|
|
- feature: "fake.attribute"
|
|
|
|
matchExpressions:
|
|
|
|
"attr_2": {op: IsFalse}
|
|
|
|
matchName: {op: In, value: ["attr_3"]}
|