diff --git a/broker/client/reader.go b/broker/client/reader.go index 72188cca..2237c837 100644 --- a/broker/client/reader.go +++ b/broker/client/reader.go @@ -176,7 +176,7 @@ func (r *Reader) Read(p []byte) (n int, err error) { // If the frame preceding EOF provided a fragment URL, open it directly. if !r.Request.MetadataOnly && r.Response.Status == pb.Status_OK && r.Response.FragmentUrl != "" { - if SkipSignedURLs > 0 { + if SkipSignedURLs { fragURL := r.Response.Fragment.BackingStore.URL() if fragURL.Scheme != "gs" { return 0, fmt.Errorf("SkipSignedURL unsupported scheme: %s", fragURL.Scheme) @@ -484,7 +484,7 @@ var ( // stores_test.go, which is in broker/fragment, imports broker/client so we cannot import broker/fragment here // to avoid a cycle. Instead we will repeat a subset of store_gcs.go. -var SkipSignedURLs = uint32(0) +var SkipSignedURLs = false var gcs = &gcsBackend{} type gcsBackend struct { diff --git a/cmd/gazette/main.go b/cmd/gazette/main.go index d25cd574..35d975d3 100644 --- a/cmd/gazette/main.go +++ b/cmd/gazette/main.go @@ -131,7 +131,7 @@ func (cmdServe) Execute(args []string) error { } func main() { - var parser = flags.NewParser(Config, flags.Default) + var parser = flags.NewParser(Config, flags.Default|flags.AllowBoolValues) _, _ = parser.AddCommand("serve", "Serve as Gazette broker", ` Serve a Gazette broker with the provided configuration, until signaled to diff --git a/mainboilerplate/runconsumer/run_consumer.go b/mainboilerplate/runconsumer/run_consumer.go index b31663fa..b0072f55 100644 --- a/mainboilerplate/runconsumer/run_consumer.go +++ b/mainboilerplate/runconsumer/run_consumer.go @@ -79,7 +79,7 @@ type BaseConfig struct { Limit uint32 `long:"limit" env:"LIMIT" default:"32" description:"Maximum number of Shards this consumer process will allocate"` MaxHotStandbys uint32 `long:"max-hot-standbys" env:"MAX_HOT_STANDBYS" default:"3" description:"Maximum effective hot standbys of any one shard, which upper-bounds its stated hot-standbys."` WatchDelay time.Duration `long:"watch-delay" env:"WATCH_DELAY" default:"30ms" description:"Delay applied to the application of watched Etcd events. Larger values amortize the processing of fast-changing Etcd keys."` - SkipSignedURLs uint32 `long:"skip-signed-urls" env:"SKIP_SIGNED_URLS" default:"0" description:"When a signed URL is received, use fragment info instead to retrieve data with auth header. This is useful when clients do not wish/require the signing."` + SkipSignedURLs bool `long:"skip-signed-urls" env:"SKIP_SIGNED_URLS" default:"false" description:"When a signed URL is received, use fragment info instead to retrieve data with auth header. This is useful when clients do not wish/require the signing."` } `group:"Consumer" namespace:"consumer" env-namespace:"CONSUMER"` Broker struct { @@ -204,7 +204,7 @@ func (sc Cmd) Execute(args []string) error { func Main(app Application) { var cfg = app.NewConfig() - var parser = flags.NewParser(cfg, flags.Default) + var parser = flags.NewParser(cfg, flags.Default|flags.AllowBoolValues) log.Info("Starting consumer...") _, _ = parser.AddCommand("serve", "Serve as Gazette consumer", ` serve a Gazette consumer with the provided configuration, until signaled to