From 71a1eab1d1425686927379b9888883a8ed2a82cd Mon Sep 17 00:00:00 2001 From: Renan DelValle Date: Fri, 19 Oct 2018 12:29:17 -0700 Subject: [PATCH] Bug fix: Adding insecureSkipVerify option to realis options and moving realis options out of the zookeeper path only. --- cmd/root.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index b64fbdf..140c786 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -61,14 +61,8 @@ func connect(cmd *cobra.Command, args []string) { // Prefer zookeeper if both ways of connecting are provided if zkAddr != "" { - // Configure Zookeeper to connect zkOptions := []realis.ZKOpt{ realis.ZKEndpoints(zkAddr), realis.ZKPath("/aurora/scheduler")} - - if clientKey != "" || clientCert != "" || caCertsPath != "" { - realisOptions = append(realisOptions, realis.Certspath(caCertsPath), realis.ClientCerts(clientKey, clientCert)) - } - realisOptions = append(realisOptions, realis.ZookeeperOptions(zkOptions...)) } else if schedAddr != "" { realisOptions = append(realisOptions, realis.SchedulerUrl(schedAddr)) @@ -77,6 +71,14 @@ func connect(cmd *cobra.Command, args []string) { os.Exit(1) } + // Client certificate configuration if available + if clientKey != "" || clientCert != "" || caCertsPath != "" { + realisOptions = append(realisOptions, + realis.Certspath(caCertsPath), + realis.ClientCerts(clientKey, clientCert), + realis.InsecureSkipVerify(insecureSkipVerify)) + } + // Connect to Aurora Scheduler and create a client object client, err = realis.NewRealisClient(realisOptions...)