Skip to content

Commit

Permalink
fix IAM clients and S3 buckets creation when deployment fails in a pr…
Browse files Browse the repository at this point in the history
…ovider
  • Loading branch information
lgiommi committed Jul 29, 2024
1 parent 39a4612 commit 21998c0
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,15 @@ public boolean doDeploy(DeploymentMessage deploymentMessage) {
for (Resource resource : resources.get(false)) {
if (resource.getToscaNodeType().equals(IAM_TOSCA_NODE_TYPE)) {
String nodeName = resource.getToscaNodeName();

// If resource metadata is not empty means that the IAM client is already created.
// If it is, fill iamTemplateOutput with resource metadata info, then continue to next
// resource
if (resource.getMetadata() != null) {
iamTemplateOutput.put(nodeName, resource.getMetadata());
continue;
}

LOG.info("Found node of type: {}. Node name: {}", IAM_TOSCA_NODE_TYPE, nodeName);
String scopes;
String issuerNode;
Expand Down Expand Up @@ -418,6 +427,15 @@ public boolean doDeploy(DeploymentMessage deploymentMessage) {
// Manage creation of an S3 bucket
if (resource.getToscaNodeType().equals(toscaService.getS3ToscaNodeType())) {
String nodeName = resource.getToscaNodeName();

// If resource metadata is not empty means that the S3 bucket is already created.
// If it is, fill s3TemplateOutput with resource metadata info, then continue to next
// resource
if (resource.getMetadata() != null) {
s3TemplateOutput.put(nodeName, resource.getMetadata());
continue;
}

String userGroup = deployment.getUserGroup();
Map<String, Object> s3Result = null;
String bucketName = null;
Expand Down

0 comments on commit 21998c0

Please sign in to comment.