From cb844e84f8d5335b98a033c0ca9f91b3e63ecea4 Mon Sep 17 00:00:00 2001 From: artaasadi Date: Sun, 29 Dec 2024 15:21:03 +0100 Subject: [PATCH] fix: fix ListQueryParameters calls --- jobs/compliance-quick-run-job/query_result.go | 2 +- jobs/compliance-runner-job/job.go | 2 +- services/describe/schedulers/query-runner/publisher.go | 2 +- services/describe/schedulers/query-validator/publisher.go | 2 +- services/inventory/http_routes.go | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jobs/compliance-quick-run-job/query_result.go b/jobs/compliance-quick-run-job/query_result.go index b37fd352f..fa311c4a7 100644 --- a/jobs/compliance-quick-run-job/query_result.go +++ b/jobs/compliance-quick-run-job/query_result.go @@ -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 } diff --git a/jobs/compliance-runner-job/job.go b/jobs/compliance-runner-job/job.go index 72e0cf33d..1dc1c7b30 100644 --- a/jobs/compliance-runner-job/job.go +++ b/jobs/compliance-runner-job/job.go @@ -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 } diff --git a/services/describe/schedulers/query-runner/publisher.go b/services/describe/schedulers/query-runner/publisher.go index 7ad5e237e..43e265ae8 100644 --- a/services/describe/schedulers/query-runner/publisher.go +++ b/services/describe/schedulers/query-runner/publisher.go @@ -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) diff --git a/services/describe/schedulers/query-validator/publisher.go b/services/describe/schedulers/query-validator/publisher.go index 91ecb82c8..ef2b80193 100644 --- a/services/describe/schedulers/query-validator/publisher.go +++ b/services/describe/schedulers/query-validator/publisher.go @@ -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) diff --git a/services/inventory/http_routes.go b/services/inventory/http_routes.go index 61e9f63cf..3a22770a9 100644 --- a/services/inventory/http_routes.go +++ b/services/inventory/http_routes.go @@ -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 } @@ -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 }