-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(java17): upgrade java runtime to JRE17 and compilation using JD…
…K17, but target remains Java11 While upgrading java 17, encountered below error during the test execution process of keel-core-test and keel-sql modules: ``` retrieves timestamp successfully SqlArtifactRepositoryTests retrieves timestamp successfully FAILED (11.5s) ▼ Expect that 2024-11-04T16:23:59.680067Z: ✗ is equal to 2024-11-04T16:23:59.680066531Z found 2024-11-04T16:23:59.680067Z ``` ``` SqlDeliveryConfigRepositoryTests deletes data successfully for known application FAILED (11.5s) org.jooq.exception.DataAccessException: SQL [insert into `keel`.`event` (`uid`, `scope`, `json`) values (?, ?, ?)]; Incorrect datetime value: '2024-11-04T16:47:17.740578522Z' for function str_to_date Caused by: java.sql.SQLException: Incorrect datetime value: '2024-11-04T16:47:17.740578522Z' for function str_to_date SqlDeliveryConfigRepositoryTests throws exception for unknown application FAILED (12.8s) org.jooq.exception.DataAccessException: SQL [insert into `keel`.`event` (`uid`, `scope`, `json`) values (?, ?, ?)]; Incorrect datetime value: '2024-11-04T16:47:29.434469839Z' for function str_to_date Caused by: java.sql.SQLException: Incorrect datetime value: '2024-11-04T16:47:29.434469839Z' for function str_to_date SqlDeliveryConfigRepositoryTests deletes related application events FAILED (12s) org.jooq.exception.DataAccessException: SQL [insert into `keel`.`event` (`uid`, `scope`, `json`) values (?, ?, ?)]; Incorrect datetime value: '2024-11-04T16:47:42.199694193Z' for function str_to_date Caused by: java.sql.SQLException: Incorrect datetime value: '2024-11-04T16:47:42.199694193Z' for function str_to_date SqlDeliveryConfigRepositoryTests deletes related resource events FAILED (12.6s) org.jooq.exception.DataAccessException: SQL [insert into `keel`.`event` (`uid`, `scope`, `json`) values (?, ?, ?)]; Incorrect datetime value: '2024-11-04T16:47:54.338147807Z' for function str_to_date Caused by: java.sql.SQLException: Incorrect datetime value: '2024-11-04T16:47:54.338147807Z' for function str_to_date SqlDeliveryConfigRepositoryTests deletes related application pause records FAILED (11.5s) org.jooq.exception.DataAccessException: SQL [insert into `keel`.`event` (`uid`, `scope`, `json`) values (?, ?, ?)]; Incorrect datetime value: '2024-11-04T16:48:06.896010045Z' for function str_to_date Caused by: java.sql.SQLException: Incorrect datetime value: '2024-11-04T16:48:06.896010045Z' for function str_to_date SqlDeliveryConfigRepositoryTests deletes related resource pause records FAILED (12.6s) org.jooq.exception.DataAccessException: SQL [insert into `keel`.`event` (`uid`, `scope`, `json`) values (?, ?, ?)]; Incorrect datetime value: '2024-11-04T16:48:18.409434437Z' for function str_to_date Caused by: java.sql.SQLException: Incorrect datetime value: '2024-11-04T16:48:18.409434437Z' for function str_to_date SqlDeliveryConfigRepositoryTests deletes any older versions of resources FAILED (11.8s) org.jooq.exception.DataAccessException: SQL [insert into `keel`.`event` (`uid`, `scope`, `json`) values (?, ?, ?)]; Incorrect datetime value: '2024-11-04T16:48:31.166252032Z' for function str_to_date Caused by: java.sql.SQLException: Incorrect datetime value: '2024-11-04T16:48:31.166252032Z' for function str_to_date SqlDeliveryConfigRepositoryTests deletes data successfully for known delivery config FAILED (11.7s) org.jooq.exception.DataAccessException: SQL [insert into `keel`.`event` (`uid`, `scope`, `json`) values (?, ?, ?)]; Incorrect datetime value: '2024-11-04T16:48:42.855107042Z' for function str_to_date Caused by: java.sql.SQLException: Incorrect datetime value: '2024-11-04T16:48:42.855107042Z' for function str_to_date SqlDeliveryConfigRepositoryTests throws exception for unknown delivery config FAILED (12.1s) org.jooq.exception.DataAccessException: SQL [insert into `keel`.`event` (`uid`, `scope`, `json`) values (?, ?, ?)]; Incorrect datetime value: '2024-11-04T16:48:54.920960756Z' for function str_to_date Caused by: java.sql.SQLException: Incorrect datetime value: '2024-11-04T16:48:54.920960756Z' for function str_to_date ``` The error occurred due to change in behaviour of `java.time.Instant` class from Java 11 to Java 17. In Java 17, Instant class returns clock with precision of microsecond and nanosecond based on underlying system, which is not the case with Java 11. This causes the MYSQL str_to_date function fail while data insertion. In order to fix this issue, truncated the microseconds from the Instant. https://stackoverflow.com/questions/74781495/changes-in-instant-now-between-java-11-and-java-17-in-aws-ubuntu-standard-6-0
- Loading branch information
Showing
14 changed files
with
137 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM alpine:3.11 | ||
LABEL maintainer="sig-platform@spinnaker.io" | ||
RUN apk --no-cache add --update bash openjdk11-jre | ||
RUN addgroup -S -g 10111 spinnaker | ||
RUN adduser -S -G spinnaker -u 10111 spinnaker | ||
COPY keel-web/build/install/keel /opt/keel | ||
RUN mkdir -p /opt/keel/plugins && chown -R spinnaker:nogroup /opt/keel/plugins | ||
USER spinnaker | ||
CMD ["/opt/keel/bin/keel"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM ubuntu:bionic | ||
LABEL maintainer="sig-platform@spinnaker.io" | ||
RUN apt-get update && apt-get -y install openjdk-11-jre-headless wget | ||
RUN adduser --system --uid 10111 --group spinnaker | ||
COPY keel-web/build/install/keel /opt/keel | ||
RUN mkdir -p /opt/keel/plugins && chown -R spinnaker:nogroup /opt/keel/plugins | ||
USER spinnaker | ||
CMD ["/opt/keel/bin/keel"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.