-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Represent queue labels as map (#197) * Representing queue labels as a map in proto definition * Making armadactl queue filtering simpler, adding tests. Fixing inversion before filtering bug. * Linting * Reconciling proto diff --------- Co-authored-by: Mustafa Ilyas <[email protected]>
- Loading branch information
1 parent
b8fdf3d
commit 7a22411
Showing
10 changed files
with
943 additions
and
223 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,25 @@ | ||
package cmd | ||
|
||
import "fmt" | ||
import ( | ||
"fmt" | ||
"strings" | ||
) | ||
|
||
func queueNameValidation(queueName string) error { | ||
if queueName == "" { | ||
return fmt.Errorf("cannot provide empty queue name") | ||
} | ||
return nil | ||
} | ||
|
||
func labelSliceAsMap(labels []string) (map[string]string, error) { | ||
mapToReturn := make(map[string]string) | ||
for _, label := range labels { | ||
splitLabel := strings.Split(label, "=") | ||
if len(splitLabel) != 2 { | ||
return nil, fmt.Errorf("invalid label: %s", label) | ||
} | ||
mapToReturn[splitLabel[0]] = splitLabel[1] | ||
} | ||
return mapToReturn, nil | ||
} |
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
Oops, something went wrong.