Skip to content

Commit 6636f37

Browse files
committed
fix: proper date parsing after update to git-commit-id 8.0.0
Signed-off-by: Chris Laprun <[email protected]>
1 parent f68b486 commit 6636f37

File tree

1 file changed

+8
-2
lines changed
  • core/runtime/src/main/java/io/quarkiverse/operatorsdk/runtime

1 file changed

+8
-2
lines changed

core/runtime/src/main/java/io/quarkiverse/operatorsdk/runtime/Version.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,14 @@ public static Version loadFromProperties() {
7777

7878
Date builtTime;
7979
try {
80-
builtTime = (new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")).parse(properties.getProperty("git.build.time"));
81-
} catch (ParseException var4) {
80+
String time = properties.getProperty("git.build.time");
81+
if (time != null) {
82+
builtTime = Date.from(Instant.parse(time));
83+
} else {
84+
builtTime = Date.from(Instant.EPOCH);
85+
}
86+
} catch (Exception e) {
87+
log.debug("Couldn't parse git.build.time property", e);
8288
builtTime = Date.from(Instant.EPOCH);
8389
}
8490

0 commit comments

Comments
 (0)