From 6625e29071ec6e0163f196f348aca92dd4a832fd Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Fri, 10 Aug 2018 19:36:18 +0530 Subject: [PATCH] addressing review comments --- npc/analyser.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/npc/analyser.go b/npc/analyser.go index 7e62e5b8..7ee462e9 100644 --- a/npc/analyser.go +++ b/npc/analyser.go @@ -1,7 +1,6 @@ package npc import ( - "errors" "fmt" "strconv" @@ -55,7 +54,8 @@ func (ns *ns) analysePolicy(policy *networkingv1.NetworkPolicy) ( if !allPorts { for _, npProtocolPort := range ingressRule.Ports { if _, err := strconv.Atoi(port(npProtocolPort.Port)); err != nil { - return nil, nil, nil, nil, errors.New("named ports in network policies in not support yet. Rejecting network policy from further processing") + return nil, nil, nil, nil, fmt.Errorf("named ports in network policies is not supported yet. "+ + "Rejecting network policy: %s with named port: %s from further processing ", policy.Name, port(npProtocolPort.Port)) } } } @@ -115,7 +115,8 @@ func (ns *ns) analysePolicy(policy *networkingv1.NetworkPolicy) ( if !allPorts { for _, npProtocolPort := range egressRule.Ports { if _, err := strconv.Atoi(port(npProtocolPort.Port)); err != nil { - return nil, nil, nil, nil, errors.New("named ports in network policies in not support yet. Rejecting network policy from further processing") + return nil, nil, nil, nil, fmt.Errorf("named ports in network policies is not supported yet. "+ + "Rejecting network policy: %s with named port: %s from further processing ", policy.Name, port(npProtocolPort.Port)) } } }