Skip to content

feat: add S3 path-style addressing support#18

Open
AnatolyRugalev wants to merge 1 commit intorichardartoul:mainfrom
AnatolyRugalev:s3-use-path-style
Open

feat: add S3 path-style addressing support#18
AnatolyRugalev wants to merge 1 commit intorichardartoul:mainfrom
AnatolyRugalev:s3-use-path-style

Conversation

@AnatolyRugalev
Copy link
Copy Markdown

Summary

  • Add UsePathStyle option to S3Config struct
  • Controllable via GOBUILDCACHE_AWS_S3_USE_PATH_STYLE=true env var (or AWS_S3_USE_PATH_STYLE)
  • When enabled, uses path-style S3 requests (endpoint:port/bucket) instead of virtual-hosted-style (bucket.endpoint:port)

Motivation

S3-compatible backends like LocalStack and MinIO require path-style addressing. Without this option, gobuildcache fails with 500/403 errors when using a custom AWS_ENDPOINT_URL because the SDK tries to resolve bucket-name.endpoint:port which these backends can't handle.

Fixes #17

Test plan

  • go build ./... passes
  • Tested manually with LocalStack (path-style works, cache hits confirmed)

🤖 Generated with Claude Code

Add UsePathStyle option to S3Config, controllable via
GOBUILDCACHE_AWS_S3_USE_PATH_STYLE env var (or AWS_S3_USE_PATH_STYLE).

When enabled, the S3 client uses path-style requests
(endpoint:port/bucket) instead of virtual-hosted-style
(bucket.endpoint:port). This is required for S3-compatible backends
like LocalStack and MinIO.

Fixes richardartoul#17

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

S3 backend: add UsePathStyle option for S3-compatible endpoints (LocalStack, MinIO)

1 participant