Skip to content

Commit

Permalink
Revert behavior for no rules in detector
Browse files Browse the repository at this point in the history
Signed-off-by: Chase Engelbrecht <[email protected]>
  • Loading branch information
engechas committed Mar 15, 2024
1 parent 4ee977d commit ef94468
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ private void createMonitorFromQueries(String index, List<Pair<String, Rule>> rul
}, listener::onFailure);
}, listener::onFailure);
} else {
// Failure if detector doesn't have any monitor
// Do nothing if detector doesn't have any monitor
if (monitorRequests.isEmpty()) {
listener.onFailure(new OpenSearchStatusException("Detector cannot be created as no compatible rules were provided", RestStatus.BAD_REQUEST));
listener.onResponse(Collections.emptyList());
return;
}
List<IndexMonitorResponse> monitorResponses = new ArrayList<>();
Expand Down

0 comments on commit ef94468

Please sign in to comment.