1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-05 08:17:04 +00:00

Merge pull request #1458 from marquiz/devel/logging-fix

apis/nfd: fix logging of rule expression processing
This commit is contained in:
Kubernetes Prow Robot 2023-11-21 12:04:59 +01:00 committed by GitHub
commit 371ed3ff21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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