From 5876d0be047a3be5b5311a6d0ce1ed6467a8d502 Mon Sep 17 00:00:00 2001 From: delvh Date: Mon, 21 Aug 2023 16:19:30 +0200 Subject: [PATCH] Use correct minio error Previously, `err` was defined above, checked for `== nil` and used nowhere else, so the result of `convertMinioErr` would always be `nil`. That is not intentional, it should convert the error of the most recent operation, not a predecessor. --- modules/storage/minio.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/storage/minio.go b/modules/storage/minio.go index f50f341022c61..3246993bb1ced 100644 --- a/modules/storage/minio.go +++ b/modules/storage/minio.go @@ -91,8 +91,8 @@ func NewMinioStorage(ctx context.Context, cfg *setting.Storage) (ObjectStorage, } // Check to see if we already own this bucket - exists, errBucketExists := minioClient.BucketExists(ctx, config.Bucket) - if errBucketExists != nil { + exists, err := minioClient.BucketExists(ctx, config.Bucket) + if err != nil { return nil, convertMinioErr(err) }