Skip to content

Commit

Permalink
Filter out empty region names
Browse files Browse the repository at this point in the history
We drop any region names where `name.isBlank()` is true.  Specifically,
an empty or missing region attribute will not result in us trying to
filter with an empty region name.

Fixes #36
  • Loading branch information
rudi committed Oct 21, 2024
1 parent 9f5fb40 commit f4a44ed
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ public NebulousApp(JsonNode app_message, String kubevela_string, ExnConnector ex
.filter((c) -> c.at("/enabled").asBoolean())
.collect(Collectors.toMap(
(c) -> c.at("/uuid").asText(),
(c) -> Arrays.stream(c.at("/regions").asText().split(",")).collect(Collectors.toSet())));
(c) -> Arrays.stream(c.at("/regions").asText().split(","))
.filter(regionName -> !regionName.isBlank())
.collect(Collectors.toSet())));
if (clouds.isEmpty()) {
log.error("No enabled clouds given in app creation message, setting app status to FAILED and aborting deployment.");
this.setStateFailed();
Expand Down

0 comments on commit f4a44ed

Please sign in to comment.