diff --git a/go-controller/pkg/ovn/policy.go b/go-controller/pkg/ovn/policy.go index db2fedee6c2..0c0452efd74 100644 --- a/go-controller/pkg/ovn/policy.go +++ b/go-controller/pkg/ovn/policy.go @@ -21,8 +21,14 @@ func (oc *Controller) syncNetworkPoliciesPortGroup( npInterface) continue } - expectedPolicies[policy.Namespace] = map[string]bool{ - policy.Name: true} + + if nsMap, ok := expectedPolicies[policy.Namespace]; ok { + nsMap[policy.Name] = true + } else { + expectedPolicies[policy.Namespace] = map[string]bool{ + policy.Name: true, + } + } } err := oc.forEachAddressSetUnhashedName(func(addrSetName, namespaceName,