File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
operator-framework-core/src/main/java/io/javaoperatorsdk/operator Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,8 @@ public void start() {
102
102
controllers .start ();
103
103
} catch (Exception e ) {
104
104
log .error ("Error starting operator" , e );
105
- System .exit (1 );
105
+ stop ();
106
+ throw e ;
106
107
}
107
108
}
108
109
@@ -209,10 +210,6 @@ public synchronized void start() {
209
210
}
210
211
211
212
public synchronized void stop () {
212
- if (!started ) {
213
- return ;
214
- }
215
-
216
213
this .controllers .values ().parallelStream ().forEach (closeable -> {
217
214
log .debug ("closing {}" , closeable );
218
215
closeable .stop ();
Original file line number Diff line number Diff line change @@ -332,6 +332,7 @@ public void start() throws OperatorException {
332
332
333
333
log .info ("'{}' controller started, pending event sources initialization" , controllerName );
334
334
} catch (MissingCRDException e ) {
335
+ stop ();
335
336
throwMissingCRDException (crdName , specVersion , controllerName );
336
337
}
337
338
}
You can’t perform that action at this time.
0 commit comments