k3s/pkg/volume
Kubernetes Submit Queue 70dd10cc50 Merge pull request #41785 from jamiehannaford/cinder-performance
Automatic merge from submit-queue (batch tested with PRs 38505, 41785, 46315)

Only retrieve relevant volumes

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

Improves performance for Cinder volume attach/detach calls. 

Currently when Cinder volumes are attached or detached, functions try to retrieve details about the volume from the Nova API. Because some only have the volume name not its UUID, they use the list function in gophercloud to iterate over all volumes to find a match. This incurs severe performance problems on OpenStack projects with lots of volumes (sometimes thousands) since it needs to send a new request when the current page does not contain a match. A better way of doing this is use the `?name=XXX` query parameter to refine the results.

**Which issue this PR fixes**:

https://github.com/kubernetes/kubernetes/issues/26404

**Special notes for your reviewer**:

There were 2 ways of addressing this problem:

1. Use the `name` query parameter
2. Instead of using the list function, switch to using volume UUIDs and use the GET function instead. You'd need to change the signature of a few functions though, such as [`DeleteVolume`](https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/cinder/cinder.go#L49), so I'm not sure how backwards compatible that is.

Since #1 does effectively the same as #2, I went with it because it ensures BC.

One assumption that is made is that the `volumeName` being retrieved matches exactly the name of the volume in Cinder. I'm not sure how accurate that is, but I see no reason why cloud providers would want to append/prefix things arbitrarily. 

**Release note**:
```release-note
Improves performance of Cinder volume attach/detach operations
```
2017-05-24 06:46:59 -07:00
..
aws_ebs Admin Can Specify in Which AWS Availability Zone(s) a PV Shall Be Created 2017-05-24 10:48:11 +02:00
azure_dd Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
azure_file Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
cephfs Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
cinder Refactor to use Volume IDs and remove ambiguity 2017-05-24 12:59:16 +02:00
configmap Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
downwardapi Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
empty_dir Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
fc Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
flexvolume Pass pod metadata to flex plugin 2017-05-18 00:49:18 -04:00
flocker Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
gce_pd Admin Can Specify in Which GCE Availability Zone(s) a PV Shall Be Created 2017-05-24 10:48:10 +02:00
git_repo Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
glusterfs Add `auto_unmount` mount option for glusterfs fuse mount. 2017-05-22 23:50:54 +05:30
host_path Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
iscsi Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
nfs nfs.go: cleancode err 2017-05-06 19:06:27 +08:00
photon_pd Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
portworx Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
projected Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
quobyte Merge pull request #41799 from johscheuer/fix-quobyte-example 2017-05-08 13:25:22 -07:00
rbd Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
scaleio Fix missing close file 2017-05-22 22:02:55 +08:00
secret Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
testing Fix reconciler test of attaching volume 2017-05-13 15:19:34 +08:00
util Don't return err when volume's status is 'attaching' 2017-05-12 19:53:50 +08:00
validation Define const annotation variable once 2017-04-24 11:54:21 +08:00
vsphere_volume SPBM policy ID support in vsphere cloud provider 2017-05-22 19:45:17 -07:00
BUILD Remove unused chmod/chown abstractions 2017-04-23 20:25:23 -03:00
OWNERS Merge pull request #45295 from rootfs/vol-owner 2017-05-09 04:13:00 -07:00
doc.go
metrics_cached.go
metrics_du.go add volume timestamps 2017-03-02 15:01:59 -08:00
metrics_du_test.go add volume timestamps 2017-03-02 15:01:59 -08:00
metrics_errors.go
metrics_nil.go
metrics_nil_test.go
metrics_statfs.go add volume timestamps 2017-03-02 15:01:59 -08:00
metrics_statfs_test.go add volume timestamps 2017-03-02 15:01:59 -08:00
plugins.go Merge pull request #44491 from NickrenREN/volume-MountOptionAnnotation 2017-04-25 12:51:39 -07:00
plugins_test.go Impement bulk polling of volumes 2017-03-02 14:59:59 -05:00
util.go Added func ValidateZone 2017-05-24 10:48:10 +02:00
util_test.go Added func ValidateZone 2017-05-24 10:48:10 +02:00
volume.go Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
volume_linux.go Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
volume_unsupported.go Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00