File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
operator-framework-core/src/main/java/io/javaoperatorsdk/operator Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 11package io .javaoperatorsdk .operator ;
22
33import java .io .IOException ;
4+ import java .net .ConnectException ;
45import java .util .LinkedList ;
56import java .util .List ;
67import java .util .concurrent .locks .ReentrantLock ;
@@ -87,8 +88,14 @@ public void start() {
8788 log .info ("Server version: {}.{}" , k8sVersion .getMajor (), k8sVersion .getMinor ());
8889 }
8990 } catch (Exception e ) {
90- log .error ("Error retrieving the server version. Exiting!" , e );
91- throw new OperatorException ("Error retrieving the server version" , e );
91+ final String error ;
92+ if (e .getCause () instanceof ConnectException ) {
93+ error = "Cannot connect to cluster" ;
94+ } else {
95+ error = "Error retrieving the server version" ;
96+ }
97+ log .error (error , e );
98+ throw new OperatorException (error , e );
9299 }
93100
94101 controllers .parallelStream ().forEach (ConfiguredController ::start );
You can’t perform that action at this time.
0 commit comments