Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Fix the test-broker flags parsing #2627

Merged
merged 1 commit into from
Jun 3, 2019
Merged
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: 4 additions & 5 deletions contrib/cmd/test-broker/test-broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ var options struct {
}

func init() {
flags := flag.NewFlagSet("test-broker", flag.ExitOnError)
flag.IntVar(&options.Port, "port", 8005, "use '--port' option to specify the port for broker to listen on")
flag.StringVar(&options.TLSCert, "tlsCert", "", "base-64 encoded PEM block to use as the certificate for TLS. If '--tlsCert' is used, then '--tlsKey' must also be used. If '--tlsCert' is not used, then TLS will not be used.")
flag.StringVar(&options.TLSKey, "tlsKey", "", "base-64 encoded PEM block to use as the private key matching the TLS certificate. If '--tlsKey' is used, then '--tlsCert' must also be used")
flags = flag.NewFlagSet("test-broker", flag.ExitOnError)
flags.IntVar(&options.Port, "port", 8005, "use '--port' option to specify the port for broker to listen on")
flags.StringVar(&options.TLSCert, "tlsCert", "", "base-64 encoded PEM block to use as the certificate for TLS. If '--tlsCert' is used, then '--tlsKey' must also be used. If '--tlsCert' is not used, then TLS will not be used.")
flags.StringVar(&options.TLSKey, "tlsKey", "", "base-64 encoded PEM block to use as the private key matching the TLS certificate. If '--tlsKey' is used, then '--tlsCert' must also be used")
klog.InitFlags(flags)
}

Expand All @@ -53,7 +53,6 @@ func main() {
if err != nil {
klog.Fatalln(err)
}
flag.Parse()
if err := run(); err != nil && err != context.Canceled && err != context.DeadlineExceeded {
klog.Fatalln(err)
}
Expand Down