diff options
author | Lukasz Rajewski <lukasz.rajewski@orange.com> | 2021-03-24 23:15:56 +0100 |
---|---|---|
committer | Lukasz Rajewski <lukasz.rajewski@orange.com> | 2021-03-25 00:34:23 +0100 |
commit | a11600939784ed7d4f53e60436474a04b2c196c6 (patch) | |
tree | 364c0f959158f62c4ac9e0214945d5b44ced2a11 | |
parent | 46a0eda4be2662ed48cce9fd25d623b1cc212381 (diff) |
Fix for invalid CNF release name
Fix for invalid CNF release name. When CNF is created
with Release.Name as a base for name today it receives
vfMouleId which may be invalid. Fix changes way of
release name generation.
Issue-ID: SO-3607
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
Change-Id: I7fbec527d0d01d39d4251cb2047691b53a9d6239
3 files changed, 22 insertions, 6 deletions
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java index 2e76d51da2..842ef8ba15 100644 --- a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java +++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java @@ -13,6 +13,9 @@ public class BpmnInstanceRequest { @JsonProperty(value = "modelVersionId") private String modelVersionId; + @JsonProperty(value = "k8sRBInstanceReleaseName") + private String k8sRBInstanceReleaseName; + @JsonProperty(value = "k8sRBProfileName") private String k8sRBProfileName; @@ -52,6 +55,14 @@ public class BpmnInstanceRequest { this.k8sRBProfileName = k8sRBProfileName; } + public String getK8sRBInstanceReleaseName() { + return k8sRBInstanceReleaseName; + } + + public void setK8sRBInstanceReleaseName(String k8sRBInstanceReleaseName) { + this.k8sRBInstanceReleaseName = k8sRBInstanceReleaseName; + } + public String getCloudRegionId() { return cloudRegionId; } diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/MulticloudInstanceRequest.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/MulticloudInstanceRequest.java index b1719cbd7d..20af63e886 100644 --- a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/MulticloudInstanceRequest.java +++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/MulticloudInstanceRequest.java @@ -26,7 +26,7 @@ public class MulticloudInstanceRequest { private Map<String, String> overrideValues; @JsonProperty(value = "release-name") - private String vfModuleUuid; + private String releaseName; public String getCloudRegion() { return cloudRegion; @@ -76,12 +76,12 @@ public class MulticloudInstanceRequest { this.overrideValues = overrideValues; } - public String getVfModuleUuid() { - return vfModuleUuid; + public String getReleaseName() { + return releaseName; } - public void setVfModuleUuid(String vfModuleUuid) { - this.vfModuleUuid = vfModuleUuid; + public void setReleaseName(String releaseName) { + this.releaseName = releaseName; } } diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/service/CnfAdapterService.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/service/CnfAdapterService.java index a134bace1f..9f02c53a99 100644 --- a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/service/CnfAdapterService.java +++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/service/CnfAdapterService.java @@ -90,7 +90,12 @@ public class CnfAdapterService { multicloudInstanceRequest.setProfileName(bpmnInstanceRequest.getK8sRBProfileName()); multicloudInstanceRequest.setRbName(bpmnInstanceRequest.getModelInvariantId()); multicloudInstanceRequest.setRbVersion(bpmnInstanceRequest.getModelVersionId()); - multicloudInstanceRequest.setVfModuleUuid(bpmnInstanceRequest.getVfModuleUUID()); + + if (bpmnInstanceRequest.getK8sRBInstanceReleaseName() != null) + multicloudInstanceRequest.setReleaseName(bpmnInstanceRequest.getK8sRBInstanceReleaseName()); + else + multicloudInstanceRequest.setReleaseName( + bpmnInstanceRequest.getK8sRBProfileName() + "-" + bpmnInstanceRequest.getVfModuleUUID()); } else { logger.error("k8sProfileName should not be null"); // return instanceResponse; |