diff --git a/CHANGELOG.md b/CHANGELOG.md index ceb086b7..4c476089 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] - The customer already gets an email from Portal and the third-Party-provider after the successful deployment that the SDE-Service is ready to use. If the connector End2End test is unsuccessful (this might be based on the cloud communication issue), the customer will be informed about the failing connectivity. This behavior might need to be clarified for the customer. We will change this behavior in the next release. + + +## [1.5.3] - 2023-10-30 + +### Changed + - Refactor DT registry local use ## [1.5.2] - 2023-10-27 @@ -14,7 +20,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Email send refactor - Refactor s3 policy template use - ## [1.5.1] - 2023-10-16 ### Changed diff --git a/README.md b/README.md index d1cadef6..6a5ae162 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ This service will help service provider to set up DFT/SDE with EDC and EDC as se ### Software Version ```shell -Application version: 1.5.2 -Helm release version: 1.5.2 +Application version: 1.5.3 +Helm release version: 1.5.3 ``` # Container images diff --git a/charts/orchestrator/Chart.yaml b/charts/orchestrator/Chart.yaml index 5cd1ab17..364bafcf 100644 --- a/charts/orchestrator/Chart.yaml +++ b/charts/orchestrator/Chart.yaml @@ -38,13 +38,13 @@ sources: # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.5.2 +version: 1.5.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "1.5.2" +appVersion: "1.5.3" dependencies: - condition: postgresql.enabled diff --git a/pom.xml b/pom.xml index f6d91efd..b9be3e63 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ org.eclipse.tractusx managed-service-orchestrator - 1.5.2 + 1.5.3 managed-service-orchestrator managed-service-orchestrator diff --git a/src/main/java/org/eclipse/tractusx/autosetup/manager/DTRegistryManager.java b/src/main/java/org/eclipse/tractusx/autosetup/manager/DTRegistryManager.java index 8087824a..3e3b4478 100644 --- a/src/main/java/org/eclipse/tractusx/autosetup/manager/DTRegistryManager.java +++ b/src/main/java/org/eclipse/tractusx/autosetup/manager/DTRegistryManager.java @@ -39,6 +39,7 @@ import org.eclipse.tractusx.autosetup.model.SelectedTools; import org.eclipse.tractusx.autosetup.utility.LogUtil; import org.eclipse.tractusx.autosetup.utility.WaitingTimeUtility; +import org.springframework.beans.factory.annotation.Value; import org.springframework.retry.annotation.Backoff; import org.springframework.retry.annotation.Retryable; import org.springframework.retry.support.RetrySynchronizationManager; @@ -59,6 +60,9 @@ public class DTRegistryManager { private final EDCProxyService eDCProxyService; + @Value("${managed.dt-registry.local:true}") + private boolean managedDTRegistryLocal; + @Retryable(retryFor = { ServiceException.class }, maxAttemptsExpression = "${retry.maxAttempts}", backoff = @Backoff(delayExpression = "#{${retry.backOffDelay}}")) public Map managePackage(Customer customerDetails, AppActions action, SelectedTools tool, @@ -74,8 +78,17 @@ public Map managePackage(Customer customerDetails, AppActions ac String dturi = sDEConfigurationProperty.getDtregistryApiUri(); dturi = StringUtils.isAllEmpty(dturi) ? "/api/v3.0" : dturi; - String dtregistryUrl = dnsNameURLProtocol + "://" + dnsName + "/" - + sDEConfigurationProperty.getDtregistryUrlPrefix() + dturi; + if (managedDTRegistryLocal) { + String appName = DT_REGISTRY.name().replace("_", ""); + String localDTUrl = "http://cx-" + packageName + "-" + appName.toLowerCase() + "-registry-svc:8080"; + inputData.put("dtregistryUrl", localDTUrl); + inputData.put("dtregistryUrlWithURI", localDTUrl + dturi); + } else { + String dtregistryUrl = dnsNameURLProtocol + "://" + dnsName + "/" + + sDEConfigurationProperty.getDtregistryUrlPrefix() + dturi; + inputData.put("dtregistryUrl", dtregistryUrl); + inputData.put("dtregistryUrlWithURI", dtregistryUrl + dturi); + } inputData.put("rgdatabase", "registry"); inputData.put("rgdbpass", "admin@123"); @@ -84,8 +97,7 @@ public Map managePackage(Customer customerDetails, AppActions ac inputData.put("idpIssuerUri", sDEConfigurationProperty.getResourceServerIssuer()); inputData.put("tenantId", sDEConfigurationProperty.getDtregistrytenantId()); inputData.put("dtregistryUrlPrefix", sDEConfigurationProperty.getDtregistryUrlPrefix()); - - inputData.put("dtregistryUrl", dtregistryUrl); + inputData.put("dtregistryURI", dturi); if (AppActions.CREATE.equals(action)) appManagement.createPackage(DT_REGISTRY, packageName, inputData); diff --git a/src/main/java/org/eclipse/tractusx/autosetup/service/AutoSetupOrchitestratorService.java b/src/main/java/org/eclipse/tractusx/autosetup/service/AutoSetupOrchitestratorService.java index 12ec60f4..d49893be 100644 --- a/src/main/java/org/eclipse/tractusx/autosetup/service/AutoSetupOrchitestratorService.java +++ b/src/main/java/org/eclipse/tractusx/autosetup/service/AutoSetupOrchitestratorService.java @@ -638,7 +638,7 @@ private List> extractDTResultMap(Map outputM Map dt = new LinkedHashMap<>(); dt.put("name", "DT"); - dt.put("dtregistryUrl", outputMap.get("dtregistryUrl")); + dt.put("dtregistryUrlWithURI", outputMap.get("dtregistryUrlWithURI")); dt.put("idpClientId", outputMap.get("idpClientId")); processResult.add(dt); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 145f89a1..ebbc164c 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -130,7 +130,7 @@ edc.ssi.authorityId=${edc_ssi_authorityId} #Flag to make optional use of managed DT regitry, if value not set default value is true managed.dt-registry=true - +managed.dt-registry.local=true #automatic storage Media for minio automatic.storage.media=true diff --git a/src/main/resources/flyway/V9__update_app_version.sql b/src/main/resources/flyway/V9__update_app_version.sql index 085cb369..b0a499d7 100644 --- a/src/main/resources/flyway/V9__update_app_version.sql +++ b/src/main/resources/flyway/V9__update_app_version.sql @@ -86,9 +86,9 @@ update app_tbl set expected_input_data='{ spring.jpa.open-in-view=false - digital-twins.hostname=http://cx-dt-sdeedctx-dtregistry-registry-svc:8080 + digital-twins.hostname=$\{dtregistryUrl\} - digital-twins.api=/api/v3.0 + digital-twins.api=$\{dtregistryURI\} digital-twins.authentication.url=$\{sde.digital-twins.authentication.url\} @@ -311,6 +311,6 @@ update app_tbl set expected_input_data= '{ "tls": false } } -}', package_version='0.3.24' where app_name='DT_REGISTRY'; +}', package_version='0.3.27' where app_name='DT_REGISTRY'; update app_tbl set expected_input_data= replace(replace(expected_input_data,'\{','{'),'\}','}'), required_yaml_configuration=replace(replace(required_yaml_configuration,'\{','{'),'\}','}'); diff --git a/src/main/resources/request-template/asset.json b/src/main/resources/request-template/asset.json index 04b39933..10ac8a60 100644 --- a/src/main/resources/request-template/asset.json +++ b/src/main/resources/request-template/asset.json @@ -26,7 +26,7 @@ }, "edc:dataAddress": { "edc:type": "HttpData", - "edc:baseUrl": "${dtregistryUrl}", + "edc:baseUrl": "${dtregistryUrlWithURI}", "oauth2:tokenUrl": "${idpIssuerUri}", "oauth2:clientId": "${keycloakAuthenticationClientId}", "oauth2:clientSecretKey": "client-secret",