Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
fix: make sure names are kubernetes compatible names
Browse files Browse the repository at this point in the history
Fixes #723
  • Loading branch information
Delawen committed Jun 28, 2023
1 parent 411a91e commit b6915b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ private static void ensureUniqueNames(FlowsWrapper answer) {
}
//Make sure there is an id/name assigned to all flows
if (!flow.getMetadata().containsKey(name)) {
flow.getMetadata().put(name, flow.getDsl() + System.currentTimeMillis());
flow.getMetadata().put(name,
flow.getDsl().toLowerCase().replaceAll(" ", "") + System.currentTimeMillis());
}
//Make sure it is unique
if (usedIds.contains(flow.getMetadata().get(name))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ void uniqueName() throws IOException {
.entrySet();
assertEquals(flows.flows().size(), ids.size());
assertTrue(ids.stream().allMatch(id -> id.getValue() == 1l));
assertTrue(ids.stream().allMatch(id ->Pattern.matches( "([A-Za-z0-9])+", id.getKey().toString())));

//Let's assign the same name to all flows
var sameIdentifier = "sameIdentifier";
Expand Down

0 comments on commit b6915b8

Please sign in to comment.