Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurelocal-csi: Support fsGroup #255

Draft
wants to merge 1 commit into
base: cc-azurelocal-csi-driver/master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/azuredisk/azuredisk.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ func newDriverV1(options *DriverOptions) *Driver {
csi.NodeServiceCapability_RPC_EXPAND_VOLUME,
csi.NodeServiceCapability_RPC_GET_VOLUME_STATS,
csi.NodeServiceCapability_RPC_SINGLE_NODE_MULTI_WRITER,
csi.NodeServiceCapability_RPC_VOLUME_MOUNT_GROUP,
})
return &driver
}
Expand Down
8 changes: 6 additions & 2 deletions pkg/azuredisk/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,12 @@ func (d *Driver) NodePublishVolume(_ context.Context, req *csi.NodePublishVolume

// Get fsType that the volume will be formatted and mounted with
fstype := getDefaultFsType()
var mntGroup string
if mnt := volumeCapability.GetMount(); mnt != nil {
if mnt.FsType != "" {
fstype = mnt.FsType
}
mntGroup = mnt.VolumeMountGroup
}

volContextFSType := azureutils.GetFStype(req.GetVolumeContext())
Expand All @@ -254,8 +256,10 @@ func (d *Driver) NodePublishVolume(_ context.Context, req *csi.NodePublishVolume
VolumeType: "blk",
Device: device,
FsType: fstype,
Metadata: nil,
Options: nil,
Metadata: map[string]string{
"fsGroup": mntGroup,
},
Options: nil,
}

rawMountInfo, err := json.Marshal(mountInfo)
Expand Down
Loading