Unverified Commit 73fba0e6 authored by Martin Lowe's avatar Martin Lowe 🇨🇦 Committed by GitHub
Browse files

Update to JAVA_OPTIONS to include k8s config path by default (#3)


Signed-off-by: Martin Lowe's avatarMartin Lowe <martin.lowe@eclipse-foundation.org>
parent 112d2a5d
......@@ -34,9 +34,9 @@ import org.slf4j.LoggerFactory;
*/
public class SecretConfigSource implements ConfigSource {
private static final Logger LOGGER = LoggerFactory.getLogger(SecretConfigSource.class);
private static final String DEFAULT_SECRET_LOCATION = "/run/secrets/secret.properties";
private Map<String, String> secrets;
@Override
......@@ -46,10 +46,12 @@ public class SecretConfigSource implements ConfigSource {
String secretPath = System.getProperty("config.secret.path");
// Fallback to checking env if not set in JVM
if (secretPath == null || "".equals(secretPath.trim())) {
secretPath = System.getenv("config.secret.path");
secretPath = System.getenv("CONFIG_SECRET_PATH");
}
if (secretPath == null || "".equals(secretPath.trim())) {
LOGGER.error("Configuration 'config.secret.path' not set, using default value of " + DEFAULT_SECRET_LOCATION);
LOGGER.error(
"Configuration 'config.secret.path' and environment variable of 'CONFIG_SECRET_PATH' not set, using default value of "
+ DEFAULT_SECRET_LOCATION);
secretPath = DEFAULT_SECRET_LOCATION;
}
// load the secrets file in
......
......@@ -28,7 +28,9 @@ spec:
requests:
cpu: 200m
memory: 512Mi
args: ["-Dconfig.secret.path=/run/secrets/git-eca-rest-api/secret.properties"]
env:
- name: CONFIG_SECRET_PATH
value: "/run/secrets/git-eca-rest-api/secret.properties"
volumeMounts:
- name: api-oauth-token
mountPath: "/run/secrets/git-eca-rest-api"
......
......@@ -28,7 +28,9 @@ spec:
requests:
cpu: 100m
memory: 512Mi
args: ["-Dconfig.secret.path=/run/secrets/git-eca-rest-api/secret.properties"]
env:
- name: CONFIG_SECRET_PATH
value: "/run/secrets/git-eca-rest-api/secret.properties"
volumeMounts:
- name: api-oauth-token
mountPath: "/run/secrets/git-eca-rest-api"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment