From 8ce11f08066cd37c11b10d38e71aa225d7340599 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Sat, 20 Aug 2022 09:58:36 +0530 Subject: [PATCH] MM-46475: Disable sending content sha in bifrost mode (#20853) PR https://github.com/minio/minio-go/pull/1668 introduced an option to disable sha256, which by default was disabled. This meant all content was always hashed and this broke in bifrost because the key signing fails in streaming mode. So for cloud installations, we disable sha256. https://mattermost.atlassian.net/browse/MM-46475 ```release-note NONE ``` --- shared/filestore/s3store.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shared/filestore/s3store.go b/shared/filestore/s3store.go index 1cdaddd812..ff6fcd246f 100644 --- a/shared/filestore/s3store.go +++ b/shared/filestore/s3store.go @@ -368,6 +368,9 @@ func (b *S3FileBackend) WriteFile(fr io.Reader, path string) (int64, error) { objSize := -1 isCloud := os.Getenv("MM_CLOUD_FILESTORE_BIFROST") != "" + if isCloud { + options.DisableContentSha256 = true + } // We pass an object size only in situations where bifrost is not // used. Bifrost needs to run in HTTPS, which is not yet deployed. if buf, ok := fr.(*bytes.Buffer); ok && !isCloud { @@ -404,6 +407,9 @@ func (b *S3FileBackend) AppendFile(fr io.Reader, path string) (int64, error) { defer cancel2() objSize := -1 isCloud := os.Getenv("MM_CLOUD_FILESTORE_BIFROST") != "" + if isCloud { + options.DisableContentSha256 = true + } // We pass an object size only in situations where bifrost is not // used. Bifrost needs to run in HTTPS, which is not yet deployed. if buf, ok := fr.(*bytes.Buffer); ok && !isCloud {