diff --git a/cmd/root.go b/cmd/root.go index 2b0d43c6..df44be3d 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -9,13 +9,13 @@ import ( "net/http" "os" "os/signal" + "slices" "strings" "syscall" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" log "github.com/sirupsen/logrus" - "golang.org/x/exp/slices" "golang.org/x/sync/errgroup" csbouncer "github.com/crowdsecurity/go-cs-bouncer" @@ -222,7 +222,9 @@ func Execute() error { return errors.New("bouncer stream halted") }) - metricsProvider, err := csbouncer.NewMetricsProvider(bouncer.APIClient, bouncerType, *bouncer.MetricsInterval, metricsUpdater, log.StandardLogger()) + interval := *bouncer.MetricsInterval + + metricsProvider, err := csbouncer.NewMetricsProvider(bouncer.APIClient, bouncerType, interval, metricsUpdater, log.StandardLogger()) if err != nil { return fmt.Errorf("unable to create metrics provider: %w", err) } diff --git a/go.mod b/go.mod index 46292296..d8e8d60e 100644 --- a/go.mod +++ b/go.mod @@ -4,13 +4,12 @@ go 1.21 require ( github.com/crowdsecurity/crowdsec v1.6.1-0.20240308133748-11e105ae1a80 - github.com/crowdsecurity/go-cs-bouncer v0.0.14-0.20240311145229-ea2ead106063 + github.com/crowdsecurity/go-cs-bouncer v0.0.14-0.20240311151039-162a124c6fe1 github.com/crowdsecurity/go-cs-lib v0.0.7 github.com/google/nftables v0.1.1-0.20230710063801-8a10f689006b github.com/prometheus/client_golang v1.17.0 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 golang.org/x/sync v0.6.0 golang.org/x/sys v0.15.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 diff --git a/go.sum b/go.sum index 081b8ceb..2ba643b5 100644 --- a/go.sum +++ b/go.sum @@ -223,8 +223,6 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= diff --git a/pkg/iptables/iptables.go b/pkg/iptables/iptables.go index 8541333d..a1416e0f 100644 --- a/pkg/iptables/iptables.go +++ b/pkg/iptables/iptables.go @@ -7,10 +7,10 @@ import ( "errors" "fmt" "os/exec" + "slices" "strings" log "github.com/sirupsen/logrus" - "golang.org/x/exp/slices" "github.com/crowdsecurity/crowdsec/pkg/models"