Skip to content

Commit

Permalink
warning msg update (#193)
Browse files Browse the repository at this point in the history
* warning msg update

* tiny fix
  • Loading branch information
shireenf-ibm committed Jul 30, 2023
1 parent 49a84c0 commit fcc47b6
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions pkg/netpol/connlist/connlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,15 +486,11 @@ func portsString(ports []common.PortRange) string {
}

func (ca *ConnlistAnalyzer) warnBlockedIngress(peerStr string, ingressObjs map[string][]string) {
warningMsg, commaSep := "", ","
warningMsg := ""
if len(ingressObjs[scan.Ingress]) > 0 {
warningMsg = "K8s-Ingress object/s: " + strings.Join(ingressObjs[scan.Ingress], commaSep)
}
if len(ingressObjs[scan.Route]) > 0 {
if warningMsg != "" {
warningMsg += " and "
}
warningMsg += "Route objects/s: " + strings.Join(ingressObjs[scan.Route], commaSep)
warningMsg = "K8s-Ingress resource " + ingressObjs[scan.Ingress][0]
} else if len(ingressObjs[scan.Route]) > 0 {
warningMsg = "Route resource " + ingressObjs[scan.Route][0]
}
warningMsg += " specified workload " + peerStr + " as a backend, but network policies are blocking " +
"ingress connections from an arbitrary in-cluster source to this workload." +
Expand Down

0 comments on commit fcc47b6

Please sign in to comment.