From 756d5ba8cd25ba9fa523532173379a25c5e73c36 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 12:41:45 -0500 Subject: [PATCH] fix(discovery): BUILTIN_DISCOVERY_DISABLED can be specified even when PLATFORM is set (#1865) (#1870) (cherry picked from commit d627360e6f01c37943d536a8e0f2e7fc753737ba) Co-authored-by: Andrew Azores --- .../cryostat/discovery/BuiltInDiscovery.java | 6 +++ .../cryostat/discovery/DiscoveryStorage.java | 5 +++ .../platform/AbstractPlatformClient.java | 12 ++++- .../io/cryostat/platform/PlatformClient.java | 3 ++ .../io/cryostat/platform/PlatformModule.java | 2 - .../internal/CustomTargetPlatformClient.java | 9 +++- .../internal/DefaultPlatformClient.java | 9 ++-- .../internal/DefaultPlatformStrategy.java | 14 +++--- .../internal/DockerPlatformClient.java | 3 ++ .../internal/DockerPlatformStrategy.java | 14 +++--- .../internal/KubeApiPlatformClient.java | 3 ++ .../internal/KubeApiPlatformStrategy.java | 8 ++-- .../internal/OpenShiftPlatformStrategy.java | 6 +-- .../internal/PlatformStrategyModule.java | 44 +++++++++++++------ .../internal/PodmanPlatformClient.java | 3 ++ .../internal/PodmanPlatformStrategy.java | 13 ++++-- .../CustomTargetPlatformClientTest.java | 4 +- .../internal/DefaultPlatformClientTest.java | 6 ++- .../internal/KubeApiPlatformClientTest.java | 2 +- 19 files changed, 120 insertions(+), 46 deletions(-) diff --git a/src/main/java/io/cryostat/discovery/BuiltInDiscovery.java b/src/main/java/io/cryostat/discovery/BuiltInDiscovery.java index b3ec7254f4..0dae091ff2 100644 --- a/src/main/java/io/cryostat/discovery/BuiltInDiscovery.java +++ b/src/main/java/io/cryostat/discovery/BuiltInDiscovery.java @@ -74,6 +74,12 @@ public void start(Promise start) { .distinct() .forEach( platform -> { + if (!platform.isEnabled()) { + logger.info( + "Skipping built-in discovery with {} : not enabled", + platform.getClass().getSimpleName()); + return; + } logger.info( "Starting built-in discovery with {}", platform.getClass().getSimpleName()); diff --git a/src/main/java/io/cryostat/discovery/DiscoveryStorage.java b/src/main/java/io/cryostat/discovery/DiscoveryStorage.java index 752a01675a..9ad0d7628d 100644 --- a/src/main/java/io/cryostat/discovery/DiscoveryStorage.java +++ b/src/main/java/io/cryostat/discovery/DiscoveryStorage.java @@ -120,6 +120,11 @@ public class DiscoveryStorage extends AbstractPlatformClientVerticle { this.logger = logger; } + @Override + public final boolean isEnabled() { + return true; + } + @Override public void start(Promise future) throws Exception { pingPrune() diff --git a/src/main/java/io/cryostat/platform/AbstractPlatformClient.java b/src/main/java/io/cryostat/platform/AbstractPlatformClient.java index 2d6a8776ed..89d55f781d 100644 --- a/src/main/java/io/cryostat/platform/AbstractPlatformClient.java +++ b/src/main/java/io/cryostat/platform/AbstractPlatformClient.java @@ -19,16 +19,26 @@ import java.util.Set; import java.util.function.Consumer; +import io.cryostat.configuration.Variables; import io.cryostat.core.net.discovery.JvmDiscoveryClient.EventKind; +import io.cryostat.core.sys.Environment; public abstract class AbstractPlatformClient implements PlatformClient { + protected final Environment environment; protected final Set> discoveryListeners; - protected AbstractPlatformClient() { + protected AbstractPlatformClient(Environment environment) { + this.environment = environment; this.discoveryListeners = new HashSet<>(); } + @Override + public boolean isEnabled() { + return !Boolean.parseBoolean( + environment.getEnv(Variables.DISABLE_BUILTIN_DISCOVERY, "false")); + } + @Override public void addTargetDiscoveryListener(Consumer listener) { this.discoveryListeners.add(listener); diff --git a/src/main/java/io/cryostat/platform/PlatformClient.java b/src/main/java/io/cryostat/platform/PlatformClient.java index 282ab7dd45..7eec6bce48 100644 --- a/src/main/java/io/cryostat/platform/PlatformClient.java +++ b/src/main/java/io/cryostat/platform/PlatformClient.java @@ -23,6 +23,9 @@ import io.vertx.core.Promise; public interface PlatformClient { + + boolean isEnabled(); + default void start() throws Exception {} default void load(Promise promise) { diff --git a/src/main/java/io/cryostat/platform/PlatformModule.java b/src/main/java/io/cryostat/platform/PlatformModule.java index 8b19f3dede..5443ec75db 100644 --- a/src/main/java/io/cryostat/platform/PlatformModule.java +++ b/src/main/java/io/cryostat/platform/PlatformModule.java @@ -90,8 +90,6 @@ static Set> provideSelectedPlatformStrategies( List platforms = Arrays.asList(env.getEnv(Variables.PLATFORM_STRATEGY_ENV_VAR).split(",")); fn = s -> platforms.contains(s.getClass().getCanonicalName()); - } else if (env.hasEnv(Variables.DISABLE_BUILTIN_DISCOVERY)) { - fn = s -> false; } else { fn = PlatformDetectionStrategy::isAvailable; } diff --git a/src/main/java/io/cryostat/platform/internal/CustomTargetPlatformClient.java b/src/main/java/io/cryostat/platform/internal/CustomTargetPlatformClient.java index 67ce409618..0f30721f00 100644 --- a/src/main/java/io/cryostat/platform/internal/CustomTargetPlatformClient.java +++ b/src/main/java/io/cryostat/platform/internal/CustomTargetPlatformClient.java @@ -25,6 +25,7 @@ import java.util.TreeSet; import io.cryostat.core.net.discovery.JvmDiscoveryClient.EventKind; +import io.cryostat.core.sys.Environment; import io.cryostat.discovery.DiscoveryStorage; import io.cryostat.platform.AbstractPlatformClient; import io.cryostat.platform.ServiceRef; @@ -46,11 +47,17 @@ public class CustomTargetPlatformClient extends AbstractPlatformClient { private final SortedSet targets; @SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "Field is never mutated") - public CustomTargetPlatformClient(Lazy storage) { + public CustomTargetPlatformClient(Environment environment, Lazy storage) { + super(environment); this.storage = storage; this.targets = new TreeSet<>((u1, u2) -> u1.getServiceUri().compareTo(u2.getServiceUri())); } + @Override + public boolean isEnabled() { + return true; + } + @Override public void load(Promise promise) { storage.get() diff --git a/src/main/java/io/cryostat/platform/internal/DefaultPlatformClient.java b/src/main/java/io/cryostat/platform/internal/DefaultPlatformClient.java index 8ccac538d0..40714ddd2d 100644 --- a/src/main/java/io/cryostat/platform/internal/DefaultPlatformClient.java +++ b/src/main/java/io/cryostat/platform/internal/DefaultPlatformClient.java @@ -31,6 +31,7 @@ import io.cryostat.core.net.discovery.DiscoveredJvmDescriptor; import io.cryostat.core.net.discovery.JvmDiscoveryClient; import io.cryostat.core.net.discovery.JvmDiscoveryClient.JvmDiscoveryEvent; +import io.cryostat.core.sys.Environment; import io.cryostat.platform.AbstractPlatformClient; import io.cryostat.platform.ServiceRef; import io.cryostat.platform.ServiceRef.AnnotationKey; @@ -47,12 +48,14 @@ public class DefaultPlatformClient extends AbstractPlatformClient public static final NodeType NODE_TYPE = BaseNodeType.JVM; - private final Logger logger; private final JvmDiscoveryClient discoveryClient; + private final Logger logger; - DefaultPlatformClient(Logger logger, JvmDiscoveryClient discoveryClient) { - this.logger = logger; + DefaultPlatformClient( + Environment environment, JvmDiscoveryClient discoveryClient, Logger logger) { + super(environment); this.discoveryClient = discoveryClient; + this.logger = logger; } @Override diff --git a/src/main/java/io/cryostat/platform/internal/DefaultPlatformStrategy.java b/src/main/java/io/cryostat/platform/internal/DefaultPlatformStrategy.java index a34989b237..1a2ce70660 100644 --- a/src/main/java/io/cryostat/platform/internal/DefaultPlatformStrategy.java +++ b/src/main/java/io/cryostat/platform/internal/DefaultPlatformStrategy.java @@ -17,23 +17,27 @@ import io.cryostat.core.log.Logger; import io.cryostat.core.net.discovery.JvmDiscoveryClient; +import io.cryostat.core.sys.Environment; import io.cryostat.net.AuthManager; import dagger.Lazy; class DefaultPlatformStrategy implements PlatformDetectionStrategy { - private final Logger logger; + private final Environment environment; private final Lazy authMgr; private final Lazy discoveryClient; + private final Logger logger; DefaultPlatformStrategy( - Logger logger, + Environment environment, Lazy authMgr, - Lazy discoveryClient) { - this.logger = logger; + Lazy discoveryClient, + Logger logger) { + this.environment = environment; this.authMgr = authMgr; this.discoveryClient = discoveryClient; + this.logger = logger; } @Override @@ -44,7 +48,7 @@ public boolean isAvailable() { @Override public DefaultPlatformClient getPlatformClient() { logger.info("Selected Default Platform Strategy"); - return new DefaultPlatformClient(logger, discoveryClient.get()); + return new DefaultPlatformClient(environment, discoveryClient.get(), logger); } @Override diff --git a/src/main/java/io/cryostat/platform/internal/DockerPlatformClient.java b/src/main/java/io/cryostat/platform/internal/DockerPlatformClient.java index 549581710e..8d5642d3a6 100644 --- a/src/main/java/io/cryostat/platform/internal/DockerPlatformClient.java +++ b/src/main/java/io/cryostat/platform/internal/DockerPlatformClient.java @@ -36,6 +36,7 @@ import io.cryostat.core.log.Logger; import io.cryostat.core.net.JFRConnectionToolkit; import io.cryostat.core.net.discovery.JvmDiscoveryClient.EventKind; +import io.cryostat.core.sys.Environment; import io.cryostat.platform.AbstractPlatformClient; import io.cryostat.platform.ServiceRef; import io.cryostat.platform.ServiceRef.AnnotationKey; @@ -73,12 +74,14 @@ public class DockerPlatformClient extends AbstractPlatformClient { private final CopyOnWriteArrayList containers = new CopyOnWriteArrayList<>(); DockerPlatformClient( + Environment environment, Lazy webClient, Lazy vertx, SocketAddress dockerSocket, Lazy connectionToolkit, Gson gson, Logger logger) { + super(environment); this.webClient = webClient; this.vertx = vertx; this.dockerSocket = dockerSocket; diff --git a/src/main/java/io/cryostat/platform/internal/DockerPlatformStrategy.java b/src/main/java/io/cryostat/platform/internal/DockerPlatformStrategy.java index d96f0a378f..7da49e0478 100644 --- a/src/main/java/io/cryostat/platform/internal/DockerPlatformStrategy.java +++ b/src/main/java/io/cryostat/platform/internal/DockerPlatformStrategy.java @@ -23,6 +23,7 @@ import io.cryostat.core.log.Logger; import io.cryostat.core.net.JFRConnectionToolkit; +import io.cryostat.core.sys.Environment; import io.cryostat.core.sys.FileSystem; import io.cryostat.net.AuthManager; @@ -38,29 +39,32 @@ class DockerPlatformStrategy implements PlatformDetectionStrategy { private static final String DOCKER_SOCKET_PATH = "/var/run/docker.sock"; - private final Logger logger; private final Lazy authMgr; private final Lazy webClient; private final Lazy vertx; private final Lazy connectionToolkit; private final Gson gson; + private final Environment environment; private final FileSystem fs; + private final Logger logger; DockerPlatformStrategy( - Logger logger, Lazy authMgr, Lazy webClient, Lazy vertx, Lazy connectionToolkit, Gson gson, - FileSystem fs) { - this.logger = logger; + Environment environment, + FileSystem fs, + Logger logger) { this.authMgr = authMgr; this.webClient = webClient; this.vertx = vertx; this.connectionToolkit = connectionToolkit; this.gson = gson; + this.environment = environment; this.fs = fs; + this.logger = logger; } @Override @@ -129,7 +133,7 @@ private boolean testDockerApi() { public DockerPlatformClient getPlatformClient() { logger.info("Selected {} Strategy", getClass().getSimpleName()); return new DockerPlatformClient( - webClient, vertx, getSocket(), connectionToolkit, gson, logger); + environment, webClient, vertx, getSocket(), connectionToolkit, gson, logger); } @Override diff --git a/src/main/java/io/cryostat/platform/internal/KubeApiPlatformClient.java b/src/main/java/io/cryostat/platform/internal/KubeApiPlatformClient.java index f9dfdecdee..348bff56d5 100644 --- a/src/main/java/io/cryostat/platform/internal/KubeApiPlatformClient.java +++ b/src/main/java/io/cryostat/platform/internal/KubeApiPlatformClient.java @@ -35,6 +35,7 @@ import io.cryostat.core.log.Logger; import io.cryostat.core.net.JFRConnectionToolkit; import io.cryostat.core.net.discovery.JvmDiscoveryClient.EventKind; +import io.cryostat.core.sys.Environment; import io.cryostat.platform.AbstractPlatformClient; import io.cryostat.platform.ServiceRef; import io.cryostat.platform.ServiceRef.AnnotationKey; @@ -105,10 +106,12 @@ protected HashMap> initialize() new ConcurrentHashMap<>(); KubeApiPlatformClient( + Environment environment, Collection namespaces, KubernetesClient k8sClient, Lazy connectionToolkit, Logger logger) { + super(environment); this.namespaces = new HashSet<>(namespaces); this.k8sClient = k8sClient; this.connectionToolkit = connectionToolkit; diff --git a/src/main/java/io/cryostat/platform/internal/KubeApiPlatformStrategy.java b/src/main/java/io/cryostat/platform/internal/KubeApiPlatformStrategy.java index 1edaa583bc..14257e3c39 100644 --- a/src/main/java/io/cryostat/platform/internal/KubeApiPlatformStrategy.java +++ b/src/main/java/io/cryostat/platform/internal/KubeApiPlatformStrategy.java @@ -39,18 +39,18 @@ class KubeApiPlatformStrategy implements PlatformDetectionStrategy { - protected final Logger logger; protected final Lazy authMgr; protected final Environment env; protected final FileSystem fs; protected final Lazy connectionToolkit; + protected final Logger logger; KubeApiPlatformStrategy( - Logger logger, Lazy authMgr, Lazy connectionToolkit, Environment env, - FileSystem fs) { + FileSystem fs, + Logger logger) { this.logger = logger; this.authMgr = authMgr; this.connectionToolkit = connectionToolkit; @@ -73,7 +73,7 @@ public boolean isAvailable() { public KubeApiPlatformClient getPlatformClient() { logger.info("Selected {} Strategy", getClass().getSimpleName()); return new KubeApiPlatformClient( - getNamespaces(), createClient(), connectionToolkit, logger); + env, getNamespaces(), createClient(), connectionToolkit, logger); } @Override diff --git a/src/main/java/io/cryostat/platform/internal/OpenShiftPlatformStrategy.java b/src/main/java/io/cryostat/platform/internal/OpenShiftPlatformStrategy.java index 2b549d7d33..441c8c3626 100644 --- a/src/main/java/io/cryostat/platform/internal/OpenShiftPlatformStrategy.java +++ b/src/main/java/io/cryostat/platform/internal/OpenShiftPlatformStrategy.java @@ -28,12 +28,12 @@ class OpenShiftPlatformStrategy extends KubeApiPlatformStrategy { OpenShiftPlatformStrategy( - Logger logger, Lazy authMgr, Lazy connectionToolkit, Environment env, - FileSystem fs) { - super(logger, authMgr, connectionToolkit, env, fs); + FileSystem fs, + Logger logger) { + super(authMgr, connectionToolkit, env, fs, logger); } @Override diff --git a/src/main/java/io/cryostat/platform/internal/PlatformStrategyModule.java b/src/main/java/io/cryostat/platform/internal/PlatformStrategyModule.java index 1219eccea5..e7ca3bbc58 100644 --- a/src/main/java/io/cryostat/platform/internal/PlatformStrategyModule.java +++ b/src/main/java/io/cryostat/platform/internal/PlatformStrategyModule.java @@ -52,8 +52,8 @@ static WebClient provideUnixSocketWebClient(Vertx vertx) { @Provides @Singleton static CustomTargetPlatformClient provideCustomTargetPlatformClient( - Lazy storage) { - return new CustomTargetPlatformClient(storage); + Environment environment, Lazy storage) { + return new CustomTargetPlatformClient(environment, storage); } @Provides @@ -73,54 +73,70 @@ static OpenShiftPlatformStrategy provideOpenShiftPlatformStrategy( Lazy connectionToolkit, Environment env, FileSystem fs) { - return new OpenShiftPlatformStrategy(logger, authManager, connectionToolkit, env, fs); + return new OpenShiftPlatformStrategy(authManager, connectionToolkit, env, fs, logger); } @Provides @Singleton static KubeApiPlatformStrategy provideKubeApiPlatformStrategy( - Logger logger, Lazy noopAuthManager, Lazy connectionToolkit, Environment env, - FileSystem fs) { - return new KubeApiPlatformStrategy(logger, noopAuthManager, connectionToolkit, env, fs); + FileSystem fs, + Logger logger) { + return new KubeApiPlatformStrategy(noopAuthManager, connectionToolkit, env, fs, logger); } @Provides @Singleton static PodmanPlatformStrategy providePodmanPlatformStrategy( - Logger logger, Lazy noopAuthManager, @Named(UNIX_SOCKET_WEBCLIENT) Lazy webClient, Lazy vertx, Lazy connectionToolkit, Gson gson, - FileSystem fs) { + Environment environment, + FileSystem fs, + Logger logger) { return new PodmanPlatformStrategy( - logger, noopAuthManager, webClient, vertx, connectionToolkit, gson, fs); + noopAuthManager, + webClient, + vertx, + connectionToolkit, + gson, + environment, + fs, + logger); } @Provides @Singleton static DockerPlatformStrategy provideDockerPlatformStrategy( - Logger logger, Lazy noopAuthManager, @Named(UNIX_SOCKET_WEBCLIENT) Lazy webClient, Lazy vertx, Lazy connectionToolkit, Gson gson, - FileSystem fs) { + Environment environment, + FileSystem fs, + Logger logger) { return new DockerPlatformStrategy( - logger, noopAuthManager, webClient, vertx, connectionToolkit, gson, fs); + noopAuthManager, + webClient, + vertx, + connectionToolkit, + gson, + environment, + fs, + logger); } @Provides @Singleton static DefaultPlatformStrategy provideDefaultPlatformStrategy( - Logger logger, Lazy noopAuthManager) { + Environment environment, Lazy noopAuthManager, Logger logger) { return new DefaultPlatformStrategy( - logger, noopAuthManager, () -> new JvmDiscoveryClient(logger)); + environment, noopAuthManager, () -> new JvmDiscoveryClient(logger), logger); } @Provides diff --git a/src/main/java/io/cryostat/platform/internal/PodmanPlatformClient.java b/src/main/java/io/cryostat/platform/internal/PodmanPlatformClient.java index 453bfb554c..f50bb29937 100644 --- a/src/main/java/io/cryostat/platform/internal/PodmanPlatformClient.java +++ b/src/main/java/io/cryostat/platform/internal/PodmanPlatformClient.java @@ -41,6 +41,7 @@ import io.cryostat.core.log.Logger; import io.cryostat.core.net.JFRConnectionToolkit; import io.cryostat.core.net.discovery.JvmDiscoveryClient.EventKind; +import io.cryostat.core.sys.Environment; import io.cryostat.platform.AbstractPlatformClient; import io.cryostat.platform.ServiceRef; import io.cryostat.platform.ServiceRef.AnnotationKey; @@ -81,6 +82,7 @@ public class PodmanPlatformClient extends AbstractPlatformClient { private final CopyOnWriteArrayList containers = new CopyOnWriteArrayList<>(); PodmanPlatformClient( + Environment environment, ExecutorService executor, Lazy webClient, Lazy vertx, @@ -88,6 +90,7 @@ public class PodmanPlatformClient extends AbstractPlatformClient { Lazy connectionToolkit, Gson gson, Logger logger) { + super(environment); this.executor = executor; this.webClient = webClient; this.vertx = vertx; diff --git a/src/main/java/io/cryostat/platform/internal/PodmanPlatformStrategy.java b/src/main/java/io/cryostat/platform/internal/PodmanPlatformStrategy.java index c7f60d8a8c..4ccf204b53 100644 --- a/src/main/java/io/cryostat/platform/internal/PodmanPlatformStrategy.java +++ b/src/main/java/io/cryostat/platform/internal/PodmanPlatformStrategy.java @@ -24,6 +24,7 @@ import io.cryostat.core.log.Logger; import io.cryostat.core.net.JFRConnectionToolkit; +import io.cryostat.core.sys.Environment; import io.cryostat.core.sys.FileSystem; import io.cryostat.net.AuthManager; @@ -39,29 +40,32 @@ class PodmanPlatformStrategy implements PlatformDetectionStrategy { - private final Logger logger; private final Lazy authMgr; private final Lazy webClient; private final Lazy vertx; private final Lazy connectionToolkit; private final Gson gson; + private final Environment environment; private final FileSystem fs; + private final Logger logger; PodmanPlatformStrategy( - Logger logger, Lazy authMgr, Lazy webClient, Lazy vertx, Lazy connectionToolkit, Gson gson, - FileSystem fs) { - this.logger = logger; + Environment environment, + FileSystem fs, + Logger logger) { this.authMgr = authMgr; this.webClient = webClient; this.vertx = vertx; this.connectionToolkit = connectionToolkit; this.gson = gson; + this.environment = environment; this.fs = fs; + this.logger = logger; } @Override @@ -130,6 +134,7 @@ private boolean testPodmanApi() { public PodmanPlatformClient getPlatformClient() { logger.info("Selected {} Strategy", getClass().getSimpleName()); return new PodmanPlatformClient( + environment, Executors.newSingleThreadExecutor(), webClient, vertx, diff --git a/src/test/java/io/cryostat/platform/internal/CustomTargetPlatformClientTest.java b/src/test/java/io/cryostat/platform/internal/CustomTargetPlatformClientTest.java index 8dfa90f218..3bec19591c 100644 --- a/src/test/java/io/cryostat/platform/internal/CustomTargetPlatformClientTest.java +++ b/src/test/java/io/cryostat/platform/internal/CustomTargetPlatformClientTest.java @@ -24,6 +24,7 @@ import javax.management.remote.JMXServiceURL; import io.cryostat.core.net.discovery.JvmDiscoveryClient.EventKind; +import io.cryostat.core.sys.Environment; import io.cryostat.discovery.DiscoveryStorage; import io.cryostat.platform.ServiceRef; import io.cryostat.platform.TargetDiscoveryEvent; @@ -61,11 +62,12 @@ class CustomTargetPlatformClientTest { } } + @Mock Environment env; @Mock DiscoveryStorage storage; @BeforeEach void setup() { - this.client = new CustomTargetPlatformClient(() -> storage); + this.client = new CustomTargetPlatformClient(env, () -> storage); } @Test diff --git a/src/test/java/io/cryostat/platform/internal/DefaultPlatformClientTest.java b/src/test/java/io/cryostat/platform/internal/DefaultPlatformClientTest.java index a9dc33ccf6..76f9ee1106 100644 --- a/src/test/java/io/cryostat/platform/internal/DefaultPlatformClientTest.java +++ b/src/test/java/io/cryostat/platform/internal/DefaultPlatformClientTest.java @@ -34,6 +34,7 @@ import io.cryostat.core.net.discovery.JvmDiscoveryClient; import io.cryostat.core.net.discovery.JvmDiscoveryClient.EventKind; import io.cryostat.core.net.discovery.JvmDiscoveryClient.JvmDiscoveryEvent; +import io.cryostat.core.sys.Environment; import io.cryostat.platform.ServiceRef; import io.cryostat.platform.ServiceRef.AnnotationKey; import io.cryostat.platform.TargetDiscoveryEvent; @@ -56,13 +57,14 @@ @ExtendWith(MockitoExtension.class) class DefaultPlatformClientTest { - @Mock Logger logger; + @Mock Environment env; @Mock JvmDiscoveryClient discoveryClient; + @Mock Logger logger; DefaultPlatformClient client; @BeforeEach void setup() { - this.client = new DefaultPlatformClient(logger, discoveryClient); + this.client = new DefaultPlatformClient(env, discoveryClient, logger); } @Test diff --git a/src/test/java/io/cryostat/platform/internal/KubeApiPlatformClientTest.java b/src/test/java/io/cryostat/platform/internal/KubeApiPlatformClientTest.java index 4e85bffe22..c786581d8d 100644 --- a/src/test/java/io/cryostat/platform/internal/KubeApiPlatformClientTest.java +++ b/src/test/java/io/cryostat/platform/internal/KubeApiPlatformClientTest.java @@ -73,7 +73,7 @@ class KubeApiPlatformClientTest { void setup() throws Exception { this.platformClient = new KubeApiPlatformClient( - List.of(NAMESPACE), k8sClient, () -> connectionToolkit, logger); + env, List.of(NAMESPACE), k8sClient, () -> connectionToolkit, logger); } @Test