diff --git a/pkg/azurefile/azurefile.go b/pkg/azurefile/azurefile.go index 29007c3c9e..e2c9239884 100644 --- a/pkg/azurefile/azurefile.go +++ b/pkg/azurefile/azurefile.go @@ -126,6 +126,7 @@ const ( allowBlobPublicAccessField = "allowblobpublicaccess" publicNetworkAccessField = "publicnetworkaccess" allowSharedKeyAccessField = "allowsharedkeyaccess" + allowCrossTenantReplicationField = "allowcrosstenantreplication" storageEndpointSuffixField = "storageendpointsuffix" fsGroupChangePolicyField = "fsgroupchangepolicy" ephemeralField = "csi.storage.k8s.io/ephemeral" diff --git a/pkg/azurefile/controllerserver.go b/pkg/azurefile/controllerserver.go index 16846ab1ab..5fe3db5ba4 100644 --- a/pkg/azurefile/controllerserver.go +++ b/pkg/azurefile/controllerserver.go @@ -122,7 +122,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) var secretNamespace, pvcNamespace, protocol, customTags, storageEndpointSuffix, networkEndpointType, shareAccessTier, accountAccessTier, rootSquashType, tagValueDelimiter string var createAccount, useSeretCache, matchTags, selectRandomMatchingAccount, getLatestAccountKey, encryptInTransit, mountWithManagedIdentity, mountWithWIToken bool var vnetResourceGroup, vnetName, vnetLinkName, publicNetworkAccess, subnetName, shareNamePrefix, fsGroupChangePolicy, useDataPlaneAPI string - var requireInfraEncryption, disableDeleteRetentionPolicy, enableLFS, isMultichannelEnabled, allowSharedKeyAccess *bool + var requireInfraEncryption, disableDeleteRetentionPolicy, enableLFS, isMultichannelEnabled, allowSharedKeyAccess, allowCrossTenantReplication *bool var provisionedBandwidthMibps, provisionedIops *int32 // set allowBlobPublicAccess as false by default allowBlobPublicAccess := ptr.To(false) @@ -225,6 +225,12 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) return nil, status.Errorf(codes.InvalidArgument, "invalid %s: %s in storage class", allowSharedKeyAccessField, v) } allowSharedKeyAccess = &value + case allowCrossTenantReplicationField: + value, err := strconv.ParseBool(v) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid %s: %s in storage class", allowCrossTenantReplicationField, v) + } + allowCrossTenantReplication = &value case pvcNameKey: fileShareNameReplaceMap[pvcNameMetadata] = v case pvNameKey: @@ -557,6 +563,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) DisableFileServiceDeleteRetentionPolicy: disableDeleteRetentionPolicy, AllowBlobPublicAccess: allowBlobPublicAccess, AllowSharedKeyAccess: allowSharedKeyAccess, + AllowCrossTenantReplication: allowCrossTenantReplication, PublicNetworkAccess: publicNetworkAccess, VNetResourceGroup: vnetResourceGroup, VNetName: vnetName,