Skip to content

Commit

Permalink
skip hostnetwok pod's from enforcing network policies
Browse files Browse the repository at this point in the history
  • Loading branch information
murali-reddy authored and aauren committed May 25, 2021
1 parent 9f79001 commit a042e0e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/controllers/netpol/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ func (npc *NetworkPolicyController) newPodEventHandler() cache.ResourceEventHand
// OnPodUpdate handles updates to pods from the Kubernetes api server
func (npc *NetworkPolicyController) OnPodUpdate(obj interface{}) {
pod := obj.(*api.Pod)
if pod.Spec.HostNetwork {
klog.V(2).Info("Ignoring update to hostNetwork pod: %s/%s", pod.Namespace, pod.Name)
return
}
klog.V(2).Infof("Received update to pod: %s/%s", pod.Namespace, pod.Name)

npc.RequestFullSync()
Expand Down

0 comments on commit a042e0e

Please sign in to comment.