Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions providers/gcs/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ type Config struct {
// Overrides the default gcs storage client behavior if this value is greater than 0.
// Set this to 1 to disable retries.
MaxRetries int `yaml:"max_retries"`

// CustomEndpoint allows overriding the default Google Cloud Storage API endpoint.
// This is useful for connecting to GCS-compatible services or GCP regional endpoints.
// See https://cloud.google.com/storage/docs/regional-endpoints for details.
CustomEndpoint string `yaml:"custom_endpoint"`
}

// Bucket implements the store.Bucket and shipper.Bucket interfaces against GCS.
Expand Down Expand Up @@ -109,6 +114,9 @@ func NewBucketWithConfig(ctx context.Context, logger log.Logger, gc Config, comp
if gc.noAuth {
opts = append(opts, option.WithoutAuthentication())
}
if gc.CustomEndpoint != "" {
opts = append(opts, option.WithEndpoint(gc.CustomEndpoint))
}
opts = append(opts,
option.WithUserAgent(fmt.Sprintf("thanos-%s/%s (%s)", component, version.Version, runtime.Version())),
)
Expand Down
Loading