diff --git a/charts/latest/spdk-csi/templates/caching-node-handler.yaml b/charts/latest/spdk-csi/templates/caching-node-handler.yaml index 441b9b9..d52b7c0 100644 --- a/charts/latest/spdk-csi/templates/caching-node-handler.yaml +++ b/charts/latest/spdk-csi/templates/caching-node-handler.yaml @@ -68,8 +68,8 @@ spec: value: "{{ .Values.cachingnode.cpuMask }}" - name: SPDKMEM value: "{{ .Values.cachingnode.spdkMem }}" - - name: SPDKIMAGE - value: "{{ .Values.image.spdk.repository }}:{{ .Values.image.spdk.tag }}" + # - name: SPDKIMAGE + # value: "{{ .Values.image.spdk.repository }}:{{ .Values.image.spdk.tag }}" - name: S3DATAPATH value: "{{ .Values.cachingnode.s3DataPath }}" - name: BLOCKEDPCIE diff --git a/e2e/templates/pvc-cache.yaml b/e2e/templates/pvc-cache.yaml index 60200e4..cf2609f 100644 --- a/e2e/templates/pvc-cache.yaml +++ b/e2e/templates/pvc-cache.yaml @@ -5,7 +5,7 @@ metadata: annotations: simplybk/secret-name: simplyblock-pvc-keys simplybk/secret-namespace: default - #simplybk/host-id: 3edee612-c833-4dbf-a55b-966b057d0e3b + simplybk/host-id: 1678ca3e-f02a-4855-ac8f-95e3bd8e2362 spec: accessModes: - ReadWriteOnce diff --git a/pkg/spdk/controllerserver.go b/pkg/spdk/controllerserver.go index 90636bb..888ae15 100644 --- a/pkg/spdk/controllerserver.go +++ b/pkg/spdk/controllerserver.go @@ -349,14 +349,12 @@ func (cs *controllerServer) publishVolume(req *csi.CreateVolumeRequest, volumeID if err != nil { return nil, err } - err = cs.spdkNode.CachingNodeConnect(hostID, spdkVol.lvolID) + connInfo, err := cs.spdkNode.CachingNodeConnect(hostID, spdkVol.lvolID) if err != nil { klog.Errorf("error Connecting volume to host: %v", err) return nil, err } - return map[string]string{ - "hostID": hostID, - }, nil + return connInfo, nil } volumeInfo, err := cs.spdkNode.VolumeInfo(spdkVol.lvolID) diff --git a/pkg/util/jsonrpc.go b/pkg/util/jsonrpc.go index 3da00ab..bdfaac5 100644 --- a/pkg/util/jsonrpc.go +++ b/pkg/util/jsonrpc.go @@ -302,20 +302,20 @@ type CachingNodeReq struct { LvolID string `json:"lvol_id"` } -func (client *RPCClient) cachingNodeConnect(hostID, lvolID string) (bool, error) { +func (client *RPCClient) cachingNodeConnect(hostID, lvolID string) (map[string]string, error) { params := CachingNodeReq{ LvolID: lvolID, } - var result bool - out, err := client.CallSBCLI("PUT", "/cachingnode/connect/"+hostID, ¶ms) + + _, err := client.CallSBCLI("PUT", "/cachingnode/connect/"+hostID, ¶ms) if err != nil { - return false, err - } - result, ok := out.(bool) - if !ok { - return false, fmt.Errorf("failed to convert the response to bool type. Interface: %v", out) + return nil, err } - return result, nil + return map[string]string{ + "name": lvolID, + "uuid": lvolID, + "model": lvolID, + }, nil } func (client *RPCClient) resizeVolume(lvolID string, newSize int64) (bool, error) { diff --git a/pkg/util/nvmf.go b/pkg/util/nvmf.go index fb53e25..694d68c 100644 --- a/pkg/util/nvmf.go +++ b/pkg/util/nvmf.go @@ -160,13 +160,13 @@ func (node *NodeNVMf) DeleteSnapshot(snapshotID string) error { return nil } -func (node *NodeNVMf) CachingNodeConnect(hostID, lvolID string) error { - _, err := node.client.cachingNodeConnect(hostID, lvolID) +func (node *NodeNVMf) CachingNodeConnect(hostID, lvolID string) (map[string]string, error) { + conn, err := node.client.cachingNodeConnect(hostID, lvolID) if err != nil { - return err + return nil, err } klog.V(5).Infof("caching node connected: %s", hostID) - return nil + return conn, nil } // PublishVolume exports a volume through NVMf target