Skip to content

Commit 870f709

Browse files
committed
updated code
1 parent 4eeea48 commit 870f709

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cns/middlewares/k8sSwiftV2_windows.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import (
1616

1717
var defaultDenyEgressPolicy policy.Policy
1818
var defaultDenyIngressPolicy policy.Policy
19-
var err error
19+
var errIngress error
20+
var errEgress error
2021

2122
func init() {
2223
defaultDenyEgressPolicy, err = getEndpointPolicy(policy.ACLPolicy, cns.ActionTypeBlock, cns.DirectionTypeIn, 10_000)
@@ -159,7 +160,11 @@ func (k *K8sSWIFTv2Middleware) IPConfigsRequestHandlerWrapper(defaultHandler, fa
159160
// there will be no pod connectivity to and from those pods
160161
if defaultDenyACLbool && ipInfo.NICType == cns.InfraNIC {
161162
ipInfo.EndpointPolicies = append(ipInfo.EndpointPolicies, defaultDenyEgressPolicy, defaultDenyIngressPolicy)
162-
logger.Printf("Created endpoint policies for defaultDenyEgressPolicy and defaultDenyIngressPolicy")
163+
if errEgress != nil || errIngress != nil {
164+
logger.Printf("There was an error creating endpoint policies for defaultDeny policies")
165+
} else {
166+
logger.Printf("Successfully created endpoint policies for defaultDenyEgressPolicy and defaultDenyIngressPolicy")
167+
}
163168

164169
break
165170
}

0 commit comments

Comments
 (0)