Skip to content

Commit ceabf69

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 ceabf69

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-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: 9 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,9 @@ 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, "")
352+
//file := snapshotRoot + snapshotID + ".tgz"
350353
args := []string{}
351354
if hostPathVolume.VolAccessType == blockAccess {
352355
glog.V(4).Infof("Creating snapshot of Raw Block Mode Volume")
@@ -396,7 +399,9 @@ func (cs *controllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteS
396399
}
397400
snapshotID := req.GetSnapshotId()
398401
glog.V(4).Infof("deleting volume %s", snapshotID)
399-
path := snapshotRoot + snapshotID + ".tgz"
402+
pathSlice := []string{snapshotRoot, "/", snapshotID, ".tgz"}
403+
path := strings.Join(pathSlice, "")
404+
//path := snapshotRoot + snapshotID + ".tgz"
400405
os.RemoveAll(path)
401406
delete(hostPathVolumeSnapshots, snapshotID)
402407
return &csi.DeleteSnapshotResponse{}, nil

0 commit comments

Comments
 (0)