Skip to content

Commit

Permalink
FORK: allow bucket root query strings in minio
Browse files Browse the repository at this point in the history
Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>
  • Loading branch information
thesuperzapper committed Apr 14, 2024
1 parent 3d95f8d commit 8c00970
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backend/src/v2/objectstore/object_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ func OpenBucket(ctx context.Context, k8sClient kubernetes.Interface, namespace s
}
}()
if config.Scheme == "minio://" {
// if a query string is set, change schema to `s3://` and open the bucket directly
// they are probably using: https://gocloud.dev/howto/blob/#s3-compatible
if len(config.QueryString) > 0 {
bucketURL := config.bucketURL()
bucketURL = strings.Replace(bucketURL, "minio://", "s3://", 1)
return blob.OpenBucket(ctx, bucketURL)
}

cred, err := getMinioCredential(ctx, k8sClient, namespace)
if err != nil {
return nil, fmt.Errorf("Failed to get minio credential: %w", err)
Expand Down

0 comments on commit 8c00970

Please sign in to comment.