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 8f524b6
Showing 1 changed file with 6 additions and 4 deletions.
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 8f524b6

Please sign in to comment.