fix: migrate to madmin-go/v4 for MinIO admin API v4 support - #1074
Draft
aminueza wants to merge 5 commits into
Draft
fix: migrate to madmin-go/v4 for MinIO admin API v4 support#1074aminueza wants to merge 5 commits into
aminueza wants to merge 5 commits into
Conversation
added 2 commits
July 23, 2026 14:55
Recent MinIO servers reject admin API v3 requests, breaking every
admin-backed resource. madmin-go/v4 speaks v4 and transparently retries
with v3 when a server replies 426 Upgrade Required, so older MinIO
deployments keep working; MADMIN_API_VERSION=v3 remains as an escape
hatch.
API adjustments: InfoCannedPolicyV2 -> InfoCannedPolicy,
Service{Restart,Stop,Freeze,Unfreeze}V2 -> unsuffixed variants,
BucketQuota.Quota -> Size, custom transport via madmin.Options.
Fixes #1071
Prove that the madmin-go/v4 client works against both v4 servers and v3-only servers: a stub answering 426 Upgrade Required on /v4 paths must receive the automatic /v3 retry and succeed. Guards the compatibility promise made in the #1071 migration.
added 2 commits
July 23, 2026 15:12
The pinned MinIO image only speaks admin API v3. With madmin-go/v4 the client starts at v4, so every admin call pays a 426 Upgrade Required round trip plus an exponential-backoff sleep before retrying with v3. Across the acceptance suite that overhead pushed the run past go test's default 10m timeout, aborting with a goroutine dump. Set MADMIN_API_VERSION=v3 for the compose test service (overridable: the test-latest-minio workflow sets v4, since the latest server speaks v4), and raise the go test timeout to 30m so future slowness fails as tests, not as a timeout panic.
aminueza
marked this pull request as draft
July 23, 2026 18:51
The CI compose fixture now pins MADMIN_API_VERSION=v3, and madmin reads that at package init, so the client no longer always starts at v4. Derive the stub expectations from madmin.AdminAPIVersion: the direct case speaks whichever version is active, and the 426-fallback case skips when the client already starts at v3 (it still runs in the test-latest-minio job and in local runs, where the version is v4).
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.
Recent MinIO servers reject admin API v3 requests with 'Server expects client requests with admin API version v4', breaking every admin-backed resource — reported in #1071 for minio_iam_service_account.
Migrates madmin-go v3 -> v4 (v4.10.1). The v4 client speaks admin API v4 and transparently retries with v3 when a server replies 426 Upgrade Required, so older MinIO deployments keep working unchanged. MADMIN_API_VERSION=v3 remains as an escape hatch.
API adjustments: InfoCannedPolicyV2 -> InfoCannedPolicy, Service{Restart,Stop,Freeze,Unfreeze}V2 -> unsuffixed, BucketQuota.Quota -> Size, custom transport via madmin.Options.
Testing: new regression test TestMadminAdminAPIVersionCompatibility proves both paths against a stub admin API (v4 direct + 426 fallback to v3, asserting the exact request sequence). The acceptance suite runs against the pinned RELEASE.2025-09-07 image, which only speaks v3 — CI exercises the fallback end-to-end.
Suggested release: v3.39.0 (minor — no schema/state/HCL changes).
Fixes #1071