diff --git a/internal/plugins/inputs/kubernetesprometheus/input.go b/internal/plugins/inputs/kubernetesprometheus/input.go index 300531c1b4..9a74e93b02 100644 --- a/internal/plugins/inputs/kubernetesprometheus/input.go +++ b/internal/plugins/inputs/kubernetesprometheus/input.go @@ -138,13 +138,19 @@ func (ipt *Input) Resume() error { } } +func newPauseVar() *atomic.Bool { + b := &atomic.Bool{} + b.Store(true) + return b +} + func init() { //nolint:gochecknoinits setupMetrics() inputs.Add(inputName, func() inputs.Input { return &Input{ NodeLocal: true, chPause: make(chan bool, inputs.ElectionPauseChannelLength), - pause: &atomic.Bool{}, + pause: newPauseVar(), feeder: dkio.DefaultFeeder(), } })