internal/utils: Add unit tests
Add unit tests for various utils functions. Signed-off-by: Sunny <darkowlzz@protonmail.com>
This commit is contained in:
@@ -223,11 +223,7 @@ func ParseObjectKindName(input string) (kind, name string) {
|
||||
// ParseObjectKindNameNamespace extracts the kind, name and namespace of a resource
|
||||
// based on the '<kind>/<name>.<namespace>' format
|
||||
func ParseObjectKindNameNamespace(input string) (kind, name, namespace string) {
|
||||
name = input
|
||||
parts := strings.Split(input, "/")
|
||||
if len(parts) == 2 {
|
||||
kind, name = parts[0], parts[1]
|
||||
}
|
||||
kind, name = ParseObjectKindName(input)
|
||||
|
||||
if nn := strings.Split(name, "."); len(nn) > 1 {
|
||||
name = strings.Join(nn[:len(nn)-1], ".")
|
||||
|
||||
Reference in New Issue
Block a user