Skip to content

Commit

Permalink
fix(k8s): fix duplicate namespace nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
tthvo committed Apr 15, 2024
1 parent f8df465 commit 029b2fb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main/java/io/cryostat/discovery/KubeApiDiscovery.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,11 @@ private List<TargetTuple> getTargetTuplesFrom(Endpoints endpoints) {
public void handleEndpointEvent(TargetTuple tuple, EventKind eventKind) {
DiscoveryNode realm = DiscoveryNode.getRealm(REALM).orElseThrow();
DiscoveryNode nsNode =
DiscoveryNode.environment(
tuple.objRef.getNamespace(), KubeDiscoveryNodeType.NAMESPACE);
if (realm.children.contains(nsNode)) {
nsNode =
DiscoveryNode.getChild(realm, n -> tuple.objRef.getNamespace().equals(n.name))
.orElseThrow();
}
DiscoveryNode.getChild(realm, n -> tuple.objRef.getNamespace().equals(n.name))
.orElse(
DiscoveryNode.environment(
tuple.objRef.getNamespace(),
KubeDiscoveryNodeType.NAMESPACE));

switch (eventKind) {
case FOUND:
Expand Down

0 comments on commit 029b2fb

Please sign in to comment.