k3s/pkg
Kubernetes Submit Queue bf3cda66c3
Merge pull request #62612 from andyzhangx/azure-devicepath-fix
Automatic merge from submit-queue (batch tested with PRs 62676, 62612). 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>.

fix WaitForAttach failure issue for azure disk

**What this PR does / why we need it**:
From v1.10, `devicePath` will be updated due to following code change:
568afb4ecc/pkg/volume/util/operationexecutor/operation_generator.go (L517-L518)

So in v1.10.0, MountVolume.WaitForAttach will fail in the azure disk remount, error logs would be like following:
```
MountVolume.WaitForAttach failed for volume "pvc-f1562ecb-3e5f-11e8-ab6b-000d3af9f967" : azureDisk - Wait for attach expect device path as a lun number, instead got: /dev/disk/azure/scsi1/lun1 (strconv.Atoi: parsing "/dev/disk/azure/scsi1/lun1": invalid syntax)
  Warning  FailedMount             1m (x10 over 21m)   kubelet, k8s-agentpool-66825246-0  Unable to mount volumes for pod  
```

This PR does not use `devicePath` anymore since it could be changed, instead, it use `diskController.GetDiskLun(diskName, volumeSource.DataDiskURI, nodeName)` to get disk LUN, this ARM api call would cost about 0.12s

The GCE disk won't have this issue since `devicePath` is not used in [WaitForAttach func](https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/gce_pd/attacher.go#L133), while aws disk is also using `devicePath`  in [WaitForAttach func](https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/aws_ebs/attacher.go#L145), I think there is potentical issue for aws_ebs

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #62540

**Special notes for your reviewer**:
should cherry-pick to v1.10

**Release note**:

```
fix WaitForAttach failure issue for azure disk
```
/assign @feiskyer 
/sig azure

FYI @khenidak
2018-04-16 21:56:10 -07:00
..
api remove deprecated ObjectMeta ListOptions DeleteOptions 2018-04-09 21:19:20 +08:00
apis Merge pull request #62496 from jennybuckley/service-port-docs 2018-04-13 15:03:10 -07:00
auth
capabilities
client Merge pull request #61608 from php-coder/psp_move_internal_types_to_policy 2018-04-13 05:22:24 -07:00
cloudprovider remove parallel 2018-04-16 09:29:28 -07:00
controller Merge pull request #62471 from mikedanese/certs2 2018-04-13 16:01:10 -07:00
credentialprovider
features make mikedanese owner of CertRotation features 2018-04-12 08:37:29 -07:00
fieldpath
generated update bindata after #61817 2018-04-11 14:24:01 -07:00
kubeapiserver Merge pull request #62621 from hzxuzhonghu/kube-api-show-deprecated-flags 2018-04-16 12:58:17 -07:00
kubectl Merge pull request #62181 from juanvallejo/jvallejo/wire-print-flags-create-cmds 2018-04-13 15:03:13 -07:00
kubelet Make 'pod' package to use unified checkpointManager 2018-04-16 01:30:20 -04:00
kubemark
master apiserver: enforce shared RequestContextMapper in delegation chain 2018-04-05 14:41:56 +02:00
printers begin wiring printopts through complete commands 2018-04-13 11:50:54 -04:00
probe
proxy fix nodeport FORWARD chain 2018-04-12 17:25:28 +08:00
quota Resources prefixed with *kubernetes.io/ should remain unscheduled if they are not exposed on the node. 2018-03-28 17:24:30 -07:00
registry Move podsecuritypolicy registry to policy package. 2018-04-16 17:21:52 +02:00
routes
scheduler Merge pull request #62211 from bsalamat/affinity_performance 2018-04-13 07:25:21 -07:00
security Update generated files. 2018-04-11 18:35:24 +02:00
securitycontext remove unused code in securitycontext 2018-03-29 23:32:48 -07:00
serviceaccount
ssh
util add andyzhangx as Reviewer 2018-04-16 07:13:15 +00:00
version
volume Merge pull request #62612 from andyzhangx/azure-devicepath-fix 2018-04-16 21:56:10 -07:00
watch/json
windows/service Add support for binaries to run as Windows services 2018-03-07 00:51:36 +01:00
.import-restrictions
BUILD pkg/api/unversioned related cleanup 2018-03-13 17:20:16 +08:00
OWNERS