Skip to content

Commit

Permalink
Use correct environment variable message format
Browse files Browse the repository at this point in the history
Change-Id: I6885f1b3f376d146f3005e278bc40e27294a0965
  • Loading branch information
rudi committed May 14, 2024
1 parent 3961547 commit 4557a44
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,16 @@ public static void deployApplication(NebulousApp app, JsonNode kubevela) {
});
ObjectNode environment = cluster.withObject("/env-var");
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")) {
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");
boolean defineClusterSuccess = conn.defineCluster(appUUID, clusterName, cluster);
Expand Down

0 comments on commit 4557a44

Please sign in to comment.