azureblob: fix creation of directory markers

This also fixes the integration tests which is why we didn't notice this before!
This commit is contained in:
Nick Craig-Wood 2023-09-03 18:09:31 +01:00
parent 40bcc7a90b
commit b1c0ae5e7d
2 changed files with 4 additions and 4 deletions

View File

@ -2230,8 +2230,8 @@ func (o *Object) prepareUpload(ctx context.Context, src fs.ObjectInfo, options [
return ui, fmt.Errorf("can't upload to root - need a container") return ui, fmt.Errorf("can't upload to root - need a container")
} }
// Create parent dir/bucket if not saving directory marker // Create parent dir/bucket if not saving directory marker
_, isDirMarker := o.meta[dirMetaKey] _, ui.isDirMarker = o.meta[dirMetaKey]
if !isDirMarker { if !ui.isDirMarker {
err = o.fs.mkdirParent(ctx, o.remote) err = o.fs.mkdirParent(ctx, o.remote)
if err != nil { if err != nil {
return ui, err return ui, err

View File

@ -31,9 +31,9 @@ func TestIntegration2(t *testing.T) {
if *fstest.RemoteName != "" { if *fstest.RemoteName != "" {
t.Skip("Skipping as -remote set") t.Skip("Skipping as -remote set")
} }
name := "TestAzureBlob:" name := "TestAzureBlob"
fstests.Run(t, &fstests.Opt{ fstests.Run(t, &fstests.Opt{
RemoteName: name, RemoteName: name + ":",
NilObject: (*Object)(nil), NilObject: (*Object)(nil),
TiersToTest: []string{"Hot", "Cool"}, TiersToTest: []string{"Hot", "Cool"},
ChunkedUpload: fstests.ChunkedUploadConfig{ ChunkedUpload: fstests.ChunkedUploadConfig{