Skip to content

Commit

Permalink
Fix storage reporting to ignore un-resolvable connectors
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Rögner <[email protected]>
  • Loading branch information
roegi committed Nov 19, 2021
1 parent 7640c13 commit 1eff9d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ protected void getConnector(Marker marker, String connectorId, Handler<AsyncResu
ar -> {
if (ar.failed()) {
logger.error(marker, "Error getting connector with ID {}", connectorId, ar.cause());
handler.handle(Future.failedFuture("Error getting connector with ID " + connectorId));
handler.handle(Future.failedFuture(new RuntimeException("Error getting connector with ID " + connectorId, ar.cause())));
}
else {
Item item = (Item) ar.result();
if (item == null) {
logger.debug(marker, "connector ID [{}]: This configuration does not exist", connectorId);
handler.handle(Future.failedFuture("The connector config was not found for connector ID: " + connectorId));
handler.handle(Future.failedFuture(new RuntimeException("The connector config was not found for connector ID: " + connectorId)));
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ private static String resolveSpaceId(Space space) {

private static Future<StorageStatistics> fetchFromStorage(Marker marker, String storageId, List<String> spaceIds) {
return Space.resolveConnector(marker, storageId)
.compose(storage -> storage.capabilities.storageUtilizationReporting ?
fetchFromStorage(marker, storage, spaceIds) : Future.succeededFuture(null));
.compose(storage -> storage.capabilities.storageUtilizationReporting ? //Ignore if the connector can not be resolved
fetchFromStorage(marker, storage, spaceIds) : Future.succeededFuture(null), t -> Future.succeededFuture(null));
}

private static Future<StorageStatistics> fetchFromStorage(Marker marker, Connector storage, List<String> spaceIds) {
Expand Down

0 comments on commit 1eff9d5

Please sign in to comment.