From 9437aa5f01b9d6270c475461bb3231134bee1ecd Mon Sep 17 00:00:00 2001 From: liguozhuang Date: Tue, 24 Sep 2024 17:33:24 +0800 Subject: [PATCH] save --- internal/plugins/inputs/kubernetesprometheus/input.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(), } })