Skip to content

Commit b31ba4d

Browse files
authored
don't send pods in cluster component insights (#459)
1 parent 035dcf3 commit b31ba4d

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

pkg/cache/db/cache_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -514,17 +514,10 @@ func TestComponentCache_ComponentInsights(t *testing.T) {
514514
"app-statefulset-1",
515515
"app-daemonset-1",
516516
"app-deployment-1",
517-
"app-pod-1",
518517
"app-deployment-2",
519-
"app-pod-2",
520518
"app-deployment-3",
521-
"app-pod-3",
522519
"app-deployment-4",
523-
"app-replicaset-1",
524-
"app-pod-4",
525520
"app-deployment-5",
526-
"app-replicaset-2",
527-
"app-pod-5",
528521
}
529522

530523
// Insert all test components into cache

pkg/cache/db/queries.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,15 @@ const (
106106
-- Return both the failed components and their original parent components
107107
SELECT DISTINCT cc.uid, cc."group", cc.version, cc.kind, cc.namespace, cc.name
108108
FROM component_chain cc
109-
WHERE cc.health = 2 -- The component itself is failed
109+
WHERE (cc.health = 2 -- The component itself is failed
110110
OR cc.uid IN ( -- OR it's a direct parent of a failed component
111111
SELECT parent_uid
112112
FROM component_chain
113113
WHERE health = 2 AND parent_uid IS NOT NULL
114114
)
115115
OR (cc.uid IN ( -- OR it's the original root component of a chain with failures
116116
SELECT root_uid FROM failed_roots
117-
) AND cc.kind IN ('Deployment', 'StatefulSet', 'Ingress', 'DaemonSet', 'Certificate'))
117+
) AND cc.kind IN ('Deployment', 'StatefulSet', 'Ingress', 'DaemonSet', 'Certificate')))
118+
AND cc.kind IN ('Deployment', 'StatefulSet', 'Ingress', 'DaemonSet', 'Certificate')
118119
`
119120
)

0 commit comments

Comments
 (0)