mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 10:19:50 +00:00
Mount r/w GCE PD disks with -o discard
As per https://cloud.google.com/compute/docs/disks/add-persistent-disk#formatting.
This commit is contained in:
parent
d07328dc4a
commit
8efefab9a3
@ -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()}
|
||||||
|
Loading…
Reference in New Issue
Block a user