Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Fix azure stow storage prefix (#123)
Browse files Browse the repository at this point in the history
Signed-off-by: sgref <sgref@blackshark.ai>

Co-authored-by: sgref <sgref@blackshark.ai>
  • Loading branch information
Antaxify and sgref committed Apr 3, 2022
1 parent 2937b8e commit ab8627f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion storage/stow_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var fQNFn = map[string]func(string) DataReference{
return DataReference(fmt.Sprintf("sw://%s", bucket))
},
azure.Kind: func(bucket string) DataReference {
return DataReference(fmt.Sprintf("afs://%s", bucket))
return DataReference(fmt.Sprintf("abfs://%s", bucket))
},
local.Kind: func(bucket string) DataReference {
return DataReference(fmt.Sprintf("file://%s", bucket))
Expand Down
13 changes: 13 additions & 0 deletions storage/stow_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ import (
"github.com/aws/aws-sdk-go/aws/awserr"
s32 "github.com/aws/aws-sdk-go/service/s3"

"github.com/flyteorg/stow/azure"
"github.com/flyteorg/stow/google"
"github.com/flyteorg/stow/local"
"github.com/flyteorg/stow/oracle"
"github.com/flyteorg/stow/s3"
"github.com/flyteorg/stow/swift"
"github.com/pkg/errors"

"github.com/flyteorg/stow"
Expand Down Expand Up @@ -648,3 +652,12 @@ func TestStowStore_WriteRaw(t *testing.T) {
assert.EqualError(t, err, "Failed to write data [0b] to path [path].: foo")
})
}

func TestStowStore_fQNFn(t *testing.T) {
assert.Equal(t, DataReference("s3://bucket"), fQNFn[s3.Kind]("bucket"))
assert.Equal(t, DataReference("gs://bucket"), fQNFn[google.Kind]("bucket"))
assert.Equal(t, DataReference("os://bucket"), fQNFn[oracle.Kind]("bucket"))
assert.Equal(t, DataReference("sw://bucket"), fQNFn[swift.Kind]("bucket"))
assert.Equal(t, DataReference("abfs://bucket"), fQNFn[azure.Kind]("bucket"))
assert.Equal(t, DataReference("file://bucket"), fQNFn[local.Kind]("bucket"))
}

0 comments on commit ab8627f

Please sign in to comment.