diff --git a/modules/setting/storage.go b/modules/setting/storage.go index d3d1fb9f30b..2ddafd7c5bf 100644 --- a/modules/setting/storage.go +++ b/modules/setting/storage.go @@ -52,6 +52,7 @@ type MinioStorageConfig struct { ChecksumAlgorithm string `ini:"MINIO_CHECKSUM_ALGORITHM" json:",omitempty"` ServeDirect bool `ini:"SERVE_DIRECT"` BucketLookUpType string `ini:"MINIO_BUCKET_LOOKUP_TYPE" json:",omitempty"` + SkipVersionCheck bool `ini:"SKIP_VERSION_CHECK" json:",omitempty"` } func (cfg *MinioStorageConfig) ToShadow() { diff --git a/modules/storage/minio.go b/modules/storage/minio.go index 6b92be61fb7..b0266549317 100644 --- a/modules/storage/minio.go +++ b/modules/storage/minio.go @@ -112,7 +112,9 @@ func NewMinioStorage(ctx context.Context, cfg *setting.Storage) (ObjectStorage, // Otherwise even if the request itself fails (403, 404, etc), the code should still continue because the parameters seem "good" enough. // Keep in mind that GetBucketVersioning requires "owner" to really succeed, so it can't be used to check the existence. // Not using "BucketExists (HeadBucket)" because it doesn't include detailed failure reasons. - err = getBucketVersioning(ctx, minioClient, config.Bucket) + if !config.SkipVersionCheck { + err = getBucketVersioning(ctx, minioClient, config.Bucket) + } if err != nil { errResp, ok := err.(minio.ErrorResponse) if !ok {