Skip to content

Commit f7a8392

Browse files
committed
Skip Huawei labels when NFD patches a default namespace
Signed-off-by: taenzeyang <[email protected]>
1 parent 8f940ef commit f7a8392

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

deployment/helm/node-feature-discovery/templates/nodefeaturerules.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,32 @@ metadata:
55
name: npu
66
spec:
77
rules:
8-
- name: "ascend/atlas-800t-a2"
8+
- name: "ascend/atlas-800t-a2-arm"
99
labels:
10+
"node-role.kubernetes.io/worker": "worker"
11+
"workerselector": "dls-worker-node"
1012
"host-arch": "huawei-arm"
1113
"accelerator": "huawei-Ascend910"
1214
matchFeatures:
1315
- feature: pci.device
1416
matchExpressions:
1517
vendor: {op: In, value: ["19e5"]}
1618
device: {op: In, value: ["d802"]}
19+
- feature: kernel.config
20+
matchExpressions:
21+
X86: {op: In, value: ["n"]}
22+
- name: "ascend/atlas-800t-a2-x86"
23+
labels:
24+
"node-role.kubernetes.io/worker": "worker"
25+
"workerselector": "dls-worker-node"
26+
"host-arch": "huawei-x86"
27+
"accelerator": "huawei-Ascend910"
28+
matchFeatures:
29+
- feature: pci.device
30+
matchExpressions:
31+
vendor: {op: In, value: ["19e5"]}
32+
device: {op: In, value: ["d802"]}
33+
- feature: kernel.config
34+
matchExpressions:
35+
X86: {op: In, value: ["y"]}
1736
{{- end }}

pkg/nfd-master/nfd-master.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1287,8 +1287,11 @@ func addNs(src string, nsToAdd string) string {
12871287
// containsHW returns true if the label contains Huawei's keys
12881288
func containsHW(src string) bool {
12891289
keys := []string{
1290-
"accelerator",
1290+
"workerselector",
12911291
"host-arch",
1292+
"accelerator",
1293+
"accelerator-type",
1294+
"servertype",
12921295
}
12931296
for _, key := range keys {
12941297
if key == src {

0 commit comments

Comments
 (0)