Make resource selector args case insensitive
So that `<kind>/<name>` flags can be supplied as: * `secret/foo` * `Secret/foo` * `SeCrEt/foo` But result in: `Secret/foo`. Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
@@ -230,6 +230,15 @@ func ContainsItemString(s []string, e string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func ContainsEqualFoldItemString(s []string, e string) (string, bool) {
|
||||
for _, a := range s {
|
||||
if strings.EqualFold(a, e) {
|
||||
return a, true
|
||||
}
|
||||
}
|
||||
return "", false
|
||||
}
|
||||
|
||||
func ParseObjectKindName(input string) (string, string) {
|
||||
kind := ""
|
||||
name := input
|
||||
|
||||
Reference in New Issue
Block a user