Skip to content

Commit

Permalink
Added full cinder ID to candidateDeviceNodes (#853)
Browse files Browse the repository at this point in the history
candidateDeviceNodes now also accept the full volumeID
  • Loading branch information
Christoph Glaubitz authored and k8s-ci-robot committed Nov 28, 2019
1 parent 0dfdb1c commit ca79a0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/cloudprovider/providers/openstack/openstack_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,12 @@ func (os *OpenStack) GetDevicePathBySerialID(volumeID string) string {
candidateDeviceNodes := []string{
// KVM
fmt.Sprintf("virtio-%s", volumeID[:20]),
// KVM #852
fmt.Sprintf("virtio-%s", volumeID),
// KVM virtio-scsi
fmt.Sprintf("scsi-0QEMU_QEMU_HARDDISK_%s", volumeID[:20]),
// KVM virtio-scsi #852
fmt.Sprintf("scsi-0QEMU_QEMU_HARDDISK_%s", volumeID),
// ESXi
fmt.Sprintf("wwn-0x%s", strings.Replace(volumeID, "-", "", -1)),
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/csi/cinder/mount/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,12 @@ func (m *Mount) getDevicePathBySerialID(volumeID string) string {
candidateDeviceNodes := []string{
// KVM
fmt.Sprintf("virtio-%s", volumeID[:20]),
// KVM #852
fmt.Sprintf("virtio-%s", volumeID),
// KVM virtio-scsi
fmt.Sprintf("scsi-0QEMU_QEMU_HARDDISK_%s", volumeID[:20]),
// KVM virtio-scsi #852
fmt.Sprintf("scsi-0QEMU_QEMU_HARDDISK_%s", volumeID),
// ESXi
fmt.Sprintf("wwn-0x%s", strings.Replace(volumeID, "-", "", -1)),
}
Expand Down

0 comments on commit ca79a0e

Please sign in to comment.