Skip to content

Commit 5f58cd2

Browse files
authored
Fix conditional so only matched pods are firewalled (#183)
1 parent a5a446a commit 5f58cd2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/network_policy_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ func (npc *NetworkPolicyController) getFirewallEnabledPods(nodeIp string) (*map[
636636
}
637637

638638
// An empty podSelector matches all pods in this namespace.
639-
if len(policy.Spec.PodSelector.MatchLabels) == 0 || len(policy.Spec.PodSelector.MatchExpressions) == 0 {
639+
if len(policy.Spec.PodSelector.MatchLabels) == 0 && len(policy.Spec.PodSelector.MatchExpressions) == 0 {
640640
podNeedsFirewall = true
641641
break
642642
}

0 commit comments

Comments
 (0)