diff --git a/pkg/nfd-worker/nfd-worker.go b/pkg/nfd-worker/nfd-worker.go index 5b6e07e4dd..af34845472 100644 --- a/pkg/nfd-worker/nfd-worker.go +++ b/pkg/nfd-worker/nfd-worker.go @@ -175,12 +175,11 @@ func newDefaultConfig() *NFDConfig { func (w *nfdWorker) createTicker() *time.Ticker { if w.config.Core.SleepInterval.Duration > 0 { return time.NewTicker(w.config.Core.SleepInterval.Duration) - } else { - // If the sleep interval is not a positive number, the ticker will act as if it was set to an infinite duration by not ticking. - t := time.NewTicker(time.Hour) - t.Stop() - return t } + // If the sleep interval is not a positive number, the ticker will act as if it was set to an infinite duration by not ticking. + t := time.NewTicker(time.Hour) + t.Stop() + return t } // Run feature discovery. @@ -197,9 +196,7 @@ func (w *nfdWorker) runFeatureDiscovery() error { // Update the node with the feature labels. if !w.config.Core.NoPublish { - if err := w.advertiseFeatures(labels); err != nil { - return err - } + return w.advertiseFeatures(labels) } return nil