mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-16 06:32:32 +00:00
Add fsType for CSI
This commit is contained in:
@@ -1615,6 +1615,12 @@ type CSIPersistentVolumeSource struct {
|
|||||||
// Defaults to false (read/write).
|
// Defaults to false (read/write).
|
||||||
// +optional
|
// +optional
|
||||||
ReadOnly bool
|
ReadOnly bool
|
||||||
|
|
||||||
|
// Filesystem type to mount.
|
||||||
|
// Must be a filesystem type supported by the host operating system.
|
||||||
|
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
||||||
|
// +optional
|
||||||
|
FSType string
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerPort represents a network port in a single container
|
// ContainerPort represents a network port in a single container
|
||||||
|
@@ -34,6 +34,8 @@ 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 {
|
||||||
@@ -189,6 +191,11 @@ func (c *csiMountMgr) SetUpAt(dir string, fsGroup *int64) error {
|
|||||||
accessMode = c.spec.PersistentVolume.Spec.AccessModes[0]
|
accessMode = c.spec.PersistentVolume.Spec.AccessModes[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fsType := csiSource.FSType
|
||||||
|
if len(fsType) == 0 {
|
||||||
|
fsType = defaultFSType
|
||||||
|
}
|
||||||
|
|
||||||
err = csi.NodePublishVolume(
|
err = csi.NodePublishVolume(
|
||||||
ctx,
|
ctx,
|
||||||
c.volumeID,
|
c.volumeID,
|
||||||
@@ -197,7 +204,7 @@ func (c *csiMountMgr) SetUpAt(dir string, fsGroup *int64) error {
|
|||||||
accessMode,
|
accessMode,
|
||||||
c.volumeInfo,
|
c.volumeInfo,
|
||||||
attribs,
|
attribs,
|
||||||
"ext4", //TODO needs to be sourced from PV or somewhere else
|
fsType,
|
||||||
)
|
)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -1730,6 +1730,12 @@ type CSIPersistentVolumeSource struct {
|
|||||||
// Defaults to false (read/write).
|
// Defaults to false (read/write).
|
||||||
// +optional
|
// +optional
|
||||||
ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"`
|
ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"`
|
||||||
|
|
||||||
|
// Filesystem type to mount.
|
||||||
|
// Must be a filesystem type supported by the host operating system.
|
||||||
|
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
||||||
|
// +optional
|
||||||
|
FSType string `json:"fsType,omitempty" protobuf:"bytes,4,opt,name=fsType"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerPort represents a network port in a single container.
|
// ContainerPort represents a network port in a single container.
|
||||||
|
Reference in New Issue
Block a user