Skip to content

Upgrade minio-go from v6 to v7 - #389

Merged
folbricht merged 1 commit into
masterfrom
upgrade-minio-v7
Aug 29, 2026
Merged

folbricht merged 1 commit into
masterfrom
upgrade-minio-v7

Conversation

@folbricht

Copy link
Copy Markdown
Owner

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.NewWithOptions is now minio.New
  • GetObject, PutObject, StatObject and RemoveObject take a context.Context
  • ListObjectsV2 with a done channel is now ListObjects with a ListObjectsOptions, cancelled through its context
  • credentials.Provider gained RetrieveWithCredContext, which StaticCredentialsProvider and RefreshableSharedCredentialsProvider 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 was doing internally anyway, so behaviour is unchanged. Prune already receives a context and now uses it to bound the listing as well as the loop. Worth noting separately: S3 stores still ignore the timeout store 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/compress 1.16.4→1.19.2, logrus 1.9.1→1.9.4, cobra 1.7.0→1.10.2, pflag 1.0.5→1.0.10, x/crypto, x/sys, x/term. All are required by minio-go/v7@v7.3.0 itself (go mod graph confirms), not incidental to go 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:

  • make and extract round-trip a 20MB blob, output compared byte-for-byte
  • info reports all 304 chunks present in the store
  • an index stored in S3 (s3+http://…/bucket/indexes/blob.caibx) is written and read back, and extract works straight from it
  • prune drops the right chunks (377 → 73) and the remaining blob still extracts; the index object in the same bucket is untouched
  • a prefixed store (…/bucket/prefixed) round-trips

go test ./..., go test -race ./..., go vet and gofmt all clean.

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.
@folbricht
folbricht merged commit 627a467 into master Aug 29, 2026
4 checks passed
@folbricht
folbricht deleted the upgrade-minio-v7 branch August 29, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ 换网址