Use env variable as default for configs
@@ -126,7 +126,13 @@ public class ConsulSpConfig extends SpConfig implements Runnable {
Optional<String> i = kvClient.getValueAsString(addSn(key));
// TODO this check does not work
if (!i.isPresent()) {
+ String envVariable = System.getenv(key);
+ if (envVariable != null) {
+ kvClient.putValue(addSn(key), envVariable);
+ } else {
kvClient.putValue(addSn(key), defaultValue);
+ }
+
kvClient.putValue(addSn(key) + "_description", description);
kvClient.putValue(addSn(key) + "_type", valueType);
if(isPassword)
