[GO][EDIT] moved tls option to Features and renamed it to TLS

This commit is contained in:
BuildTools
2020-12-01 20:15:35 +01:00
parent 4ddcf3ecd5
commit 34a486986b
2 changed files with 2 additions and 2 deletions

View File

@@ -9,9 +9,9 @@ import (
// Config represents the configuration for the exporter // Config represents the configuration for the exporter
type Config struct { type Config struct {
tls bool `yaml:"tls,omitempty"`
Devices []Device `yaml:"devices"` Devices []Device `yaml:"devices"`
Features struct { Features struct {
TLS bool `yaml:"tls,omitempty"`
BGP bool `yaml:"bgp,omitempty"` BGP bool `yaml:"bgp,omitempty"`
DHCP bool `yaml:"dhcp,omitempty"` DHCP bool `yaml:"dhcp,omitempty"`
DHCPL bool `yaml:"dhcpl,omitempty"` DHCPL bool `yaml:"dhcpl,omitempty"`

View File

@@ -245,7 +245,7 @@ func collectorOptions() []collector.Option {
opts = append(opts, collector.WithTimeout(*timeout)) opts = append(opts, collector.WithTimeout(*timeout))
} }
if *tls || cfg.tls { if *tls || cfg.Features.TLS {
fmt.Printf("TLS activated\n"); fmt.Printf("TLS activated\n");
opts = append(opts, collector.WithTLS(*insecure)) opts = append(opts, collector.WithTLS(*insecure))
} }