Skip to content

Commit

Permalink
improvement: logging on informer stopping (#1726)
Browse files Browse the repository at this point in the history
  • Loading branch information
csviri authored Jan 20, 2023
1 parent 9db9e8e commit 05de5e0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
/** An interface from which to retrieve configuration information. */
public interface ConfigurationService {

Logger log = LoggerFactory.getLogger(ConfigurationService.class);

/**
* Retrieves the configuration associated with the specified reconciler
*
Expand Down Expand Up @@ -188,9 +190,10 @@ default Optional<InformerStoppedHandler> getInformerStoppedHandler() {
// hasSynced is checked to verify that informer already started. If not started, in case
// of a fatal error the operator will stop, no need for explicit exit.
if (ex != null && informer.hasSynced()) {
Logger log = LoggerFactory.getLogger(ConfigurationService.class);
log.error("Fatal error in informer: {}. Stopping the operator", informer, ex);
System.exit(1);
} else {
log.debug("Informer stopped: {}. Error: {}", informer, ex);
}
});
}
Expand Down

0 comments on commit 05de5e0

Please sign in to comment.