Skip to content

Commit

Permalink
Merge pull request #66035 from krunaljain/automated-cherry-pick-of-#6…
Browse files Browse the repository at this point in the history
…5499-upstream-release-1.10

Automatic merge from submit-queue.

Automated cherry pick of #65499: Removes defaulting of CSI fsType to ext4

Cherry pick of #65499 on release-1.10.

#65499: Removes defaulting of CSI fsType to ext4
  • Loading branch information
Kubernetes Submit Queue committed Jul 13, 2018
2 parents 93a2e8a + 570c9e6 commit 0862ebd
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion api/openapi-spec/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/swagger-spec/v1.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/api-reference/v1/definitions.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/apis/core/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,7 @@ type CSIPersistentVolumeSource struct {

// 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.
// Ex. "ext4", "xfs", "ntfs".
// +optional
FSType string

Expand Down
4 changes: 0 additions & 4 deletions pkg/volume/csi/csi_attacher.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,6 @@ func (c *csiAttacher) MountDevice(spec *volume.Spec, devicePath string, deviceMo
}

fsType := csiSource.FSType
if len(fsType) == 0 {
fsType = defaultFSType
}

err = csi.NodeStageVolume(ctx,
csiSource.VolumeHandle,
publishVolumeInfo,
Expand Down
5 changes: 0 additions & 5 deletions pkg/volume/csi/csi_mounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ import (
"k8s.io/kubernetes/pkg/volume/util"
)

const defaultFSType = "ext4"

//TODO (vladimirvivien) move this in a central loc later
var (
volDataKey = struct {
Expand Down Expand Up @@ -177,9 +175,6 @@ func (c *csiMountMgr) SetUpAt(dir string, fsGroup *int64) error {
}

fsType := csiSource.FSType
if len(fsType) == 0 {
fsType = defaultFSType
}
err = csi.NodePublishVolume(
ctx,
c.volumeID,
Expand Down
6 changes: 6 additions & 0 deletions pkg/volume/csi/csi_mounter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ func TestMounterSetUp(t *testing.T) {
if err := csiMounter.SetUp(&fsGroup); err != nil {
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()
if _, err := os.Stat(path); err != nil {
if os.IsNotExist(err) {
Expand Down
2 changes: 1 addition & 1 deletion staging/src/k8s.io/api/core/v1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/api/core/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,7 @@ type CSIPersistentVolumeSource struct {

// 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.
// Ex. "ext4", "xfs", "ntfs".
// +optional
FSType string `json:"fsType,omitempty" protobuf:"bytes,4,opt,name=fsType"`

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0862ebd

Please sign in to comment.