File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 66import java .time .Instant ;
77import java .util .Date ;
88import java .util .Properties ;
9+ import org .slf4j .Logger ;
10+ import org .slf4j .LoggerFactory ;
911
1012public class Utils {
1113
14+ private static final Logger log = LoggerFactory .getLogger (Utils .class );
15+
1216 public static Version loadFromProperties () {
1317 final var is =
1418 Thread .currentThread ().getContextClassLoader ().getResourceAsStream ("version.properties" );
19+
1520 final var properties = new Properties ();
16- try {
17- properties .load (is );
18- } catch (IOException e ) {
19- e .printStackTrace ();
21+ if (is != null ) {
22+ try {
23+ properties .load (is );
24+ } catch (IOException e ) {
25+ log .warn ("Couldn't load version information: {}" , e .getMessage ());
26+ }
27+ } else {
28+ log .warn ("Couldn't find version.properties file. Default version information will be used." );
2029 }
2130
2231 Date builtTime ;
You can’t perform that action at this time.
0 commit comments