diff --git a/context/connection.go b/context/connection.go index 1e9b2949..38fa2992 100644 --- a/context/connection.go +++ b/context/connection.go @@ -27,7 +27,7 @@ func extractConnectionNameType(connectionString string) (name, namespace, connec connectionString = strings.TrimPrefix(connectionString, prefix) parts := strings.Split(connectionString, "/") - if len(parts) > 3 || len(parts) < 1 { + if len(parts) > 3 || len(parts) < 2 { return } diff --git a/context/connection_test.go b/context/connection_test.go index 7dab6f8b..0a9fc53a 100644 --- a/context/connection_test.go +++ b/context/connection_test.go @@ -37,10 +37,10 @@ func TestGetConnectionNameType(t *testing.T) { connectionType string found bool }{ - name: "mission_control//", - namespace: "default", - connectionType: "db", - found: true, + name: "", + namespace: "", + connectionType: "", + found: false, }, }, {