Discard pod updates for other nodes

We were filtering pods to those on the local node already, for regular
reports, so we should also filter events that come in asynchronously.
This commit is contained in:
Bryan Boreham
2018-10-14 15:24:34 +00:00
parent da01ce0fbb
commit b82aff1210

View File

@@ -193,6 +193,10 @@ func (r *Reporter) Stop() {
func (Reporter) Name() string { return "K8s" }
func (r *Reporter) podEvent(e Event, pod Pod) {
// filter out non-local pods, if we have been given a node name to report on
if r.nodeName != "" && pod.NodeName() != r.nodeName {
return
}
switch e {
case ADD:
rpt := report.MakeReport()