From 68e6b4dd3411ea0a95a88dee8d198f77e84fe0d5 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Tue, 31 Oct 2023 12:46:55 +0100 Subject: [PATCH] ci(lint): enable errorlint on discovery (#12918) Signed-off-by: Matthieu MOREL --- .golangci.yml | 3 --- discovery/kubernetes/endpointslice.go | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index b97a78d69..1f31597c9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -33,9 +33,6 @@ issues: - path: _test.go linters: - errcheck - - path: discovery/ - linters: - - errorlint - path: scrape/ linters: - errorlint diff --git a/discovery/kubernetes/endpointslice.go b/discovery/kubernetes/endpointslice.go index 54fb5c0f4..a16862380 100644 --- a/discovery/kubernetes/endpointslice.go +++ b/discovery/kubernetes/endpointslice.go @@ -15,6 +15,7 @@ package kubernetes import ( "context" + "errors" "fmt" "net" "strconv" @@ -183,7 +184,7 @@ func (e *EndpointSlice) Run(ctx context.Context, ch chan<- []*targetgroup.Group) cacheSyncs = append(cacheSyncs, e.nodeInf.HasSynced) } if !cache.WaitForCacheSync(ctx.Done(), cacheSyncs...) { - if ctx.Err() != context.Canceled { + if !errors.Is(ctx.Err(), context.Canceled) { level.Error(e.logger).Log("msg", "endpointslice informer unable to sync cache") } return