@@ -67,8 +67,8 @@ func (k *K8sSWIFTv2Middleware) addDefaultRoute(podIPInfo *cns.PodIpInfo, gwIP st
6767}
6868
6969// get policy of type endpoint policy given the params
70- func getEndpointPolicy (policyType , action , direction string , priority int ) (policy.Policy , error ) {
71- endpointPolicy , err := createEndpointPolicy (policyType , action , direction , priority )
70+ func getEndpointPolicy (policyType policy. CNIPolicyType , action , direction string , priority int ) (policy.Policy , error ) {
71+ endpointPolicy , err := createEndpointPolicy (string ( policyType ) , action , direction , priority )
7272 if err != nil {
7373 return policy.Policy {}, errors .Wrap (err , "failed to create endpoint policy" )
7474 }
@@ -145,12 +145,12 @@ func (k *K8sSWIFTv2Middleware) IPConfigsRequestHandlerWrapper(defaultHandler, fa
145145 var defaultDenyEgressPolicy , defaultDenyIngressPolicy policy.Policy
146146
147147 if defaultDenyACLbool && ipInfo .NICType == cns .InfraNIC {
148- defaultDenyEgressPolicy , err = getEndpointPolicy (string ( policy .ACLPolicy ) , cns .ActionTypeBlock , cns .DirectionTypeOut , 10_000 )
148+ defaultDenyEgressPolicy , err = getEndpointPolicy (policy .ACLPolicy , cns .ActionTypeBlock , cns .DirectionTypeOut , 10_000 )
149149 if err != nil {
150150 logger .Errorf ("failed to add default deny acl's for pod %v with err %v" , podInfo .Name (), err )
151151 }
152152
153- defaultDenyIngressPolicy , err = getEndpointPolicy (string ( policy .ACLPolicy ) , cns .ActionTypeBlock , cns .DirectionTypeIn , 10_000 )
153+ defaultDenyIngressPolicy , err = getEndpointPolicy (policy .ACLPolicy , cns .ActionTypeBlock , cns .DirectionTypeIn , 10_000 )
154154 if err != nil {
155155 logger .Errorf ("failed to add default deny acl's for pod %v with err %v" , podInfo .Name (), err )
156156 }
0 commit comments