Skip to content

Commit

Permalink
Support listing blobs recursively in azure-blob scaler
Browse files Browse the repository at this point in the history
Closes #1789

Signed-off-by: Ahmed ElSayed <[email protected]>
  • Loading branch information
ahmelsayed committed Aug 16, 2021
1 parent b27de0c commit 878dd4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

### Improvements

- TODO ([#XXX](https://github.com/kedacore/keda/pull/XXX))
- Support listing blobs recursively in azure-blob scaler ([#1789](https://github.com/kedacore/keda/issues/1789))

### Breaking Changes

Expand Down
10 changes: 6 additions & 4 deletions pkg/scalers/azure_blob_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"net/http"
"strconv"
"strings"

"github.com/kedacore/keda/v2/pkg/scalers/azure"

Expand Down Expand Up @@ -81,12 +82,13 @@ func parseAzureBlobMetadata(config *ScalerConfig) (*azureBlobMetadata, kedav1alp
return nil, "", fmt.Errorf("no blobContainerName given")
}

if val, ok := config.TriggerMetadata["blobDelimiter"]; ok && val != "" {
meta.blobDelimiter = val
}
meta.blobDelimiter = config.TriggerMetadata["blobDelimiter"]

if val, ok := config.TriggerMetadata["blobPrefix"]; ok && val != "" {
meta.blobPrefix = val + meta.blobDelimiter
meta.blobPrefix = val
if !strings.HasSuffix(meta.blobPrefix, defaultBlobDelimiter) {
meta.blobPrefix += defaultBlobPrefix
}
}

endpointSuffix, err := azure.ParseAzureStorageEndpointSuffix(config.TriggerMetadata, azure.BlobEndpoint)
Expand Down

0 comments on commit 878dd4e

Please sign in to comment.