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

Add lookup type override #347

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,17 @@ func getClient(ctx *cli.Context, host string) (*minio.Client, error) {
default:
fatal(probe.NewError(errors.New("unknown signature method. S3V2 and S3V4 is available")), strings.ToUpper(ctx.String("signature")))
}

lookup := minio.BucketLookupAuto
if ctx.String("lookup") == "host" {
lookup = minio.BucketLookupDNS
} else if ctx.String("lookup") == "path" {
lookup = minio.BucketLookupPath
}
cl, err := minio.New(host, &minio.Options{
Creds: creds,
Secure: ctx.Bool("tls"),
Region: ctx.String("region"),
BucketLookup: minio.BucketLookupAuto,
BucketLookup: lookup,
CustomMD5: md5simd.NewServer().NewHash,
Transport: clientTransport(ctx),
})
Expand Down
4 changes: 4 additions & 0 deletions cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ var ioFlags = []cli.Flag{
Value: 0,
Usage: "Rate limit each instance to this number of requests per second (0 to disable)",
},
cli.StringFlag{
Name: "lookup",
Usage: "Force requests to be 'host' for host-style or 'path' for path-style lookup. Default will attempt autodetect based on remote host name.",
},
}

func getCommon(ctx *cli.Context, src func() generator.Source) bench.Common {
Expand Down
Loading