Bug fix: Adding insecureSkipVerify option to realis options and moving realis options out of the zookeeper path only.

This commit is contained in:
Renan DelValle 2018-10-19 12:29:17 -07:00
parent 91d962f481
commit 71a1eab1d1
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9

View file

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