diff --git a/query/resource_selector.go b/query/resource_selector.go index d96cc9a2..91d3fabf 100644 --- a/query/resource_selector.go +++ b/query/resource_selector.go @@ -250,7 +250,7 @@ func SetResourceSelectorClause(ctx context.Context, resourceSelector types.Resou if resourceSelector.Functions.ComponentConfigTraversal != nil { args := resourceSelector.Functions.ComponentConfigTraversal if table == "components" { - query = query.Where("id IN (SELECT id from lookup_component_config_id_related_components(?, ?, ?))", args.ComponentID, args.Direction, args.Types) + query = query.Where("id IN (SELECT id from lookup_component_config_id_related_components(?, ?))", args.ComponentID, args.Direction) } } @@ -271,14 +271,13 @@ func setSearchQueryParams(rs *types.ResourceSelector) { switch items[0] { case "component_config_traverse": - // search: component_config_traverse=72143d48-da4a-477f-bac1-1e9decf188a6,outgoing,Kubernetes::Pod,Kubernetes::Node - // Args should be componentID, direction and types (compID,direction,type1,type2,type3) - args := strings.SplitN(items[1], ",", 3) - if len(args) == 3 { + // search: component_config_traverse=72143d48-da4a-477f-bac1-1e9decf188a6,outgoing + // Args should be componentID, direction and types (compID,direction) + args := strings.Split(items[1], ",") + if len(args) == 2 { rs.Functions.ComponentConfigTraversal = &types.ComponentConfigTraversalArgs{ ComponentID: args[0], Direction: args[1], - Types: types.Items(strings.Split(args[2], ",")), } } case "id": diff --git a/types/resource_selector.go b/types/resource_selector.go index 80d2d3a3..6c0059b8 100644 --- a/types/resource_selector.go +++ b/types/resource_selector.go @@ -19,7 +19,6 @@ import ( type ComponentConfigTraversalArgs struct { ComponentID string `yaml:"component_id,omitempty" json:"component_id,omitempty"` Direction string `yaml:"direction,omitempty" json:"direction,omitempty"` - Types Items `yaml:"types,omitempty" json:"types,omitempty"` } type Functions struct { diff --git a/views/005_component_views.sql b/views/005_component_views.sql index 9065ad58..3ae7a89a 100644 --- a/views/005_component_views.sql +++ b/views/005_component_views.sql @@ -148,8 +148,7 @@ CREATE OR REPLACE VIEW component_types AS CREATE OR REPLACE FUNCTION lookup_component_config_id_related_components ( component_id TEXT, - type_filter TEXT DEFAULT 'outgoing', - component_types TEXT[] DEFAULT '{}' + type_filter TEXT DEFAULT 'outgoing' ) RETURNS TABLE (id UUID) AS $$ BEGIN @@ -165,7 +164,6 @@ BEGIN ) SELECT components.id FROM components - WHERE config_id IN (SELECT related_config_ids.id FROM related_config_ids) - AND type = ANY($3); + WHERE config_id IN (SELECT related_config_ids.id FROM related_config_ids); END; $$ LANGUAGE plpgsql;