diff --git a/pkg/dcgmexporter/server.go b/pkg/dcgmexporter/server.go index fc72a226..bf829df1 100644 --- a/pkg/dcgmexporter/server.go +++ b/pkg/dcgmexporter/server.go @@ -37,7 +37,7 @@ func NewMetricsServer(c *Config, metrics chan string) (*MetricsServer, func(), e ReadTimeout: 10 * time.Second, WriteTimeout: 10 * time.Second, }, - webConfig: web.FlagConfig{ + webConfig: &web.FlagConfig{ WebListenAddresses: &[]string{c.Address}, WebSystemdSocket: &c.WebSystemdSocket, WebConfigFile: &c.WebConfigFile, @@ -74,7 +74,7 @@ func (s *MetricsServer) Run(stop chan interface{}, wg *sync.WaitGroup) { go func() { defer httpwg.Done() logrus.Info("Starting webserver") - if err := web.ListenAndServe(s.server, &s.webConfig, logger); err != nil && err != http.ErrServerClosed { + if err := web.ListenAndServe(s.server, s.webConfig, logger); err != nil && err != http.ErrServerClosed { logrus.Fatalf("Failed to Listen and Server HTTP server with err: `%v`", err) } }() diff --git a/pkg/dcgmexporter/types.go b/pkg/dcgmexporter/types.go index 9bacba45..472cfe1e 100644 --- a/pkg/dcgmexporter/types.go +++ b/pkg/dcgmexporter/types.go @@ -159,7 +159,7 @@ type MetricsServer struct { sync.Mutex server *http.Server - webConfig web.FlagConfig + webConfig *web.FlagConfig metrics string metricsChan chan string }