Skip to content

Commit

Permalink
Fixes terraform issue for EA search through multi value (#214)
Browse files Browse the repository at this point in the history
* Fixes terraform issue for EA search through multi value

* Fixes Multi-value search fails for space in a comma separated values

* Fixes Go-client part for Auth Zone fails to update NsGroup
  • Loading branch information
hemanthKa677 authored Oct 18, 2023
1 parent 072a0c8 commit 61358d5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
8 changes: 7 additions & 1 deletion connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,13 @@ func (wrb *WapiRequestBuilder) BuildUrl(t RequestType, objType string, ref strin
vals.Set("_proxy_search", "GM")
}
for k, v := range queryParams.searchFields {
vals.Set(k, v)
if res, ok := ValidateMultiValue(v); ok {
for _, mv := range res {
vals.Add(k, strings.TrimSpace(mv))
}
} else {
vals.Set(k, v)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion objects_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,12 @@ func CheckIntRange(name string, value int, min int, max int) error {

return nil
}

func ValidateMultiValue(v string) ([]string, bool) {
res := strings.Split(v, ",")
if len(res) > 1 {
return res, true
} else {
return nil, false
}
}

0 comments on commit 61358d5

Please sign in to comment.