From 7f684eeac7fa706dd81ea7efc64ea826d4515ef1 Mon Sep 17 00:00:00 2001 From: Vinu K Date: Sun, 29 Dec 2024 14:07:16 +0530 Subject: [PATCH] OCPBUGS-44674: Handle openshift-host-network namespace as special when it modifies - Add condition in NetworkPolicy updateMatchCache to handle HostNetworkNamespace changes Signed-off-by: Vinu Kochukuttan --- pkg/network/node/networkpolicy.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/network/node/networkpolicy.go b/pkg/network/node/networkpolicy.go index 681e5c548..e4a29d5ef 100644 --- a/pkg/network/node/networkpolicy.go +++ b/pkg/network/node/networkpolicy.go @@ -614,7 +614,11 @@ func (np *networkPolicyPlugin) selectNamespacesInternal(selector labels.Selector func (np *networkPolicyPlugin) updateMatchCache(npns *npNamespace) { for _, match := range np.nsMatchCache { if npns.gotNamespace && npns.gotNetNamespace && match.selector.Matches(labels.Set(npns.labels)) { - match.matches[npns.name] = npns.vnid + if npns.name == HostNetworkNamespace { + match.matches[npns.name] = 0 + } else { + match.matches[npns.name] = npns.vnid + } } else { delete(match.matches, npns.name) }