File tree 1 file changed +10
-1
lines changed
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 5
5
import java .util .concurrent .ExecutorService ;
6
6
import java .util .concurrent .Executors ;
7
7
8
+ import org .slf4j .Logger ;
9
+ import org .slf4j .LoggerFactory ;
10
+
8
11
import io .fabric8 .kubernetes .api .model .HasMetadata ;
9
12
import io .fabric8 .kubernetes .client .Config ;
10
13
import io .fabric8 .kubernetes .client .CustomResource ;
@@ -150,6 +153,12 @@ default Optional<LeaderElectionConfiguration> getLeaderElectionConfiguration() {
150
153
}
151
154
152
155
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
+ });
154
163
}
155
164
}
You can’t perform that action at this time.
0 commit comments