Do not add affinity trait to "raw" components

Change-Id: I33bc1c500c515816fe4c0378d65564456d548f20
This commit is contained in:
Rudi Schlatte 2024-06-03 12:29:36 +02:00
parent 55f4340560
commit 6a4e06360a
2 changed files with 5 additions and 3 deletions
optimiser-controller/src/main/java/eu/nebulouscloud/optimiser/controller

@ -52,6 +52,9 @@ public class ExnConnector {
private static final ObjectMapper mapper = new ObjectMapper();
/** The topic where we listen for app creation messages. */
// Note that there is another, earlier app creation message sent via the
// channel `eu.nebulouscloud.ui.application.new`, but its format is not
// yet defined as of 2024-01-08.
public static final String app_creation_channel = "eu.nebulouscloud.ui.dsl.generic";
/** The topic where we listen for app reset messages. */
public static final String app_reset_channel = "eu.nebulouscloud.optimiser.controller.app_reset";
@ -227,9 +230,6 @@ public class ExnConnector {
* object. If we already received the performance indicators from the
* utility evaluator, perform initial deployment; otherwise, wait.
*/
// Note that there is another, earlier app creation message sent via the
// channel `eu.nebulouscloud.ui.application.new`, but its format is not
// yet defined as of 2024-01-08.
public class AppCreationMessageHandler extends Handler {
@Override
public void onMessage(String key, String address, Map body, Message message, Context context) {

@ -78,6 +78,8 @@ public class NebulousAppDeployer {
public static JsonNode createDeploymentKubevela(JsonNode kubevela) {
JsonNode result = kubevela.deepCopy();
for (final JsonNode c : result.withArray("/spec/components")) {
// Do not add trait to components that define a volume
if (c.at("/type").asText().equals("raw")) continue;
String name = c.get("name").asText();
// Add traits
ArrayNode traits = c.withArray("traits");