-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Correct multiple labels filtering for get commadn (#59)
## Motivation Our backend only interprets the first query parameter value it receives. Since we've been setting `url.Values` labels query parameter key to a list of parsed values, this caused our backend to only interpret the first value. With example Projects: ```yaml - apiVersion: n9/v1alpha kind: Project metadata: displayName: azure-agent labels: env: - dev - dev-demo-1 team: - bees name: azure-agent spec: description: azure-agent - apiVersion: n9/v1alpha kind: Project metadata: labels: team: - bees name: project-two spec: description: "" ``` When running: ```sh sloctl get project -l env=dev,team=bees sloctl get project -l team=bees,env=dev ``` We got: - for the first command, both Projects - for the second one, only one Project, `azure-agent` **What should've happened?** Both commands should only return `azure-agent`, as this should've been interpreted as AND condition between labels. As a side effect, OR conditions have been broken too (same key, multiple labels), so these should work now too. ## Testing - Extended e2e tests coverage. ## Release Notes Fixed labels filtering for `sloctl get` command which was causing incorrect results to be returned by our backend. Issue affects every sloctl version starting from and including v0.0.95.
- Loading branch information
1 parent
59fbe90
commit 210c475
Showing
4 changed files
with
152 additions
and
94 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
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