From 2a34f050ca167f5de051cb271471dc0a3bd64094 Mon Sep 17 00:00:00 2001 From: Shriram Sharma Date: Sat, 10 Aug 2024 04:25:30 +0530 Subject: [PATCH] added status check along with generation check --- admiral/pkg/controller/admiral/controller.go | 5 ++++- go.mod | 1 - go.sum | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admiral/pkg/controller/admiral/controller.go b/admiral/pkg/controller/admiral/controller.go index 76f74f1d..97e3a338 100644 --- a/admiral/pkg/controller/admiral/controller.go +++ b/admiral/pkg/controller/admiral/controller.go @@ -160,7 +160,10 @@ func NewController(name, clusterEndpoint string, stopCh <-chan struct{}, delegat if err != nil { ctxLogger.Errorf(ControllerLogFormat, taskAddEventToQueue, controller.queue.Len(), err.Error()) } - if doesGenerationMatch { + if status == common.Processed && doesGenerationMatch { + ctxLogger.Infof(ControllerLogFormat, taskAddEventToQueue, controller.queue.Len(), + fmt.Sprintf("skipped processing event due to status=%s doesGenerationMatch=%v", + status, doesGenerationMatch)) return } diff --git a/go.mod b/go.mod index dda63ca6..2225d6f2 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,6 @@ require ( require ( github.com/aws/aws-sdk-go v1.55.2 github.com/istio-ecosystem/admiral-api v1.1.0 - github.com/jamiealquiza/tachymeter v2.0.0+incompatible github.com/prometheus/common v0.53.0 go.opentelemetry.io/otel v1.27.0 go.opentelemetry.io/otel/exporters/prometheus v0.49.0 diff --git a/go.sum b/go.sum index 2612a068..1cf8d5b8 100644 --- a/go.sum +++ b/go.sum @@ -234,8 +234,6 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/istio-ecosystem/admiral-api v1.1.0 h1:SLRgKRdZP31G0Q2uaYcVb3JxkjAbTxbSsze2N5ncapE= github.com/istio-ecosystem/admiral-api v1.1.0/go.mod h1:xB+G1v2H/cOxuR6koi/3kLHgF+oc3y905Lt12NCyMCI= -github.com/jamiealquiza/tachymeter v2.0.0+incompatible h1:mGiF1DGo8l6vnGT8FXNNcIXht/YmjzfraiUprXYwJ6g= -github.com/jamiealquiza/tachymeter v2.0.0+incompatible/go.mod h1:Ayf6zPZKEnLsc3winWEXJRkTBhdHo58HODAu1oFJkYU= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=