kubernetes/pkg/volume/azure_dd
Kubernetes Submit Queue 1635393bd1
Merge pull request #63270 from andyzhangx/volume-partition-azure-fix
Automatic merge from submit-queue. 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 data loss issue if using existing azure disk with partitions in disk mount 

**What this PR does / why we need it**:
When use an existing azure disk(also called [static provisioning](https://github.com/andyzhangx/demo/tree/master/linux/azuredisk#static-provisioning-for-azure-disk)) in pod, if that disk has multiple partitions, the disk will be formatted in the pod mounting.

This PR removes `formatIfNotFormatted` func in `WaitForAttach` which uses `lsblk` command to check whether disk is formatted or not
b87a392b1a/pkg/volume/azure_dd/azure_common_linux.go (L213-L215)

And finally the format disk operation will happen in `MountDevice` in which it uses common k8s code(`SafeFormatAndMount.GetDiskFormat`) using `blkid` to detect disk format, `blkid` could detect multiple partitions
b87a392b1a/pkg/util/mount/mount_linux.go (L541-L543)

 - so if we use common k8s code(`SafeFormatAndMount.GetDiskFormat`), following error will be returned for mulitple partition disks, which is expected:

**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 #63235

**Special notes for your reviewer**:
This PR depends on https://github.com/kubernetes/kubernetes/pull/63248

**Release note**:

```
fix data loss issue if using existing azure disk with partitions in disk mount 
```

/sig azure
/assign @khenidak
2018-06-04 00:47:26 -07:00
..
attacher.go Merge pull request #63270 from andyzhangx/volume-partition-azure-fix 2018-06-04 00:47:26 -07:00
azure_common.go add block device support for azure disk 2018-05-21 09:03:59 +00:00
azure_common_linux.go Merge pull request #63270 from andyzhangx/volume-partition-azure-fix 2018-06-04 00:47:26 -07:00
azure_common_test.go TestIoHandler should not run on unsupported platforms 2017-09-20 00:35:58 -07:00
azure_common_unsupported.go remove format operation in WaitForAttach 2018-04-28 02:12:09 +00:00
azure_common_windows.go respect fstype in Windows for azure disk 2018-03-16 08:25:03 +00:00
azure_dd.go Implement volume plugin changes for volume limits 2018-06-01 19:17:30 -04:00
azure_dd_block.go add volumeName in getVolumeSpecFromGlobalMapPath 2018-05-22 06:52:24 +00:00
azure_dd_block_test.go add volumeName in getVolumeSpecFromGlobalMapPath 2018-05-22 06:52:24 +00:00
azure_dd_test.go Adding dynamic Flexvolume plugin discovery capability, using filesystem watch. 2017-08-25 11:42:32 -07:00
azure_mounter.go add block device support for azure disk 2018-05-21 09:03:59 +00:00
azure_provision.go Add block volume support to internal provisioners. 2018-05-29 12:02:40 +02:00
BUILD Add block volume support to internal provisioners. 2018-05-29 12:02:40 +02:00
OWNERS add Dong Liu as approver and add OWNERS in credentialprovider 2017-12-19 09:31:43 +00:00