Repository navigation
Upgrade minio-go from v6 to v7 - #389
Merged
Merged
Conversation
minio-go v6 has been end of life for years. v7 moves every object
operation onto a context and renames a few things, so the store code
changes with it:
- minio.NewWithOptions is now minio.New
- GetObject, PutObject, StatObject and RemoveObject take a context
- ListObjectsV2 with a done channel is now ListObjects with a
ListObjectsOptions, cancelled through its context
- credentials.Provider gained RetrieveWithCredContext, which the
static and refreshable providers now implement alongside Retrieve
The store interface has no context to pass down, so the per-object calls
use context.Background(), which is what v6 did internally. Prune already
receives one and now uses it to bound the listing as well as the loop.
Dependencies pulled up by v7's own requirements: klauspost/compress,
logrus, cobra, pflag, x/crypto and x/sys.
Verified against a real MinIO server as well as the existing fake-S3
tests: make, extract, info, prune and a prefixed store all round-trip,
indexes stored in S3 are read back and survive a prune of the same
bucket.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
minio-go v6 has been end of life for years. v7 moves every object operation onto a context and renames a few things, so the S3 store code changes with it:
minio.NewWithOptionsis nowminio.NewGetObject,PutObject,StatObjectandRemoveObjecttake acontext.ContextListObjectsV2with a done channel is nowListObjectswith aListObjectsOptions, cancelled through its contextcredentials.ProvidergainedRetrieveWithCredContext, whichStaticCredentialsProviderandRefreshableSharedCredentialsProvidernow implement alongsideRetrieveThe
Storeinterface has no context to pass down, so the per-object calls usecontext.Background()— which is what v6 was doing internally anyway, so behaviour is unchanged.Prunealready receives a context and now uses it to bound the listing as well as the loop. Worth noting separately: S3 stores still ignore thetimeoutstore option, and now that the client takes a context there is a clean way to wire it up. I left that alone here to keep this a straight upgrade.Dependency bumps. v7 forces several transitive upgrades through MVS —
klauspost/compress1.16.4→1.19.2,logrus1.9.1→1.9.4,cobra1.7.0→1.10.2,pflag1.0.5→1.0.10,x/crypto,x/sys,x/term. All are required byminio-go/v7@v7.3.0itself (go mod graphconfirms), not incidental togo get.Verification. The existing S3 tests run against a fake S3 server and pass, but they can't catch changes in signing or request shape, so I also ran a real MinIO server in a container:
makeandextractround-trip a 20MB blob, output compared byte-for-byteinforeports all 304 chunks present in the stores3+http://…/bucket/indexes/blob.caibx) is written and read back, andextractworks straight from itprunedrops the right chunks (377 → 73) and the remaining blob still extracts; the index object in the same bucket is untouched…/bucket/prefixed) round-tripsgo test ./...,go test -race ./...,go vetandgofmtall clean.