Skip to content

Commit

Permalink
Do not add affinity trait to "raw" components
Browse files Browse the repository at this point in the history
Change-Id: I33bc1c500c515816fe4c0378d65564456d548f20
  • Loading branch information
rudi committed Jun 3, 2024
1 parent 55f4340 commit 6a4e063
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -227,9 +230,6 @@ public synchronized void stop() {
* 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public static List<Requirement> getControllerRequirements(String jobID, Set<Stri
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");
Expand Down

0 comments on commit 6a4e063

Please sign in to comment.