Skip to content

Commit

Permalink
Merge pull request #1236 from kubernetes-sigs/add-enableVolumeMountGroup
Browse files Browse the repository at this point in the history
feat: add enableVolumeMountGroup feature flag
  • Loading branch information
k8s-ci-robot authored May 8, 2023

Verified

This commit was signed with the committer’s verified signature. The key has expired.
2 parents 5e21f92 + d590a9c commit a84b055
Showing 8 changed files with 17 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -33,6 +33,9 @@ E2E_HELM_OPTIONS += ${EXTRA_HELM_OPTIONS}
ifdef KUBERNETES_VERSION # disable kubelet-registration-probe on capz cluster testing
E2E_HELM_OPTIONS += --set linux.enableRegistrationProbe=false --set windows.enableRegistrationProbe=false
endif
ifdef EXTERNAL_E2E_TEST_NFS
E2E_HELM_OPTIONS += --set feature.enableVolumeMountGroup=false --set feature.fsGroupPolicy=File
endif
GINKGO_FLAGS = -ginkgo.v
GO111MODULE = on
GOPATH ?= $(shell go env GOPATH)
2 changes: 2 additions & 0 deletions charts/README.md
Original file line number Diff line number Diff line change
@@ -52,6 +52,8 @@ The following table lists the configurable parameters of the latest Azure File C
| `driver.userAgentSuffix` | userAgent suffix | `OSS-helm` |
| `driver.azureGoSDKLogLevel` | [Azure go sdk log level](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/previous-versions-quickstart.md#built-in-basic-requestresponse-logging) | ``(no logs), `DEBUG`, `INFO`, `WARNING`, `ERROR`, [etc](https://github.com/Azure/go-autorest/blob/50e09bb39af124f28f29ba60efde3fa74a4fe93f/logger/logger.go#L65-L73). |
| `feature.enableGetVolumeStats` | allow GET_VOLUME_STATS on agent node | `true` |
| `feature.enableVolumeMountGroup` | indicates whether enabling VOLUME_MOUNT_GROUP | `true` |
| `feature.fsGroupPolicy` | CSIDriver FSGroupPolicy value | `ReadWriteOnceWithFSType`(available values: `ReadWriteOnceWithFSType`, `File`, `None`) |
| `image.baseRepo` | base repository of driver images | `mcr.microsoft.com` |
| `image.azurefile.repository` | azurefile-csi-driver docker image | `/oss/kubernetes-csi/azurefile-csi` |
| `image.azurefile.tag` | azurefile-csi-driver docker image tag | `` |
Binary file modified charts/latest/azurefile-csi-driver-v0.0.0.tgz
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -14,4 +14,4 @@ spec:
volumeLifecycleModes:
- Persistent
- Ephemeral
fsGroupPolicy: ReadWriteOnceWithFSType
fsGroupPolicy: {{ .Values.feature.fsGroupPolicy }}
Original file line number Diff line number Diff line change
@@ -131,6 +131,7 @@ spec:
- "--custom-user-agent={{ .Values.driver.customUserAgent }}"
- "--user-agent-suffix={{ .Values.driver.userAgentSuffix }}"
- "--allow-empty-cloud-config={{ .Values.node.allowEmptyCloudConfig }}"
- "--enable-volume-mount-group={{ .Values.feature.enableVolumeMountGroup }}"
- "--enable-get-volume-stats={{ .Values.feature.enableGetVolumeStats }}"
- "--mount-permissions={{ .Values.linux.mountPermissions }}"
- "--allow-inline-volume-key-access-with-identity={{ .Values.node.allowInlineVolumeKeyAccessWithIdentity }}"
2 changes: 2 additions & 0 deletions charts/latest/azurefile-csi-driver/values.yaml
Original file line number Diff line number Diff line change
@@ -156,6 +156,8 @@ snapshot:

feature:
enableGetVolumeStats: true
enableVolumeMountGroup: true
fsGroupPolicy: ReadWriteOnceWithFSType

driver:
name: file.csi.azure.com
8 changes: 6 additions & 2 deletions pkg/azurefile/azurefile.go
Original file line number Diff line number Diff line change
@@ -192,6 +192,7 @@ type DriverOptions struct {
AllowEmptyCloudConfig bool
AllowInlineVolumeKeyAccessWithIdentity bool
EnableVHDDiskFeature bool
EnableVolumeMountGroup bool
EnableGetVolumeStats bool
AppendMountErrorHelpLink bool
MountPermissions uint64
@@ -214,6 +215,7 @@ type Driver struct {
allowInlineVolumeKeyAccessWithIdentity bool
enableVHDDiskFeature bool
enableGetVolumeStats bool
enableVolumeMountGroup bool
appendMountErrorHelpLink bool
mountPermissions uint64
kubeAPIQPS float64
@@ -258,6 +260,7 @@ func NewDriver(options *DriverOptions) *Driver {
driver.allowEmptyCloudConfig = options.AllowEmptyCloudConfig
driver.allowInlineVolumeKeyAccessWithIdentity = options.AllowInlineVolumeKeyAccessWithIdentity
driver.enableVHDDiskFeature = options.EnableVHDDiskFeature
driver.enableVolumeMountGroup = options.EnableVolumeMountGroup
driver.enableGetVolumeStats = options.EnableGetVolumeStats
driver.appendMountErrorHelpLink = options.AppendMountErrorHelpLink
driver.mountPermissions = options.MountPermissions
@@ -325,7 +328,6 @@ func (d *Driver) Run(endpoint, kubeconfig string, testBool bool) {
csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME,
csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME,
csi.ControllerServiceCapability_RPC_CREATE_DELETE_SNAPSHOT,
//csi.ControllerServiceCapability_RPC_LIST_SNAPSHOTS,
csi.ControllerServiceCapability_RPC_EXPAND_VOLUME,
csi.ControllerServiceCapability_RPC_SINGLE_NODE_MULTI_WRITER,
})
@@ -342,7 +344,9 @@ func (d *Driver) Run(endpoint, kubeconfig string, testBool bool) {
nodeCap := []csi.NodeServiceCapability_RPC_Type{
csi.NodeServiceCapability_RPC_STAGE_UNSTAGE_VOLUME,
csi.NodeServiceCapability_RPC_SINGLE_NODE_MULTI_WRITER,
csi.NodeServiceCapability_RPC_VOLUME_MOUNT_GROUP,
}
if d.enableVolumeMountGroup {
nodeCap = append(nodeCap, csi.NodeServiceCapability_RPC_VOLUME_MOUNT_GROUP)
}
if d.enableGetVolumeStats {
nodeCap = append(nodeCap, csi.NodeServiceCapability_RPC_GET_VOLUME_STATS)
2 changes: 2 additions & 0 deletions pkg/azurefileplugin/main.go
Original file line number Diff line number Diff line change
@@ -47,6 +47,7 @@ var (
customUserAgent = flag.String("custom-user-agent", "", "custom userAgent")
userAgentSuffix = flag.String("user-agent-suffix", "", "userAgent suffix")
allowEmptyCloudConfig = flag.Bool("allow-empty-cloud-config", true, "allow running driver without cloud config")
enableVolumeMountGroup = flag.Bool("enable-volume-mount-group", true, "indicates whether enabling VOLUME_MOUNT_GROUP")
enableGetVolumeStats = flag.Bool("enable-get-volume-stats", true, "allow GET_VOLUME_STATS on agent node")
mountPermissions = flag.Uint64("mount-permissions", 0777, "mounted folder permissions")
allowInlineVolumeKeyAccessWithIdentity = flag.Bool("allow-inline-volume-key-access-with-identity", false, "allow accessing storage account key using cluster identity for inline volume")
@@ -88,6 +89,7 @@ func handle() {
CustomUserAgent: *customUserAgent,
UserAgentSuffix: *userAgentSuffix,
AllowEmptyCloudConfig: *allowEmptyCloudConfig,
EnableVolumeMountGroup: *enableVolumeMountGroup,
EnableGetVolumeStats: *enableGetVolumeStats,
MountPermissions: *mountPermissions,
AllowInlineVolumeKeyAccessWithIdentity: *allowInlineVolumeKeyAccessWithIdentity,

0 comments on commit a84b055

Please # to comment.