diff --git a/pkg/cephfs/controllerserver.go b/pkg/cephfs/controllerserver.go index 9375706f2..21a0eeb46 100644 --- a/pkg/cephfs/controllerserver.go +++ b/pkg/cephfs/controllerserver.go @@ -43,7 +43,7 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol return nil, status.Error(codes.InvalidArgument, err.Error()) } - volId := newVolumeID() + volId := makeVolumeID(req.GetName()) conf := cephConfigData{Monitors: volOptions.Monitors, VolumeID: volId} if err = conf.writeToFile(); err != nil { diff --git a/pkg/cephfs/util.go b/pkg/cephfs/util.go index 9dce7063c..f2e6f2c83 100644 --- a/pkg/cephfs/util.go +++ b/pkg/cephfs/util.go @@ -27,14 +27,13 @@ import ( "google.golang.org/grpc/status" "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/pborman/uuid" "k8s.io/kubernetes/pkg/util/mount" ) type volumeID string -func newVolumeID() volumeID { - return volumeID("csi-cephfs-" + uuid.NewUUID().String()) +func makeVolumeID(volName string) volumeID { + return volumeID("csi-cephfs-" + volName) } func execCommand(command string, args ...string) ([]byte, error) {