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

Commit

Permalink
Fix the test-broker flags parsing (#2627)
Browse files Browse the repository at this point in the history
  • Loading branch information
mszostok authored and k8s-ci-robot committed Jun 3, 2019
1 parent 8bb2233 commit fd706ee
Showing 1 changed file with 4 additions and 5 deletions.
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

0 comments on commit fd706ee

Please sign in to comment.