Skip to content

Commit

Permalink
feat(graph): revert dedup from DSL.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zenithar committed Dec 11, 2024
1 parent f653c89 commit 0671711
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 0 additions & 6 deletions deployments/kubehound/graph/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ ENV janusgraph.query.batch=true
ENV janusgraph.query.hard-max-limit=10000
ENV janusgraph.query.smart-limit=true

# Enable cache
ENV janusgraph.cache.db-cache=true
ENV janusgraph.cache.db-cache-clean-wait=20
ENV janusgraph.cache.db-cache-time=180000
ENV janusgraph.cache.db-cache-size=0.5

# Performance tweaks based on: https://www.sailpoint.com/blog/souping-up-the-gremlin/
# gremlinPool will default to Runtime.availableProcessors()
ENV gremlinserver.gremlinPool=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public default GraphTraversal<S, Path> criticalPaths(int maxHops) {

return repeat(((KubeHoundTraversalDsl) __.outE())
.inV()
.simplePath().dedup()).until(
.simplePath()).until(
__.has("critical", true)
.or()
.loops()
Expand Down Expand Up @@ -126,7 +126,7 @@ public default GraphTraversal<S, Path> criticalPathsFilter(int maxHops, String..
return repeat(((KubeHoundTraversalDsl) __.outE())
.has("class", P.not(P.within(exclusions)))
.inV()
.simplePath().dedup()).until(
.simplePath()).until(
__.has("critical", true)
.or()
.loops()
Expand Down Expand Up @@ -167,7 +167,7 @@ public default <E2 extends Comparable> GraphTraversal<S, E2> minHopsToCritical(i
throw new IllegalArgumentException(String.format("maxHops must be <= %d", PATH_HOPS_MAX));

return repeat(((KubeHoundTraversalDsl) __.out())
.simplePath().dedup()).until(
.simplePath()).until(
__.has("critical", true)
.or()
.loops()
Expand Down Expand Up @@ -202,7 +202,7 @@ public default <K> GraphTraversal<S, Map<K, Long>> criticalPathsFreq(int maxHops
return repeat(
(KubeHoundTraversalDsl) __.outE()
.inV()
.simplePath().dedup())
.simplePath())
.emit()
.until(
__.has("critical", true)
Expand Down
4 changes: 2 additions & 2 deletions test/system/graph_dsl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func (suite *DslTestSuite) TestTraversal_minHopsToCritical() {

serviceHops, err := res.GetInt()
suite.NoError(err)
suite.Equal(serviceHops, 3)
suite.Equal(5, serviceHops)

// Container should have 1 less hop
raw, err = suite.client.Submit("kh.containers().minHopsToCritical(6)")
Expand All @@ -294,7 +294,7 @@ func (suite *DslTestSuite) TestTraversal_minHopsToCritical() {

containerHops, err := res.GetInt()
suite.NoError(err)
suite.Equal(containerHops, serviceHops-1)
suite.Equal(serviceHops-1, containerHops)
}

func (suite *DslTestSuite) TestTraversal_criticalPathsFilter() {
Expand Down

0 comments on commit 0671711

Please sign in to comment.