fix(minio): add SkipConnectionValidation option for restricted environments#59
Open
fix(minio): add SkipConnectionValidation option for restricted environments#59
Conversation
4thel00z
reviewed
Feb 24, 2026
| if m.cfg.Connection.ValidationBucket != "" { | ||
| _, err = newClient.BucketExists(ctxReconnect, m.cfg.Connection.ValidationBucket) | ||
| } else { | ||
| _, err = newClient.ListBuckets(ctxReconnect) |
There was a problem hiding this comment.
why do we do this at all in reconnect loop?
Contributor
Author
There was a problem hiding this comment.
Good call. Removed it entirely. The updated PR drops validateConnection and all ListBuckets calls from startup, health monitoring, and reconnection. Connection issues are surfaced by the operations themselves.
5d62e98 to
41560a3
Compare
41560a3 to
d72831b
Compare
d72831b to
f6608f2
Compare
abolfazl-alemi-aa
approved these changes
Feb 25, 2026
alphamt
reviewed
Feb 25, 2026
v1/minio/setup.go
Outdated
| continue reconnectLoop | ||
| } | ||
| } else { | ||
| cancel() |
Collaborator
There was a problem hiding this comment.
what is this purpose of the cancel?
Contributor
Author
There was a problem hiding this comment.
Good catch. The cancel() was there to avoid leaking the ctxReconnect context created at the top of the block. Moved the context creation inside the validation branch so it only exists when actually needed. The else { cancel() } is gone now.
…nments Add SkipConnectionValidation bool to ConnectionConfig. When true, the client skips the ListBuckets calls used for connection validation on startup, periodic health checks, and reconnection. This allows the client to work in environments where s3:ListAllMyBuckets is not granted. Defaults to false, preserving existing behavior. Fixes: SPHER-3435
f6608f2 to
f7e238a
Compare
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.
Summary
SkipConnectionValidationbool toConnectionConfig(defaults tofalse)true, skips theListBucketscalls in startup validation, health monitoring, and reconnectionContext
BA migrated a Pharia environment from v1 to v2. The
stdminio client callsListBuckets(requiress3:ListAllMyBuckets) for connection validation, which fails in their restricted environment.What changed
When
SkipConnectionValidation = true:NewClientskips startup validationmonitorConnectionhealth checks become no-opsretryConnectionskips validation before swapping client pointersWhen
SkipConnectionValidation = false(default): no behavior change.Test plan
go build ./v1/minio/...passesgo vetpasses (pre-existing warnings in integration test only)SkipConnectionValidation: trueFixes: SPHER-3435