Skip to content

Commit fc934fb

Browse files
committed
created a var
1 parent e9f5056 commit fc934fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cns/middlewares/k8sSwiftV2.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,24 +106,24 @@ func (k *K8sSWIFTv2Middleware) IPConfigsRequestHandlerWrapper(defaultHandler, fa
106106
// validateIPConfigsRequest validates if pod is multitenant by checking the pod labels, used in SWIFT V2 AKS scenario.
107107
// nolint
108108
func (k *K8sSWIFTv2Middleware) validateIPConfigsRequest(ctx context.Context, req *cns.IPConfigsRequest) (podInfo cns.PodInfo, respCode types.ResponseCode, message string, defaultDenyACL bool) {
109+
defaultDenyACLbool := false
109110
// Retrieve the pod from the cluster
110111
podInfo, err := cns.UnmarshalPodInfo(req.OrchestratorContext)
111112
if err != nil {
112113
errBuf := errors.Wrapf(err, "failed to unmarshalling pod info from ipconfigs request %+v", req)
113-
return nil, types.UnexpectedError, errBuf.Error(), false
114+
return nil, types.UnexpectedError, errBuf.Error(), defaultDenyACLbool
114115
}
115116
logger.Printf("[SWIFTv2Middleware] validate ipconfigs request for pod %s", podInfo.Name())
116117
podNamespacedName := k8stypes.NamespacedName{Namespace: podInfo.Namespace(), Name: podInfo.Name()}
117118
pod := v1.Pod{}
118119
if err := k.Cli.Get(ctx, podNamespacedName, &pod); err != nil {
119120
errBuf := errors.Wrapf(err, "failed to get pod %+v", podNamespacedName)
120-
return nil, types.UnexpectedError, errBuf.Error(), false
121+
return nil, types.UnexpectedError, errBuf.Error(), defaultDenyACLbool
121122
}
122123

123124
// check the pod labels for Swift V2, set the request's SecondaryInterfaceSet flag to true and check if its MTPNC CRD is ready
124125
_, swiftV2PodNetworkLabel := pod.Labels[configuration.LabelPodSwiftV2]
125126
_, swiftV2PodNetworkInstanceLabel := pod.Labels[configuration.LabelPodNetworkInstanceSwiftV2]
126-
defaultDenyACLbool := false
127127

128128
if swiftV2PodNetworkLabel || swiftV2PodNetworkInstanceLabel {
129129

0 commit comments

Comments
 (0)