Skip to content

Commit

Permalink
Merge pull request #40 from DiSSCo/bug-fix/db-url
Browse files Browse the repository at this point in the history
Match translator db url to orechstration backend
  • Loading branch information
samleeflang authored Apr 24, 2024
2 parents 34a6597 + 7c49dd9 commit c3eb058
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/.trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# April 18 2024
# Spring boot needs to update its version of spring
CVE-2024-22262
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
Expand All @@ -24,4 +25,8 @@ public class TranslatorJobProperties {
@NotBlank
private String namespace = "translator-services";

@NotBlank
@Value("${spring.datasource.url}")
private String databaseUrl;

}
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ private Map<String, Object> getTemplateProperties(SourceSystemRecord sourceSyste
map.put("containerName", jobName);
map.put("kafkaHost", jobProperties.getKafkaHost());
map.put("kafkaTopic", jobProperties.getKafkaTopic());
map.put("database_url", jobProperties.getDatabaseUrl());
if (isCronJob) {
map.put("cron", generateCron());
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/biocase-cron-job.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
- name: webclient.sourceSystemId
value: ${sourceSystemId}
- name: spring.datasource.url
value: jdbc:postgresql://terraform-20230822143945532600000001.cbppwfnjypll.eu-west-2.rds.amazonaws.com:5432/dissco
value: ${database_url}
- name: spring.datasource.username
valueFrom:
secretKeyRef:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/biocase-translator-job.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
- name: webclient.sourceSystemId
value: ${sourceSystemId}
- name: spring.datasource.url
value: jdbc:postgresql://terraform-20230822143945532600000001.cbppwfnjypll.eu-west-2.rds.amazonaws.com:5432/dissco
value: ${database_url}
- name: spring.datasource.username
valueFrom:
secretKeyRef:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/dwca-cron-job.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
- name: webclient.sourceSystemId
value: ${sourceSystemId}
- name: spring.datasource.url
value: jdbc:postgresql://terraform-20230822143945532600000001.cbppwfnjypll.eu-west-2.rds.amazonaws.com:5432/dissco
value: ${database_url}
- name: spring.datasource.username
valueFrom:
secretKeyRef:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/dwca-translator-job.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
- name: webclient.sourceSystemId
value: ${sourceSystemId}
- name: spring.datasource.url
value: jdbc:postgresql://terraform-20230822143945532600000001.cbppwfnjypll.eu-west-2.rds.amazonaws.com:5432/dissco
value: ${database_url}
- name: spring.datasource.username
valueFrom:
secretKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class SourceSystemServiceTest {

@BeforeEach
void setup() throws IOException {
jobProperties.setDatabaseUrl("jdbc:postgresql://localhost:5432/translator");
service = new SourceSystemService(builder, handleComponent, repository, mappingService,
kafkaPublisherService, MAPPER, yamlMapper, jobProperties, configuration, batchV1Api, random);
initTime();
Expand Down

0 comments on commit c3eb058

Please sign in to comment.