skip update checking if DisableUpdateCheck is set to true

This commit is contained in:
Chelsea Holland Komlo 2018-08-10 13:08:13 -04:00
parent 71b5bc3863
commit e8379c9059

View file

@ -393,8 +393,9 @@ func (c *Command) setupAgent(config *Config, logOutput io.Writer, inmem *metrics
}
c.httpServer = http
// Setup update checking
if config.DisableUpdateCheck != nil && *config.DisableUpdateCheck {
// If DisableUpdateCheck is not enabled, set up update checking
// (DisableUpdateCheck is false by default)
if config.DisableUpdateCheck != nil && !*config.DisableUpdateCheck {
version := config.Version.Version
if config.Version.VersionPrerelease != "" {
version += fmt.Sprintf("-%s", config.Version.VersionPrerelease)