mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Removes defaulting of CSI fsType to ext4
This commit is contained in:
parent
c005b9d0ab
commit
5dfe7b5758
@ -575,7 +575,7 @@ type GCEPersistentDiskVolumeSource struct {
|
|||||||
PDName string
|
PDName string
|
||||||
// Filesystem type to mount.
|
// Filesystem type to mount.
|
||||||
// Must be a filesystem type supported by the host operating system.
|
// Must be a filesystem type supported by the host operating system.
|
||||||
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
// Ex. "ext4", "xfs", "ntfs".
|
||||||
// TODO: how do we prevent errors in the filesystem from compromising the machine
|
// TODO: how do we prevent errors in the filesystem from compromising the machine
|
||||||
// +optional
|
// +optional
|
||||||
FSType string
|
FSType string
|
||||||
|
@ -354,10 +354,6 @@ func (c *csiAttacher) MountDevice(spec *volume.Spec, devicePath string, deviceMo
|
|||||||
}
|
}
|
||||||
|
|
||||||
fsType := csiSource.FSType
|
fsType := csiSource.FSType
|
||||||
if len(fsType) == 0 {
|
|
||||||
fsType = defaultFSType
|
|
||||||
}
|
|
||||||
|
|
||||||
err = csi.NodeStageVolume(ctx,
|
err = csi.NodeStageVolume(ctx,
|
||||||
csiSource.VolumeHandle,
|
csiSource.VolumeHandle,
|
||||||
publishVolumeInfo,
|
publishVolumeInfo,
|
||||||
|
@ -34,8 +34,6 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/volume/util"
|
"k8s.io/kubernetes/pkg/volume/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultFSType = "ext4"
|
|
||||||
|
|
||||||
//TODO (vladimirvivien) move this in a central loc later
|
//TODO (vladimirvivien) move this in a central loc later
|
||||||
var (
|
var (
|
||||||
volDataKey = struct {
|
volDataKey = struct {
|
||||||
@ -177,9 +175,6 @@ func (c *csiMountMgr) SetUpAt(dir string, fsGroup *int64) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fsType := csiSource.FSType
|
fsType := csiSource.FSType
|
||||||
if len(fsType) == 0 {
|
|
||||||
fsType = defaultFSType
|
|
||||||
}
|
|
||||||
err = csi.NodePublishVolume(
|
err = csi.NodePublishVolume(
|
||||||
ctx,
|
ctx,
|
||||||
c.volumeID,
|
c.volumeID,
|
||||||
|
@ -144,6 +144,12 @@ func TestMounterSetUp(t *testing.T) {
|
|||||||
if err := csiMounter.SetUp(&fsGroup); err != nil {
|
if err := csiMounter.SetUp(&fsGroup); err != nil {
|
||||||
t.Fatalf("mounter.Setup failed: %v", err)
|
t.Fatalf("mounter.Setup failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Test the default value of file system type is not overridden
|
||||||
|
if len(csiMounter.spec.PersistentVolume.Spec.CSI.FSType) != 0 {
|
||||||
|
t.Errorf("default value of file system type was overridden by type %s", csiMounter.spec.PersistentVolume.Spec.CSI.FSType)
|
||||||
|
}
|
||||||
|
|
||||||
path := csiMounter.GetPath()
|
path := csiMounter.GetPath()
|
||||||
if _, err := os.Stat(path); err != nil {
|
if _, err := os.Stat(path); err != nil {
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
|
@ -635,7 +635,7 @@ type RBDVolumeSource struct {
|
|||||||
RBDImage string `json:"image" protobuf:"bytes,2,opt,name=image"`
|
RBDImage string `json:"image" protobuf:"bytes,2,opt,name=image"`
|
||||||
// Filesystem type of the volume that you want to mount.
|
// Filesystem type of the volume that you want to mount.
|
||||||
// Tip: Ensure that the filesystem type is supported by the host operating system.
|
// Tip: Ensure that the filesystem type is supported by the host operating system.
|
||||||
// Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
// Examples: "ext4", "xfs", "ntfs".
|
||||||
// More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd
|
// More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd
|
||||||
// TODO: how do we prevent errors in the filesystem from compromising the machine
|
// TODO: how do we prevent errors in the filesystem from compromising the machine
|
||||||
// +optional
|
// +optional
|
||||||
|
Loading…
Reference in New Issue
Block a user