From afb6035729e0f1fd083bbe274369d82af97756b4 Mon Sep 17 00:00:00 2001 From: Boris Date: Tue, 30 Jul 2024 11:26:21 -0500 Subject: [PATCH 1/5] Update to go 1.16 --- Dockerfile | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a6c7fff..3853bae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.12.5-alpine3.9 as build +FROM golang:1.16-alpine as build # git is not included, weirdly, so nothing with ext deps can build RUN apk add git diff --git a/go.mod b/go.mod index 6d6449e..001c922 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kbase/blobstore -go 1.12 +go 1.16 require ( github.com/aws/aws-sdk-go v1.19.21 From 1fd4d89b24e49ad256f5f9a24e788c5a17a598e4 Mon Sep 17 00:00:00 2001 From: bio-boris Date: Tue, 30 Jul 2024 13:48:00 -0500 Subject: [PATCH 2/5] Update Dockerfile Co-authored-by: MrCreosote --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3853bae..336be9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.16-alpine as build +FROM golang:1.16.15-alpine3.15 as build # git is not included, weirdly, so nothing with ext deps can build RUN apk add git From 0bc38e0e960c3bc91263c88eac59f9bc123b78db Mon Sep 17 00:00:00 2001 From: bio-boris Date: Tue, 30 Jul 2024 15:02:06 -0500 Subject: [PATCH 3/5] Update RELEASE_NOTES.md --- RELEASE_NOTES.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 38306c3..0e985e0 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,9 @@ +# 0.1.5 + +* Upgraded from go 1.12 to 1.16 +* Changed build base image from FROM `golang:1.12.5-alpine3.9` to `golang:1.16.15-alpine3.15` + + # 0.1.4 * Added the `del` param when downloading the file from a node. From ccddc6f43dceda1cb03a50ee7c255fe347660ec8 Mon Sep 17 00:00:00 2001 From: Gavin Date: Fri, 2 Aug 2024 14:06:50 -0700 Subject: [PATCH 4/5] Bump go in GHA, fix tests and bump versino --- .github/workflows/test.yml | 4 ++-- README.md | 2 +- RELEASE_NOTES.md | 2 +- app/blobstore.go | 2 +- config/config_test.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb8d8b3..afb0617 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,11 +24,11 @@ jobs: fail-fast: false matrix: include: - - go: '1.12' + - go: '1.16' mongo: 'mongodb-linux-x86_64-3.6.12' minio: '2019-05-23T00-29-34Z' wired_tiger: 'false' - - go: '1.12' + - go: '1.16' mongo: 'mongodb-linux-x86_64-ubuntu2204-7.0.4' minio: '2019-05-23T00-29-34Z' wired_tiger: 'true' diff --git a/README.md b/README.md index a0bf3fc..f8974bb 100644 --- a/README.md +++ b/README.md @@ -369,7 +369,7 @@ curl -H "Authorization: OAuth $KBASE_TOKEN" -F "copy_data=" http:// Date: Fri, 2 Aug 2024 16:19:31 -0700 Subject: [PATCH 5/5] Exhaust response body on file store --- RELEASE_NOTES.md | 2 ++ filestore/s3.go | 1 + 2 files changed, 3 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index c1c0742..613eaf8 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,7 @@ # 0.1.5 +* Fixed a bug where the response input stream from S3 may not be fully exhausted when + storing a file. * Upgraded from go 1.12 to 1.16, which is now required * Changed build base image from FROM `golang:1.12.5-alpine3.9` to `golang:1.16.15-alpine3.15` diff --git a/filestore/s3.go b/filestore/s3.go index 4cad268..cb819e8 100644 --- a/filestore/s3.go +++ b/filestore/s3.go @@ -151,6 +151,7 @@ func (fs *S3FileStore) StoreFile(le *logrus.Entry, p *StoreFileParams) (out *Fil return nil, errors.New("s3 store request: " + errstr) } defer resp.Body.Close() + defer io.Copy(io.Discard, resp.Body) if resp.StatusCode > 399 { // don't worry about 100s, shouldn't happen buffer := make([]byte, 1000) n, err := resp.Body.Read(buffer)