vendor update for CSI 0.3.0

This commit is contained in:
gman
2018-07-18 16:47:22 +02:00
parent 6f484f92fc
commit 8ea659f0d5
6810 changed files with 438061 additions and 193861 deletions

View File

@ -8,7 +8,7 @@ $ sudo ./_output/iscsidriver --endpoint tcp://127.0.0.1:10000 --nodeid CSINode
```
### Test using csc
Get ```csc``` tool from https://github.com/thecodeteam/gocsi/tree/master/csc
Get ```csc``` tool from https://github.com/rexray/gocsi/tree/master/csc
#### Get plugin info
```
@ -16,12 +16,6 @@ $ csc identity plugin-info --endpoint tcp://127.0.0.1:10000
"ISCSI" "0.1.0"
```
### Get supported versions
```
$ csc identity supported-versions --endpoint tcp://127.0.0.1:10000
0.1.0
```
#### NodePublish a volume
```
$ export ISCSI_TARGET="iSCSI Target Server IP (Ex: 10.10.10.10)"

View File

@ -39,7 +39,7 @@ const (
)
var (
version = "0.2.0"
version = "0.3.0"
)
func NewDriver(nodeID, endpoint string) *driver {

View File

@ -268,7 +268,7 @@ func (util *ISCSIUtil) AttachDisk(b iscsiDiskMounter) (string, error) {
devicePath = devicePaths[0]
// Mount device
mntPath := path.Join(b.targetPath, b.VolName)
mntPath := b.targetPath
notMnt, err := b.mounter.IsLikelyNotMountPoint(mntPath)
if err != nil && !os.IsNotExist(err) {
return "", fmt.Errorf("Heuristic determination of mount point failed:%v", err)
@ -320,21 +320,20 @@ func (util *ISCSIUtil) AttachDisk(b iscsiDiskMounter) (string, error) {
}
func (util *ISCSIUtil) DetachDisk(c iscsiDiskUnmounter, targetPath string) error {
mntPath := path.Join(targetPath, c.VolName)
_, cnt, err := mount.GetDeviceNameFromMount(c.mounter, mntPath)
_, cnt, err := mount.GetDeviceNameFromMount(c.mounter, targetPath)
if err != nil {
glog.Errorf("iscsi detach disk: failed to get device from mnt: %s\nError: %v", mntPath, err)
glog.Errorf("iscsi detach disk: failed to get device from mnt: %s\nError: %v", targetPath, err)
return err
}
if pathExists, pathErr := volumeutil.PathExists(mntPath); pathErr != nil {
if pathExists, pathErr := volumeutil.PathExists(targetPath); pathErr != nil {
return fmt.Errorf("Error checking if path exists: %v", pathErr)
} else if !pathExists {
glog.Warningf("Warning: Unmount skipped because path does not exist: %v", mntPath)
glog.Warningf("Warning: Unmount skipped because path does not exist: %v", targetPath)
return nil
}
if err = c.mounter.Unmount(mntPath); err != nil {
glog.Errorf("iscsi detach disk: failed to unmount: %s\nError: %v", mntPath, err)
if err = c.mounter.Unmount(targetPath); err != nil {
glog.Errorf("iscsi detach disk: failed to unmount: %s\nError: %v", targetPath, err)
return err
}
cnt--