Skip to content

Commit 6c3c040

Browse files
corrected the node-registrar image version to v1.0.2 to be aligned with all the side cars and used strings.Join() to concatenate the path string for volume
1 parent 90edc79 commit 6c3c040

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

deploy/kubernetes-1.13/hostpath/csi-hostpath-plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ spec:
3737
hostNetwork: true
3838
containers:
3939
- name: node-driver-registrar
40-
image: quay.io/k8scsi/csi-node-driver-registrar:canary
40+
image: quay.io/k8scsi/csi-node-driver-registrar:v1.0.2
4141
lifecycle:
4242
preStop:
4343
exec:

pkg/hostpath/controllerserver.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"os"
2323
"sort"
2424
"strconv"
25+
"strings"
2526

2627
"github.com/golang/protobuf/ptypes"
2728

@@ -38,8 +39,8 @@ import (
3839

3940
const (
4041
deviceID = "deviceID"
41-
provisionRoot = "/csi-data-dir/"
42-
snapshotRoot = "/csi-data-dir/"
42+
provisionRoot = "/csi-data-dir"
43+
snapshotRoot = "/csi-data-dir"
4344
maxStorageCapacity = tib
4445
)
4546

@@ -346,7 +347,8 @@ func (cs *controllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateS
346347
snapshotID := uuid.NewUUID().String()
347348
creationTime := ptypes.TimestampNow()
348349
volPath := hostPathVolume.VolPath
349-
file := snapshotRoot + snapshotID + ".tgz"
350+
filePath := []string{snapshotRoot, "/", snapshotID, ".tgz"}
351+
file := strings.Join(filePath, "")
350352
args := []string{}
351353
if hostPathVolume.VolAccessType == blockAccess {
352354
glog.V(4).Infof("Creating snapshot of Raw Block Mode Volume")
@@ -396,7 +398,8 @@ func (cs *controllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteS
396398
}
397399
snapshotID := req.GetSnapshotId()
398400
glog.V(4).Infof("deleting volume %s", snapshotID)
399-
path := snapshotRoot + snapshotID + ".tgz"
401+
pathSlice := []string{snapshotRoot, "/", snapshotID, ".tgz"}
402+
path := strings.Join(pathSlice, "")
400403
os.RemoveAll(path)
401404
delete(hostPathVolumeSnapshots, snapshotID)
402405
return &csi.DeleteSnapshotResponse{}, nil

0 commit comments

Comments
 (0)