Use correct environment variable message format

Change-Id: I6885f1b3f376d146f3005e278bc40e27294a0965
This commit is contained in:
Rudi Schlatte 2024-05-14 16:59:56 +02:00
parent 3961547bf5
commit 4557a44823

View File

@ -406,9 +406,16 @@ public class NebulousAppDeployer {
}); });
ObjectNode environment = cluster.withObject("/env-var"); ObjectNode environment = cluster.withObject("/env-var");
environment.put("APPLICATION_ID", appUUID); environment.put("APPLICATION_ID", appUUID);
// TODO: pre-parse environment variables, put them into NebulousApp // TODO: consider pre-parsing environment variables and storing them
// in the app object instead of reading them from the raw dsl message
// here
for (final JsonNode v : app.getOriginalAppMessage().withArray("/environmentVariables")) { for (final JsonNode v : app.getOriginalAppMessage().withArray("/environmentVariables")) {
v.fields().forEachRemaining (field -> environment.put(field.getKey(), field.getValue().asText())); if (v.has("name") && v.has("value") && v.get("name").isTextual()) {
// TODO: figure out what to do with the `"secret":true` field
environment.put(v.get("name").asText(), v.get("value").asText());
} else {
log.warn("Invalid environmentVariables entry: {}", v);
}
} }
log.info("Calling defineCluster"); log.info("Calling defineCluster");
boolean defineClusterSuccess = conn.defineCluster(appUUID, clusterName, cluster); boolean defineClusterSuccess = conn.defineCluster(appUUID, clusterName, cluster);