Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gcs): Support setting endpoint for Google Cloud Storage (GCS) in Thanos #161

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
7 changes: 6 additions & 1 deletion providers/gcs/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ type Config struct {
// MaxRetries controls the number of retries for idempotent operations.
// 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"`
MaxRetries int `yaml:"max_retries"`
Endpoint string `yaml:"endpoint"`
}

// Bucket implements the store.Bucket and shipper.Bucket interfaces against GCS.
Expand Down Expand Up @@ -121,6 +122,10 @@ func NewBucketWithConfig(ctx context.Context, logger log.Logger, gc Config, comp
}
}

if gc.Endpoint != "" {
opts = append(opts, option.WithEndpoint(gc.Endpoint))
}

return newBucket(ctx, logger, gc, opts)
}

Expand Down
Loading