Commit 939b9848 authored by k8s-merge-robot's avatar k8s-merge-robot Committed by GitHub

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
parents 3895cede 8efefab9
......@@ -165,6 +165,9 @@ func (attacher *gcePersistentDiskAttacher) MountDevice(spec *volume.Spec, device
options := []string{}
if readOnly {
options = append(options, "ro")
} else {
// as per https://cloud.google.com/compute/docs/disks/add-persistent-disk#formatting
options = append(options, "discard")
}
if notMnt {
diskMounter := &mount.SafeFormatAndMount{Interface: mounter, Runner: exec.New()}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment