Skip to content

Commit

Permalink
lessening the log level more and removing log and throw
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Apr 15, 2021
1 parent bc9cb46 commit 586829d
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,12 @@ public ReflectorWatcher(Store<T> store, AtomicReference<String> lastSyncResource
public void eventReceived(Action action, T resource) {
if (action == null) {
final String errorMessage = String.format("Unrecognized event %s", resource.getMetadata().getName());
log.error(errorMessage);
throw new KubernetesClientException(errorMessage);
}
log.debug("Event received {}", action.name());
log.trace("Event received {}", action.name());
switch (action) {
case ERROR:
final String errorMessage = String.format("ERROR event for %s", resource.getMetadata().getName());
log.error(errorMessage);
throw new KubernetesClientException(errorMessage);
case ADDED:
store.add(resource);
Expand All @@ -65,12 +63,12 @@ public void eventReceived(Action action, T resource) {
break;
}
lastSyncResourceVersion.set(resource.getMetadata().getResourceVersion());
log.debug("{}#Receiving resourceVersion {}", resource.getKind(), lastSyncResourceVersion.get());
log.trace("{}#Receiving resourceVersion {}", resource.getKind(), lastSyncResourceVersion.get());
}

@Override
public void onClose(WatcherException exception) {
log.error("Watch closing");
log.warn("Watch closing with exception", exception);
Optional.ofNullable(exception)
.map(e -> {
log.debug("Exception received during watch", e);
Expand All @@ -83,7 +81,7 @@ public void onClose(WatcherException exception) {

@Override
public void onClose() {
log.info("Watch gracefully closed");
log.debug("Watch gracefully closed");
onClose.run();
}
}

0 comments on commit 586829d

Please sign in to comment.