From 549ecfe053ec3f2e72542037b605cd89e02fd0cd Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Sat, 15 Jun 2024 00:49:06 +0300 Subject: [PATCH] lint fix --- go.mod | 3 +-- pkg/storage/unified/resource/server.go | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 417ae92f99d..87797dab4f0 100644 --- a/go.mod +++ b/go.mod @@ -148,6 +148,7 @@ require ( github.com/spf13/cobra v1.8.0 // @grafana/grafana-app-platform-squad github.com/spf13/pflag v1.0.5 // @grafana-app-platform-squad github.com/spyzhov/ajson v0.9.0 // @grafana/grafana-app-platform-squad + github.com/hack-pad/hackpadfs v0.2.1 // @grafana/grafana-app-platform-squad github.com/stretchr/testify v1.9.0 // @grafana/grafana-backend-group github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf // @grafana/grafana-backend-group github.com/ua-parser/uap-go v0.0.0-20211112212520-00c877edfe0f // @grafana/grafana-backend-group @@ -443,8 +444,6 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect; @grafana-app-platform-squad ) -require github.com/hack-pad/hackpadfs v0.2.1 - // Use fork of crewjam/saml with fixes for some issues until changes get merged into upstream replace github.com/crewjam/saml => github.com/grafana/saml v0.4.15-0.20240523142256-cc370b98af7c diff --git a/pkg/storage/unified/resource/server.go b/pkg/storage/unified/resource/server.go index 8d06a4f2d43..5dea937d285 100644 --- a/pkg/storage/unified/resource/server.go +++ b/pkg/storage/unified/resource/server.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "math/rand" "sync" "time" @@ -91,6 +92,9 @@ func NewResourceServer(opts ResourceServerOptions) (ResourceServer, error) { } if opts.NextEventID == nil { + if opts.NodeID == 0 { + opts.NodeID = rand.Int63n(1024) + } eventNode, err := snowflake.NewNode(opts.NodeID) if err != nil { return nil, apierrors.NewInternalError(