Skip to content

Commit 61321c6

Browse files
committed
Adapt to using HNS account instead when using BlobFS
1 parent 4739d3a commit 61321c6

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

cmd/zc_traverser_blob.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,9 @@ func (t *blobTraverser) Traverse(preprocessor objectMorpher, processor objectPro
256256
if !t.includeDeleted && (isBlob || err != nil) {
257257
return err
258258
}
259-
} else if blobURLParts.BlobName == "" && t.preservePermissions.IsTruthy() {
260-
// if the root is a container and we're copying "folders", we should persist the ACLs there too.
259+
} else if blobURLParts.BlobName == "" && (t.preservePermissions.IsTruthy() || t.isDFS) {
260+
// If the root is a container and we're copying "folders", we should persist the ACLs there too.
261+
// For DFS, we should always include the container root.
261262
if azcopyScanningLogger != nil {
262263
azcopyScanningLogger.Log(common.LogDebug, "Detected the root as a container.")
263264
}
@@ -560,8 +561,8 @@ func newBlobTraverser(rawURL string, serviceClient *service.Client, ctx context.
560561
includeDeleted: includeDeleted,
561562
includeSnapshot: includeSnapshot,
562563
includeVersion: includeVersion,
563-
preservePermissions: preservePermissions,
564-
isDFS: isDFS,
564+
preservePermissions: preservePermissions,
565+
isDFS: isDFS,
565566
}
566567

567568
disableHierarchicalScanning := strings.ToLower(glcm.GetEnvironmentVariable(common.EEnvironmentVariable.DisableHierarchicalScanning()))

e2etest/declarativeRunner.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,20 @@ func RunScenarios(
167167
subtestName += "-" + scenarioSuffix
168168
}
169169

170+
usedSrc, usedDst := srcAccountType, destAccountType
170171
if fromTo.From() == common.ELocation.BlobFS() {
171172
// switch to an account made for dfs
172-
srcAccountType = EAccountType.HierarchicalNamespaceEnabled()
173+
usedSrc = EAccountType.HierarchicalNamespaceEnabled()
173174
}
174175

175176
if fromTo.To() == common.ELocation.BlobFS() {
176177
// switch to an account made for dfs
177-
destAccountType = EAccountType.HierarchicalNamespaceEnabled()
178+
usedDst = EAccountType.HierarchicalNamespaceEnabled()
178179
}
179180

180181
s := scenario{
181-
srcAccountType: srcAccountType,
182-
destAccountType: destAccountType,
182+
srcAccountType: usedSrc,
183+
destAccountType: usedDst,
183184
subtestName: subtestName,
184185
compactScenarioName: compactScenarioName,
185186
fullScenarioName: fullScenarioName,

e2etest/zt_basic_copy_sync_remove_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939

4040
// ================================ Copy And Sync: Upload, Download, and S2S =========================================
4141
func TestBasic_CopyUploadSingleBlob(t *testing.T) {
42-
RunScenarios(t, eOperation.CopyAndSync(), eTestFromTo.AllUploads(), eValidate.AutoPlusContent(), anonymousAuthOnly, allCredentialTypes, params{
42+
RunScenarios(t, eOperation.Copy(), eTestFromTo.Other(common.EFromTo.LocalBlobFS()), eValidate.AutoPlusContent(), anonymousAuthOnly, anonymousAuthOnly, params{
4343
recursive: true,
4444
}, nil, testFiles{
4545
defaultSize: "1K",
@@ -136,7 +136,7 @@ func TestBasic_CopyUploadLargeAppendBlobBlockSizeFlag(t *testing.T) {
136136
}
137137

138138
func TestBasic_CopyDownloadSingleBlob(t *testing.T) {
139-
RunScenarios(t, eOperation.CopyAndSync(), eTestFromTo.AllDownloads(), eValidate.Auto(), allCredentialTypes, anonymousAuthOnly, params{
139+
RunScenarios(t, eOperation.CopyAndSync(), eTestFromTo.AllDownloads(), eValidate.Auto(), anonymousAuthOnly, anonymousAuthOnly, params{
140140
recursive: true,
141141
}, nil, testFiles{
142142
defaultSize: "1K",

0 commit comments

Comments
 (0)