Skip to content

Commit

Permalink
removing redundant if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
shireenf-ibm committed Sep 29, 2024
1 parent 6a88841 commit 060e428
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pkg/netpol/eval/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,8 @@ func (pe *PolicyEngine) allowedXgressConnection(src, dst k8s.Peer, isIngress boo
var err error
var netpols []*k8s.NetworkPolicy
if isIngress {
if dst.PeerType() == k8s.IPBlockType {
return true, nil // all connections allowed - no restrictions on ingress to externalIP
}
netpols, err = pe.getPoliciesSelectingPod(dst, netv1.PolicyTypeIngress)
} else {
if src.PeerType() == k8s.IPBlockType {
return true, nil // all connections allowed - no restrictions on egress from externalIP
}
netpols, err = pe.getPoliciesSelectingPod(src, netv1.PolicyTypeEgress)
}
if err != nil {
Expand Down

0 comments on commit 060e428

Please sign in to comment.