Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: get multiple parameters in task #2290

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ require (
github.com/lib/pq v1.10.9
github.com/nats-io/nats.go v1.36.0
github.com/open-policy-agent/opa v0.69.0
github.com/opengovern/og-util v1.1.14-0.20241219130558-d70ee92c91fa
github.com/opengovern/og-util v1.2.1
github.com/opensearch-project/opensearch-go/v2 v2.3.0
github.com/opensearch-project/opensearch-go/v4 v4.2.0
github.com/ory/dockertest/v3 v3.10.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,8 @@ github.com/opencontainers/runc v1.2.0 h1:qke7ZVCmJcKrJVY2iHJVC+0kql9uYdkusOPsQOO
github.com/opencontainers/runc v1.2.0/go.mod h1:/PXzF0h531HTMsYQnmxXkBD7YaGShm/2zcRB79dksUc=
github.com/opengovern/og-util v1.1.14-0.20241219130558-d70ee92c91fa h1:srcr2aeDLSN+t2BhuB9JvWTUDhvBx1DVqXhEXasSSV4=
github.com/opengovern/og-util v1.1.14-0.20241219130558-d70ee92c91fa/go.mod h1:Q7Pd/1SzDtYoF3iAd4/FSBmFihis+7OIeDpU94xawXQ=
github.com/opengovern/og-util v1.2.1 h1:jTYMnJ4au3b9YsLbkmsYvFORrCeUlG79KGH66b8XWWI=
github.com/opengovern/og-util v1.2.1/go.mod h1:Q7Pd/1SzDtYoF3iAd4/FSBmFihis+7OIeDpU94xawXQ=
github.com/opensearch-project/opensearch-go/v2 v2.3.0 h1:nQIEMr+A92CkhHrZgUhcfsrZjibvB3APXf2a1VwCmMQ=
github.com/opensearch-project/opensearch-go/v2 v2.3.0/go.mod h1:8LDr9FCgUTVoT+5ESjc2+iaZuldqE+23Iq0r1XeNue8=
github.com/opensearch-project/opensearch-go/v4 v4.2.0 h1:uaBexfVdeSU15yOUPYF+IY059koVP0oNQPyoSde6N/A=
Expand Down
4 changes: 2 additions & 2 deletions services/tasks/api/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ type TaskResponse struct {
}

type RunTaskRequest struct {
TaskID string `json:"task_id"`
Params map[string]string `json:"params"`
TaskID string `json:"task_id"`
Params map[string][]string `json:"params"`
}
4 changes: 2 additions & 2 deletions services/tasks/scheduler/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ func (s *TaskScheduler) runPublisher(ctx context.Context) error {
return nil
}

func JSONBToMap(jsonb pgtype.JSONB) (map[string]string, error) {
func JSONBToMap(jsonb pgtype.JSONB) (map[string][]string, error) {
if jsonb.Status != pgtype.Present {
return nil, fmt.Errorf("JSONB data is not present")
}

var result map[string]string
var result map[string][]string
if err := json.Unmarshal(jsonb.Bytes, &result); err != nil {
return nil, fmt.Errorf("failed to unmarshal JSONB: %w", err)
}
Expand Down
Loading