Skip to content

Commit

Permalink
updated code
Browse files Browse the repository at this point in the history
  • Loading branch information
rejain456 committed Jan 17, 2025
1 parent 4eeea48 commit 870f709
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cns/middlewares/k8sSwiftV2_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import (

var defaultDenyEgressPolicy policy.Policy
var defaultDenyIngressPolicy policy.Policy
var err error
var errIngress error
var errEgress error

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

break
}
Expand Down

0 comments on commit 870f709

Please sign in to comment.