Merge pull request #28448 from thockin/gce-pd-discard
Automatic merge from submit-queue Mount r/w GCE PD disks with -o discard As per https://cloud.google.com/compute/docs/disks/add-persistent-disk#formatting. Fixes #23258
This commit is contained in:
@@ -165,6 +165,9 @@ func (attacher *gcePersistentDiskAttacher) MountDevice(spec *volume.Spec, device
|
|||||||
options := []string{}
|
options := []string{}
|
||||||
if readOnly {
|
if readOnly {
|
||||||
options = append(options, "ro")
|
options = append(options, "ro")
|
||||||
|
} else {
|
||||||
|
// as per https://cloud.google.com/compute/docs/disks/add-persistent-disk#formatting
|
||||||
|
options = append(options, "discard")
|
||||||
}
|
}
|
||||||
if notMnt {
|
if notMnt {
|
||||||
diskMounter := &mount.SafeFormatAndMount{Interface: mounter, Runner: exec.New()}
|
diskMounter := &mount.SafeFormatAndMount{Interface: mounter, Runner: exec.New()}
|
||||||
|
Reference in New Issue
Block a user