storage: respect --zone when listing bucket objects - #924
Draft
natalie-o-perret wants to merge 2 commits into
Draft
natalie-o-perret wants to merge 2 commits into
natalie-o-perret wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
Description
Make
exo storage list sos://BUCKET --zone ZONEuse the explicit zone when creating the SOS client. Previously the command parsed--zone, but its initialHeadBucketrequest still used the profile's default zone.Commands without an explicit zone keep the existing bucket-region discovery behaviour.
Checklist
(For exoscale contributors)
CHANGELOG.md)Testing
I ran both binaries against the same real default account and bucket. The account's default zone is
ch-gva-2, while the selected bucket is inbg-sof-1. A local CONNECT proxy recorded only the SOS hostnames. The shell kept the bucket name private and printed only the number of returned objects.Before the fix, the command contacts the default-zone endpoint before the requested endpoint:
After the fix, the same command contacts only the requested endpoint:
For an end-to-end CLI check, I used a local fake SOS endpoint that returns 503 for
HeadBucketrequests and one object forListObjectsV2. This simulates an unavailable default-zone endpoint with the following profile:Before the fix, the command contacts the profile's default zone and fails:
After the fix, the same command contacts only the requested zone and lists the object:
The focused regression test and full local checks pass with Go 1.26.6:
make test-verbosewith the race detector,make build,go vet ./..., staticcheck, andgolangci-lint v2.12.2also pass.Note
AI assistance: PR description, test scaffolding.