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...)