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 1
1
package io .javaoperatorsdk .operator ;
2
2
3
3
import java .io .IOException ;
4
+ import java .net .ConnectException ;
4
5
import java .util .LinkedList ;
5
6
import java .util .List ;
6
7
import java .util .concurrent .locks .ReentrantLock ;
@@ -87,8 +88,14 @@ public void start() {
87
88
log .info ("Server version: {}.{}" , k8sVersion .getMajor (), k8sVersion .getMinor ());
88
89
}
89
90
} 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 );
92
99
}
93
100
94
101
controllers .parallelStream ().forEach (ConfiguredController ::start );
You can’t perform that action at this time.
0 commit comments