From a5cfeda55a8bfacac2f1a91d0a721abf0bb0f528 Mon Sep 17 00:00:00 2001 From: manisha kumari Date: Sun, 21 Jan 2024 23:00:13 +0530 Subject: [PATCH] 5002-manual check execution bugfix --- backend/schedulerd/executor.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/schedulerd/executor.go b/backend/schedulerd/executor.go index a6b30570e1..010701016d 100644 --- a/backend/schedulerd/executor.go +++ b/backend/schedulerd/executor.go @@ -198,7 +198,9 @@ func (a *AdhocRequestExecutor) listenQueue(ctx context.Context) { continue } - if err = a.processCheck(ctx, &check); err != nil { + //create new context + newCtx := corev2.SetContextFromResource(ctx, &check) + if err = a.processCheck(newCtx, &check); err != nil { select { case a.listenQueueErr <- err: case <-ctx.Done(): @@ -306,6 +308,10 @@ func processCheck(ctx context.Context, executor Executor, check *corev2.CheckCon } // publish proxy requests on matching entities if matchedEntities := matchEntities(entities, check.ProxyRequests); len(matchedEntities) != 0 { + //display matched entities + matchedEntityJson, _ := json.Marshal(matchedEntities)q + matchedEntityJsonData := string(matchedEntityJson) + logger.WithFields(fields).Infof("matched entities: %s", matchedEntityJsonData) if err := executor.publishProxyCheckRequests(matchedEntities, check); err != nil { logger.WithFields(fields).WithError(err).Error("error publishing proxy check requests") }