File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 55import java .util .concurrent .ExecutorService ;
66import java .util .concurrent .Executors ;
77
8+ import org .slf4j .Logger ;
9+ import org .slf4j .LoggerFactory ;
10+
811import io .fabric8 .kubernetes .api .model .HasMetadata ;
912import io .fabric8 .kubernetes .client .Config ;
1013import io .fabric8 .kubernetes .client .CustomResource ;
@@ -150,6 +153,12 @@ default Optional<LeaderElectionConfiguration> getLeaderElectionConfiguration() {
150153 }
151154
152155 default Optional <InformerStoppedHandler > getInformerStoppedHandler () {
153- return Optional .empty ();
156+ return Optional .of ((informer , ex ) -> {
157+ if (ex != null ) {
158+ Logger log = LoggerFactory .getLogger (ConfigurationService .class );
159+ log .error ("Fatal error in informer: {}. Stopping the operator" , informer , ex );
160+ System .exit (1 );
161+ }
162+ });
154163 }
155164}
You can’t perform that action at this time.
0 commit comments