3
0

Fix support for min.io with Google Cloud Storage (#152)

Adds MINIO_BUCKET_SEP options to control the separator string
This commit is contained in:
Alex Astrum
2021-03-28 03:11:06 -04:00
committed by Denis Arh
parent a2b2d9c61c
commit f9501893af
4 changed files with 12 additions and 5 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ func Initialize(ctx context.Context, log *zap.Logger, s store.Storer, c Config)
if c.Storage.MinioEndpoint != "" {
var bucket = svcPath
if c.Storage.MinioBucket != "" {
bucket = c.Storage.MinioBucket + "/" + svcPath
bucket = c.Storage.MinioBucket + c.Storage.MinioBucketSep + svcPath
}
DefaultObjectStore, err = minio.New(bucket, minio.Options{
+5 -3
View File
@@ -17,6 +17,7 @@ type (
MinioSecretKey string `env:"MINIO_SECRET_KEY"`
MinioSSECKey string `env:"MINIO_SSEC_KEY"`
MinioBucket string `env:"MINIO_BUCKET"`
MinioBucketSep string `env:"MINIO_BUCKET_SEP"`
MinioStrict bool `env:"MINIO_STRICT"`
}
)
@@ -24,9 +25,10 @@ type (
// ObjectStore initializes and returns a ObjectStoreOpt with default values
func ObjectStore() (o *ObjectStoreOpt) {
o = &ObjectStoreOpt{
Path: "var/store",
MinioSecure: true,
MinioStrict: false,
Path: "var/store",
MinioSecure: true,
MinioBucketSep: "/",
MinioStrict: false,
}
fill(o)
+5
View File
@@ -30,6 +30,11 @@ props:
- name: minioBucket
env: MINIO_BUCKET
- name: minioBucketSep
env: MINIO_BUCKET_SEP
default: "/"
description: Used between MINIO_BUCKET and the service name (e.g system). Ignored if MINIO_BUCKET is not set. Required in latest versions of min.io since "/" is not accepted anymore in bucket names.
- name: minioStrict
type: bool
env: MINIO_STRICT
+1 -1
View File
@@ -123,7 +123,7 @@ func Initialize(ctx context.Context, log *zap.Logger, s store.Storer, c Config)
if c.Storage.MinioEndpoint != "" {
var bucket = svcPath
if c.Storage.MinioBucket != "" {
bucket = c.Storage.MinioBucket + "/" + svcPath
bucket = c.Storage.MinioBucket + c.Storage.MinioBucketSep + svcPath
}
DefaultObjectStore, err = minio.New(bucket, minio.Options{