Skip to content

Commit

Permalink
Merge pull request #2326 from opengovern/fix-tasks
Browse files Browse the repository at this point in the history
fix: fix ListQueryParameters calls
  • Loading branch information
artaasadi authored Dec 29, 2024
2 parents dd3086a + cb844e8 commit 1af0828
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion jobs/compliance-quick-run-job/query_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (w *Worker) RunQuery(ctx context.Context, j QueryJob) ([]QueryResult, error
return nil, err
}
queryParamMap := make(map[string]string)
for _, qp := range queryParams.QueryParameters {
for _, qp := range queryParams.Items {
queryParamMap[qp.Key] = qp.Value
}

Expand Down
2 changes: 1 addition & 1 deletion jobs/compliance-runner-job/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (w *Worker) RunJob(ctx context.Context, j Job) (int, error) {
return 0, err
}
queryParamMap := make(map[string]string)
for _, qp := range queryParams.QueryParameters {
for _, qp := range queryParams.Items {
queryParamMap[qp.Key] = qp.Value
}

Expand Down
2 changes: 1 addition & 1 deletion services/describe/schedulers/query-runner/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (s *JobScheduler) runPublisher(ctx context.Context) error {
return err
}
queryParamMap := make(map[string]string)
for _, qp := range queryParams.QueryParameters {
for _, qp := range queryParams.Items {
queryParamMap[qp.Key] = qp.Value
}
queryTemplate, err := template.New("query").Parse(query)
Expand Down
2 changes: 1 addition & 1 deletion services/describe/schedulers/query-validator/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (s *JobScheduler) runPublisher(ctx context.Context) error {
return err
}
queryParamMap := make(map[string]string)
for _, qp := range queryParams.QueryParameters {
for _, qp := range queryParams.Items {
queryParamMap[qp.Key] = qp.Value
}
queryTemplate, err := template.New(jobMsg.QueryId).Parse(jobMsg.Query)
Expand Down
4 changes: 2 additions & 2 deletions services/inventory/http_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ func (h *HttpHandler) RunQuery(ctx echo.Context) error {
return err
}
queryParamMap := make(map[string]string)
for _, qp := range queryParams.QueryParameters {
for _, qp := range queryParams.Items {
queryParamMap[qp.Key] = qp.Value
}

Expand Down Expand Up @@ -1163,7 +1163,7 @@ func (h *HttpHandler) RunQueryByID(ctx echo.Context) error {
return echo.NewHTTPError(http.StatusInternalServerError, "failed to get query parameters")
}
queryParamMap := make(map[string]string)
for _, qp := range queryParams.QueryParameters {
for _, qp := range queryParams.Items {
queryParamMap[qp.Key] = qp.Value
}

Expand Down

0 comments on commit 1af0828

Please sign in to comment.