Skip to content

Commit

Permalink
update token mount path
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Jun 7, 2023
1 parent 2affb1a commit 839ad09
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -79,7 +81,7 @@ protected OpenShiftClient createClient() {
public Map<String, String> environment() {
Map<String, String> env = new HashMap<>(super.environment());
String token = getInsightsToken();
if (token != null) {
if (StringUtils.isNotBlank(token)) {
env.put("INSIGHTS_TOKEN", token);
}
return env;
Expand All @@ -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;
}
}
Expand Down

0 comments on commit 839ad09

Please sign in to comment.