From 3d86a95a2262e28ccbea20aa89a9274ef50f2321 Mon Sep 17 00:00:00 2001 From: Thuan Vo Date: Wed, 24 Apr 2024 10:50:24 -0700 Subject: [PATCH] test(integration): fix broken integration tests --- src/main/java/io/cryostat/discovery/CustomDiscovery.java | 2 +- src/main/java/io/cryostat/discovery/KubeApiDiscovery.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/cryostat/discovery/CustomDiscovery.java b/src/main/java/io/cryostat/discovery/CustomDiscovery.java index f3b013942..2f7055cdb 100644 --- a/src/main/java/io/cryostat/discovery/CustomDiscovery.java +++ b/src/main/java/io/cryostat/discovery/CustomDiscovery.java @@ -214,7 +214,7 @@ public Response delete(@RestPath long id) throws URISyntaxException { Target target = Target.find("id", id).singleResult(); DiscoveryNode realm = DiscoveryNode.getRealm(REALM).orElseThrow(); realm.children.remove(target.discoveryNode); - target.discoveryNode = null; + target.discoveryNode.parent = null; realm.persist(); target.delete(); return Response.noContent().build(); diff --git a/src/main/java/io/cryostat/discovery/KubeApiDiscovery.java b/src/main/java/io/cryostat/discovery/KubeApiDiscovery.java index 157edaad0..86f66491c 100644 --- a/src/main/java/io/cryostat/discovery/KubeApiDiscovery.java +++ b/src/main/java/io/cryostat/discovery/KubeApiDiscovery.java @@ -461,7 +461,7 @@ static final class KubeConfig { Optional> watchNamespaces; @ConfigProperty(name = "kubernetes.service.host") - String serviceHost; + Optional serviceHost; @ConfigProperty(name = "cryostat.discovery.kubernetes.namespace-path") String namespacePath; @@ -494,7 +494,7 @@ String getOwnNamespace() { } boolean kubeApiAvailable() { - return StringUtils.isNotBlank(serviceHost); + return StringUtils.isNotBlank(serviceHost.orElse("")); } KubernetesClient kubeClient() {