mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 17:52:32 +00:00
VAULT-28281: Pass in accountName variable into validation function (#27563)
* pass in correct accountName variable into validation function * modify test fixture to better test validation functionality * pass in accountName variable into error message * changelog
This commit is contained in:
3
changelog/27563.txt
Normal file
3
changelog/27563.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
storage/azure: Fix invalid account name initialization bug
|
||||
```
|
||||
@@ -68,8 +68,8 @@ func NewAzureBackend(conf map[string]string, logger log.Logger) (physical.Backen
|
||||
return nil, fmt.Errorf("'accountName' must be set")
|
||||
}
|
||||
}
|
||||
if err := validateAccountName(name); err != nil {
|
||||
return nil, fmt.Errorf("invalid account name %s: %w", name, err)
|
||||
if err := validateAccountName(accountName); err != nil {
|
||||
return nil, fmt.Errorf("invalid account name %s: %w", accountName, err)
|
||||
}
|
||||
|
||||
accountKey := os.Getenv("AZURE_ACCOUNT_KEY")
|
||||
|
||||
@@ -35,7 +35,7 @@ func testFixture(t *testing.T) (*AzureBackend, func()) {
|
||||
t.Helper()
|
||||
|
||||
ts := time.Now().UnixNano()
|
||||
name := fmt.Sprintf("vlt%d", ts)
|
||||
name := fmt.Sprintf("vlt-%d", ts)
|
||||
_ = os.Setenv("AZURE_BLOB_CONTAINER", name)
|
||||
|
||||
cleanup := func() {}
|
||||
|
||||
Reference in New Issue
Block a user