diff --git a/src/main/java/io/cryostat/platform/internal/OpenShiftPlatformStrategy.java b/src/main/java/io/cryostat/platform/internal/OpenShiftPlatformStrategy.java index c23580b0dd..4211e4daad 100644 --- a/src/main/java/io/cryostat/platform/internal/OpenShiftPlatformStrategy.java +++ b/src/main/java/io/cryostat/platform/internal/OpenShiftPlatformStrategy.java @@ -51,10 +51,12 @@ import dagger.Lazy; import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.openshift.client.OpenShiftClient; +import org.apache.commons.lang3.StringUtils; class OpenShiftPlatformStrategy extends KubeApiPlatformStrategy { - static final String INSIGHTS_TOKEN_PATH = "/var/run/TODO"; + static final String INSIGHTS_TOKEN_PATH = + "/var/run/secrets/operator.cryostat.io/insights-token/token"; OpenShiftPlatformStrategy( Logger logger, @@ -79,7 +81,7 @@ protected OpenShiftClient createClient() { public Map environment() { Map env = new HashMap<>(super.environment()); String token = getInsightsToken(); - if (token != null) { + if (StringUtils.isNotBlank(token)) { env.put("INSIGHTS_TOKEN", token); } return env; @@ -89,7 +91,7 @@ private String getInsightsToken() { try { return fs.readString(Paths.get(INSIGHTS_TOKEN_PATH)); } catch (IOException e) { - logger.trace(e); + logger.warn(e); return null; } }