ui: honor AWS_ENDPOINT in read_basebackups S3 list/get#3079
Open
SAY-5 wants to merge 1 commit intozalando:masterfrom
Open
ui: honor AWS_ENDPOINT in read_basebackups S3 list/get#3079SAY-5 wants to merge 1 commit intozalando:masterfrom
SAY-5 wants to merge 1 commit intozalando:masterfrom
Conversation
read_stored_clusters and read_versions build their S3 clients with
endpoint_url=AWS_ENDPOINT, but read_basebackups used a bare
client('s3') for both the list_objects_v2 paginator and the per-key
get_object call. On MinIO / S3-compatible backends the list+get
requests go to the default AWS endpoint, so the Backups tab renders
cluster/version prefixes (picked up by the correctly-configured
read_stored_clusters) but then returns empty base backup details
(silently no hits against the real backend) (zalando#3078).
Build s3_client once per call with endpoint_url=AWS_ENDPOINT and reuse
it for both the paginator and get_object. No behaviour change when
AWS_ENDPOINT is unset; boto3 defaults to the AWS endpoint either way.
Fixes zalando#3078
Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>
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
Fixes #3078.
read_stored_clustersandread_versionsinui/operator_ui/spiloutils.pybuild their S3 clients withendpoint_url=AWS_ENDPOINT, butread_basebackupsused a bareclient('s3')for both thelist_objects_v2paginator and the per-keyget_object. On MinIO / S3-compatible backends the list+get requests hit the default AWS endpoint, so the UI's Backups tab renders cluster/version prefixes (from the correctly-configuredread_stored_clusters) then returns empty base backup details.Fix
Build
s3_client = client('s3', endpoint_url=AWS_ENDPOINT)once per call and reuse it for both the paginator andget_object. No behaviour change whenAWS_ENDPOINTis unset — boto3 already defaults to the AWS endpoint in that case.Test plan
python3 -c "import ast; ast.parse(open('spiloutils.py').read())"syntax check.AWS_ENDPOINT=http://minio.example.com, push a base backup via Spilo, open the UI's Backups tab — base backup details now populate instead of showing an empty list.