Skip to content

Commit df4e686

Browse files
committed
pass empty data in GET request
1 parent 218b539 commit df4e686

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

pkg/spdk/controllerserver.go

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -271,25 +271,24 @@ func prepareCreateVolumeReq(ctx context.Context, req *csi.CreateVolumeRequest, s
271271
}
272272

273273
createVolReq := util.CreateLVolData{
274-
LvolName: req.GetName(),
275-
Size: fmt.Sprintf("%dM", sizeMiB),
276-
LvsName: params["pool_name"],
277-
MaxRWIOPS: params["qos_rw_iops"],
278-
MaxRWmBytes: params["qos_rw_mbytes"],
279-
MaxRmBytes: params["qos_r_mbytes"],
280-
MaxWmBytes: params["qos_w_mbytes"],
281-
MaxSize: params["max_size"],
282-
PriorClass: priorClass,
283-
Compression: compression,
284-
Encryption: encryption,
285-
DistNdcs: distrNdcs,
286-
DistNpcs: distrNpcs,
287-
CryptoKey1: cryptoKey1,
288-
CryptoKey2: cryptoKey2,
289-
HostID: hostID,
290-
LvolID: lvolID,
291-
PvcName: pvcName,
292-
PvcNamespace: pvcNamespace,
274+
LvolName: req.GetName(),
275+
Size: fmt.Sprintf("%dM", sizeMiB),
276+
LvsName: params["pool_name"],
277+
MaxRWIOPS: params["qos_rw_iops"],
278+
MaxRWmBytes: params["qos_rw_mbytes"],
279+
MaxRmBytes: params["qos_r_mbytes"],
280+
MaxWmBytes: params["qos_w_mbytes"],
281+
MaxSize: params["max_size"],
282+
PriorClass: priorClass,
283+
Compression: compression,
284+
Encryption: encryption,
285+
DistNdcs: distrNdcs,
286+
DistNpcs: distrNpcs,
287+
CryptoKey1: cryptoKey1,
288+
CryptoKey2: cryptoKey2,
289+
HostID: hostID,
290+
LvolID: lvolID,
291+
PvcName: pvcName,
293292
}
294293
return &createVolReq, nil
295294
}

pkg/util/jsonrpc.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,8 @@ func (client *RPCClient) CallSBCLI(method, path string, args interface{}) (inter
421421
if err != nil {
422422
return nil, fmt.Errorf("%s: %w", method, err)
423423
}
424+
} else {
425+
data = nil
424426
}
425427

426428
requestURL := fmt.Sprintf("%s/%s", client.ClusterIP, path)
@@ -448,9 +450,9 @@ func (client *RPCClient) CallSBCLI(method, path string, args interface{}) (inter
448450
}
449451

450452
var response struct {
451-
Result interface{} `json:"result"`
452-
Results interface{} `json:"results"`
453-
Error string `json:"error"`
453+
Result any `json:"result"`
454+
Results any `json:"results"`
455+
Error string `json:"error"`
454456
}
455457

456458
err = json.NewDecoder(resp.Body).Decode(&response)

pkg/util/nvmf.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ type CreateLVolData struct {
8989
HostID string `json:"host_id"`
9090
LvolID string `json:"uid"`
9191
PvcName string `json:"pvc_name"`
92-
PvcNamespace string `json:"namespace"`
9392
}
9493

9594
// CreateVolume creates a logical volume and returns volume ID

0 commit comments

Comments
 (0)