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 6
6
import java .time .Instant ;
7
7
import java .util .Date ;
8
8
import java .util .Properties ;
9
+ import org .slf4j .Logger ;
10
+ import org .slf4j .LoggerFactory ;
9
11
10
12
public class Utils {
11
13
14
+ private static final Logger log = LoggerFactory .getLogger (Utils .class );
15
+
12
16
public static Version loadFromProperties () {
13
17
final var is =
14
18
Thread .currentThread ().getContextClassLoader ().getResourceAsStream ("version.properties" );
19
+
15
20
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." );
20
29
}
21
30
22
31
Date builtTime ;
You can’t perform that action at this time.
0 commit comments