azureblob: allow remote emulator (azurite) - fixes #6290

This commit is contained in:
Lorenzo Maiorfi 2022-07-06 12:54:04 +02:00 committed by GitHub
parent 3ec07d5db9
commit b5efffee9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View file

@ -600,7 +600,11 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
if err != nil {
return nil, fmt.Errorf("failed to parse credentials: %w", err)
}
u, err = url.Parse(emulatorBlobEndpoint)
var actualEmulatorEndpoint = emulatorBlobEndpoint
if opt.Endpoint != "" {
actualEmulatorEndpoint = opt.Endpoint
}
u, err = url.Parse(actualEmulatorEndpoint)
if err != nil {
return nil, fmt.Errorf("failed to make azure storage url from account and endpoint: %w", err)
}