-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge search parameter into search query for
list clusters
Currently when the `--parameter search="..."` flag is used in the `list clusters` command the result is that two `search` query parameters are sent to the server, one containing the value given by the `--parameter` flag and another containing the search query calculated from the rest of the flags. For example, the following command: ``` $ ocm list clusters --managed --parameter search="state is 'ready'" ``` Results in a URL like this: ``` https://api.openshift.com/foo/bar?search=managed+%27t%27&search=state+is+%27ready%27 ``` When the server receive that it will just ignore one of the values, so the result will not the expected combination of both search criteria. To address that this patch changes the `list clusters` command so that it will explicitly combine the search query calculated from other parameters with the values given with the `--parameter` flag. In the above example the result will be a URL like this: ``` https://api.openshift.com/api/clusters_mgmt/v1/clusters?search=%28managed+%3D+%27t%27%29+and+%28state+is+%27ready%27%29 ``` Note that this only applies to the `list clusters` command. The `--parameter search="..."` flag will still have the previous meaning in other places. Related: https://issues.redhat.com/browse/SDA-4201 Signed-off-by: Juan Hernandez <[email protected]>
- Loading branch information
Showing
2 changed files
with
67 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters