From 0809f60ba04cd67f82147d74ed290a2e70b83baf Mon Sep 17 00:00:00 2001 From: Jianjun Shen Date: Wed, 8 Jul 2020 17:27:40 -0700 Subject: [PATCH] Remove ofPorts from lastRealized.podOFPorts after deleting an OF rule --- pkg/agent/controller/networkpolicy/reconciler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/agent/controller/networkpolicy/reconciler.go b/pkg/agent/controller/networkpolicy/reconciler.go index d03ea5065bc..b2d61d18206 100644 --- a/pkg/agent/controller/networkpolicy/reconciler.go +++ b/pkg/agent/controller/networkpolicy/reconciler.go @@ -417,6 +417,7 @@ func (r *reconciler) update(lastRealized *lastRealized, newRule *CompletedRule, return err } delete(lastRealized.ofIDs, svcHash) + delete(lastRealized.podOFPorts, svcHash) } lastRealized.CompletedRule = newRule return nil @@ -508,6 +509,7 @@ func (r *reconciler) Forget(ruleID string) error { return err } delete(lastRealized.ofIDs, svcHash) + delete(lastRealized.podOFPorts, svcHash) } r.lastRealizeds.Delete(ruleID)