Skip to content

gcs: add endpoint configuration option#257

Draft
rohansood10 wants to merge 1 commit intothanos-io:mainfrom
rohansood10:fix/7862-gcs-custom-endpoint
Draft

gcs: add endpoint configuration option#257
rohansood10 wants to merge 1 commit intothanos-io:mainfrom
rohansood10:fix/7862-gcs-custom-endpoint

Conversation

@rohansood10
Copy link

Problem

Thanos currently does not support configuring a custom API endpoint for Google Cloud Storage. This prevents using GCS regional endpoints or GCS-compatible storage backends.

Fixes: thanos-io/thanos#7862

Solution

Added an endpoint field to the GCS Config struct. When set, it is passed as option.WithEndpoint() when creating the GCS storage client.

Configuration example

type: GCS
config:
  bucket: my-bucket
  endpoint: https://storage.europe-west3.rep.googleapis.com

Changes

  • providers/gcs/gcs.go: Added Endpoint field to Config struct and wired it through NewBucketWithConfig via option.WithEndpoint()
  • providers/gcs/gcs_test.go: Added tests for endpoint config parsing and bucket creation with custom endpoint

Notes

  • Follows the same pattern used by the S3 provider for custom endpoints
  • When endpoint is empty (default), behavior is unchanged
  • Compatible with both HTTP and gRPC client modes

Add support for setting a custom GCS API endpoint, enabling use of
GCS regional endpoints and GCS-compatible storage backends.

This adds an 'endpoint' field to the GCS Config struct which is passed
through as option.WithEndpoint() when creating the GCS storage client.

Fixes: thanos-io/thanos#7862
Signed-off-by: rohansood10 <rohansood10@users.noreply.github.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.

Support setting endpoint for Google Cloud Storage (GCS) in Thanos

1 participant