1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-28 10:47:23 +00:00

apis/nfd: fix logging of rule expression processing

This commit is contained in:
Markus Lehtonen 2023-11-10 09:40:54 +02:00
parent 9527b69972
commit 8ec55fe8db

View file

@ -211,14 +211,14 @@ func (m *MatchExpression) MatchKeys(name string, keys map[string]Nil) (bool, err
}
if klogV := klog.V(3); klogV.Enabled() {
klogV.InfoS("matched keys", "matchResult", "matched", "matchKey", name, "matchOp", m.Op)
klogV.InfoS("matched keys", "matchResult", matched, "matchKey", name, "matchOp", m.Op)
} else if klogV := klog.V(4); klogV.Enabled() {
k := make([]string, 0, len(keys))
for n := range keys {
k = append(k, n)
}
sort.Strings(k)
klogV.InfoS("matched keys", "matchResult", "matched", "matchKey", name, "matchOp", m.Op, "inputKeys", k)
klogV.InfoS("matched keys", "matchResult", matched, "matchKey", name, "matchOp", m.Op, "inputKeys", k)
}
return matched, nil
}
@ -232,9 +232,9 @@ func (m *MatchExpression) MatchValues(name string, values map[string]string) (bo
}
if klogV := klog.V(3); klogV.Enabled() {
klogV.InfoS("matched values", "matchResult", "matched", "matchKey", name, "matchOp", m.Op, "matchValue", m.Value)
klogV.InfoS("matched values", "matchResult", matched, "matchKey", name, "matchOp", m.Op, "matchValue", m.Value)
} else if klogV := klog.V(4); klogV.Enabled() {
klogV.InfoS("matched values", "matchResult", "matched", "matchKey", name, "matchOp", m.Op, "matchValue", m.Value, "inputValues", values)
klogV.InfoS("matched values", "matchResult", matched, "matchKey", name, "matchOp", m.Op, "matchValue", m.Value, "inputValues", values)
}
return matched, nil