Skip to content

fix: migrate to madmin-go/v4 for MinIO admin API v4 support - #1074

Draft
aminueza wants to merge 5 commits into
mainfrom
fix/1071-migrate-madmin-go-v4
Draft

fix: migrate to madmin-go/v4 for MinIO admin API v4 support#1074
aminueza wants to merge 5 commits into
mainfrom
fix/1071-migrate-madmin-go-v4

Conversation

@aminueza

Copy link
Copy Markdown
Owner

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

Amanda Souza 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.
@aminueza
aminueza requested a review from felladrin as a code owner July 23, 2026 18:07
@github-actions github-actions Bot added the bug Something isn't working label Jul 23, 2026
Amanda Souza 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
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Admin API v4 not supported

1 participant