driver/minio: upgrade go-minio to v7 #172

Merged
lunny merged 5 commits from dolmen/goftp.server.fork:minio-upgrade-to-v7 into v2 2025-09-10 04:51:58 +00:00
Contributor

Add a context.Context to server.Session.

Upgrade go-minio to v7 and use the session context as the parent context for all minio operations.

As a consequence of the upgrade, the minimum Go version is upgraded to 1.23 as this is the version required by go-minio/v7. Testify is also upgraded for the same reason.

Closes #171.

Cc: @ncw @lunny for review

Add a `context.Context` to `server.Session`. Upgrade go-minio to v7 and use the session context as the parent context for all minio operations. As a consequence of the upgrade, the minimum Go version is upgraded to 1.23 as this is the version required by go-minio/v7. Testify is also upgraded for the same reason. Closes #171. Cc: @ncw @lunny for review
dolmen added 1 commit 2025-06-13 06:04:47 +00:00
Upgrade go-minio to v7; minimum Go version to 1.23
Some checks failed
checks / check and test (pull_request) Failing after 15s
0d7b11d073
Add a context.Context to server.Session.

Upgrade go-minio to v7 and use the session context as the parent context for
all minio operations.

As a consequence of the upgrade, to minimum Go version is upgraded to
1.23 as this is the version required by go-minio/v7.
Testify is also upgraded for the same reason.
lunny reviewed 2025-06-13 06:17:41 +00:00
@@ -123,3 +136,3 @@
p := buildMinioPath(path)
objInfo, err := driver.client.StatObject(driver.bucket, p, minio.StatObjectOptions{})
objInfo, err := driver.client.StatObject(ctxx, driver.bucket, p, minio.StatObjectOptions{})
Owner

typo?

typo?
Author
Contributor

I don't see a typo here.

ctx is the usual variable name for context.Context. But here ctx is already used for *server.Context. So I choose another name, ctxx.

I'm open to suggestion for a better name.

I don't see a typo here. `ctx` is the usual variable name for `context.Context`. But here `ctx` is already used for `*server.Context`. So I choose another name, `ctxx`. I'm open to suggestion for a better name.
Author
Contributor

@lunny What do you think?

@lunny What do you think?
lunny marked this conversation as resolved
lunny approved these changes 2025-06-18 19:34:04 +00:00
Owner

CI failure is related. image.png

CI failure is related. <img width="816" alt="image.png" src="attachments/beed4988-6e6a-4bb6-8502-a3a26e1b4ba8">
Author
Contributor

@lunny We have to upgrade the Go version in CI. See #173.

@lunny We have to upgrade the Go version in CI. See #173.
lunny added 1 commit 2025-08-24 04:46:53 +00:00
Merge branch 'v2' into dolmen-minio-upgrade-to-v7
All checks were successful
checks / check and test (pull_request) Successful in 1m25s
7f23df6d51
lunny reviewed 2025-08-24 04:48:35 +00:00
session.go Outdated
@@ -162,6 +165,7 @@ func (sess *Session) Serve() {
// Close will manually close this connection, even if the client isn't ready.
func (sess *Session) Close() {
sess.ctxCancel()
Owner
if sess.ctxCancel {
    sess.ctx.Cancel()
}
```go if sess.ctxCancel { sess.ctx.Cancel() } ```
lunny marked this conversation as resolved
lunny reviewed 2025-08-24 04:49:10 +00:00
@@ -274,2 +316,3 @@
uploadInfo, err := driver.client.PutObject(ctxx, driver.bucket, tempFile, data, -1, minio.PutObjectOptions{ContentType: "application/octet-stream"})
if err != nil {
return size, err
return uploadInfo.Size, err
Owner

uploadInfo.Size maybe nil

uploadInfo.Size maybe nil
lunny marked this conversation as resolved
lunny reviewed 2025-08-24 04:49:24 +00:00
@@ -254,2 +296,3 @@
if offset == -1 {
return driver.client.PutObject(driver.bucket, p, data, -1, minio.PutObjectOptions{ContentType: "application/octet-stream"})
uploadInfo, err := driver.client.PutObject(ctxx, driver.bucket, p, data, -1, minio.PutObjectOptions{ContentType: "application/octet-stream"})
return uploadInfo.Size, err
Owner

uploadInfo maybe nil

uploadInfo maybe nil
lunny marked this conversation as resolved
lunny added 2 commits 2025-09-10 03:56:59 +00:00
fix bug
Some checks failed
checks / check and test (pull_request) Failing after 1m48s
f1a6b461a0
lunny added 1 commit 2025-09-10 04:03:14 +00:00
fix lint
All checks were successful
checks / check and test (pull_request) Successful in 1m1s
cdcfe200e1
lunny merged commit 1a9219924a into v2 2025-09-10 04:51:58 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: goftp/server#172