[GO][EDIT] Added tls flag in config file

This commit is contained in:
alexandre committed 2020-12-01 20:05:51 +01:00
1 parent d3285ba301
commit 3ccd8caa23
2 files changed
+3 -1

No files matched your search

+1
View File
@@ -9,6 +9,7 @@ import (
// Config represents the configuration for the exporter
type Config struct {
tls bool `yaml:"tls,omitempty"`
Devices []Device `yaml:"devices"`
Features struct {
BGP bool `yaml:"bgp,omitempty"`
+2 -1
View File
@@ -245,7 +245,8 @@ func collectorOptions() []collector.Option {
opts = append(opts, collector.WithTimeout(*timeout))
}
if *tls {
if *tls || cfg.tls {
fmt.printf("TLS activated\n");
opts = append(opts, collector.WithTLS(*insecure))
}