Skip to content

Commit

Permalink
Merge pull request #2002 from opengovern/feat-query-validator
Browse files Browse the repository at this point in the history
fix: fix validator
  • Loading branch information
artaasadi authored Nov 16, 2024
2 parents c825abe + 85c3e64 commit 8dff721
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/describe/schedulers/query-validator/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func (s *JobScheduler) runPublisher(ctx context.Context) error {
}
if job.QueryType == queryvalidator.QueryTypeNamedQuery {
jobMsg.QueryType = queryvalidator.QueryTypeNamedQuery
jobMsg.QueryId = job.QueryId
namedQuery, err := s.inventoryClient.GetQuery(ctx2, job.QueryId)
if err != nil {
s.logger.Error("Get Query Error", zap.Error(err))
Expand All @@ -56,6 +57,8 @@ func (s *JobScheduler) runPublisher(ctx context.Context) error {
jobMsg.PrimaryTable = namedQuery.Query.PrimaryTable
jobMsg.IntegrationType = namedQuery.IntegrationTypes
} else if job.QueryType == queryvalidator.QueryTypeComplianceControl {
jobMsg.QueryType = queryvalidator.QueryTypeComplianceControl
jobMsg.QueryId = job.QueryId
controlQuery, err := s.complianceClient.GetControlDetails(ctx2, job.QueryId)
if err != nil {
s.logger.Error("Get Control Error", zap.Error(err))
Expand Down
2 changes: 1 addition & 1 deletion pkg/query-validator/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func (w *Worker) ProcessMessage(ctx context.Context, msg jetstream.Msg) (err err
w.logger.Error("failed to publish job in progress", zap.String("jobInProgress", string(resultJson)), zap.Error(err))
}

w.logger.Info("running job", zap.ByteString("job", msg.Data()))
w.logger.Info("running job", zap.ByteString("job", msg.Data()), zap.Any("job object", job))

err = w.RunJob(ctx, job)
if err != nil {
Expand Down

0 comments on commit 8dff721

Please sign in to comment.