diff --git a/compose/service/service.go b/compose/service/service.go index 2d3567a0c..ba418075d 100644 --- a/compose/service/service.go +++ b/compose/service/service.go @@ -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{ diff --git a/pkg/options/objectStore.gen.go b/pkg/options/objectStore.gen.go index 062d5a52e..447ae0fab 100644 --- a/pkg/options/objectStore.gen.go +++ b/pkg/options/objectStore.gen.go @@ -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) diff --git a/pkg/options/objectStore.yaml b/pkg/options/objectStore.yaml index c45126492..b8c54fa85 100644 --- a/pkg/options/objectStore.yaml +++ b/pkg/options/objectStore.yaml @@ -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 diff --git a/system/service/service.go b/system/service/service.go index 6dfc891a8..b3fa1a298 100644 --- a/system/service/service.go +++ b/system/service/service.go @@ -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{