k3s/pkg/volume/fc
Kubernetes Submit Queue 26bb28b046 Merge pull request #52691 from mtanino/issue/52690
Automatic merge from submit-queue (batch tested with PRs 52675, 52691). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

FC plugin: Return target wwn + lun at GetVolumeName()

**What this PR does / why we need it**:

At volume attach/detach controller, GetVolumeName() is
expected to return unique volume identifier, but FC
plugin didn't return unique identifier if user specified
FC volume using target wwn and lun.

In order to return unique identifier, GetVolumeName()
should use combination of target wwn and lun.

**Which issue this PR fixes** : fixes #52690

**Special notes for your reviewer**:

Should we use same format of unique volume identifier between v1.7 and v1.8 `for the purpose of backward compatibility?`

- At v1.7(before introducing attach/detach function), unique ID was pod's uuid + volume name
```
I0918 22:47:13.113481   44661 reconciler.go:257] operationExecutor.MountVolume started for volume "pv0001" (UniqueName: "kubernetes.io/fc/d6c66980-9ce4-11e7-8bb7-f8bc12550954-pv0001") pod "nginx-pod1" (UID: "d6c66980-9ce4-11e7-8bb7-f8bc12550954")  
I0918 22:47:15.116584   44661 operation_generator.go:476] MountVolume.SetUp succeeded for volume "pv0001" (UniqueName: "kubernetes.io/fc/d6c66980-9ce4-11e7-8bb7-f8bc12550954-pv0001") pod "nginx-pod1" (UID: "d6c66980-9ce4-11e7-8bb7-f8bc12550954")  
```

- At latest master, unique ID is targetWWNs.(if a user specifies a volume using target wwn + lun)
```
I0918 22:23:48.389339    1016 reconciler.go:212] operationExecutor.VerifyControllerAttachedVolume started for volume "pv0001" (UniqueName: "kubernetes.io/fc/[78060e801049abcd]") pod "nginx-pod3" (UID: "8f76b894-9ce1-11e7-b8f4-f8bc12550954")  
```

/cc @jsafrane @rootfs @msau42 @jingxu97 

**Release note**:

```
NONE
```
2017-09-20 10:01:42 -07:00
..
BUILD fibre channel: Remove unused exe interface 2017-08-22 14:28:10 +02:00
OWNERS remove deads2k from volume reviewer 2017-07-25 08:52:25 -04:00
attacher.go WaitForAttach refactoring for iSCSI attacher/detacher 2017-08-26 17:21:34 -04:00
disk_manager.go handle failed mounts for fc volumes 2017-08-25 09:59:42 +02:00
doc.go Use Go canonical import paths 2016-07-16 13:48:21 -04:00
fc.go FC plugin: Return target wwn + lun at GetVolumeName() 2017-09-19 16:39:36 -04:00
fc_test.go Adding dynamic Flexvolume plugin discovery capability, using filesystem watch. 2017-08-25 11:42:32 -07:00
fc_util.go Fix FC WaitForAttach not mounting a volume 2017-09-18 22:42:02 -04:00
fc_util_test.go FC plugin: Support WWID for volume identifier 2017-08-10 09:59:31 -04:00