Skip to content

Commit

Permalink
Merge pull request openshift#40 from flavianmissi/OCPBUGS-29003
Browse files Browse the repository at this point in the history
OCPBUGS-29003: fix azure storage path to use leading slash
  • Loading branch information
openshift-merge-bot[bot] authored Feb 15, 2024
2 parents c7be7b4 + a212fcd commit 6b2f5d2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions registry/storage/driver/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,7 @@ func (d *driver) listBlobs(ctx context.Context, virtPath string) ([]string, erro
// This is to cover for the cases when the rootDirectory of the driver is either "" or "/".
// In those cases, there is no root prefix to replace and we must actually add a "/" to all
// results in order to keep them as valid paths as recognized by storagedriver.PathRegexp
prefix := ""
if blobPrefix == "" {
prefix = "/"
}
prefix := "/"

out := []string{}

Expand Down Expand Up @@ -446,7 +443,9 @@ func (d *driver) blobName(path string) string {
return path
}

return strings.TrimLeft(strings.TrimRight(d.rootDirectory, "/")+path, "/")
trimmedRoot := strings.TrimRight(d.rootDirectory, "/")
trimmedPath := strings.TrimLeft(path, "/")
return trimmedRoot + "/" + trimmedPath
}

func is404(err error) bool {
Expand Down

0 comments on commit 6b2f5d2

Please sign in to comment.