Skip to content

Commit

Permalink
add paempty parameter check in function WithAzureBlobLock
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverdewBaker committed Jul 5, 2024
1 parent 44567c3 commit ec77b8e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/stash/with_azureblob.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import (
func WithAzureBlobLock(conf *config.AzureBlobConfig, timeout time.Duration, checker storage.Checker) (Wrapper, error) {
const op errors.Op = "stash.WithAzureBlobLock"

if conf.AccountKey == "" && (conf.ManagedIdentityResourceID == "" || conf.StorageResource == "") {
return nil, errors.E(op, "either account key or managed identity resource id and storage resource must be set")
}
accountURL, err := url.Parse(fmt.Sprintf("https://%s.blob.core.windows.net", conf.AccountName))
if err != nil {
return nil, errors.E(op, err)
Expand Down

0 comments on commit ec77b8e

Please sign in to comment.