driver/minio: upgrade go-minio to v7 #172
Reference in New Issue
Block a user
Delete Branch "dolmen/goftp.server.fork:minio-upgrade-to-v7"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add a
context.Contexttoserver.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
@@ -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{})typo?
I don't see a typo here.
ctxis the usual variable name forcontext.Context. But herectxis already used for*server.Context. So I choose another name,ctxx.I'm open to suggestion for a better name.
@lunny What do you think?
CI failure is related.
@lunny We have to upgrade the Go version in CI. See #173.
@@ -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()@@ -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, errreturn uploadInfo.Size, erruploadInfo.Size maybe nil
@@ -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, erruploadInfo maybe nil