Skip to content

Commit

Permalink
Merge pull request #28 from rundeck-plugins/azure-log-store-enterpris…
Browse files Browse the repository at this point in the history
…e-duplicate-container

RUN-1024: Azure Log Storage generates duplicated folder for executions
  • Loading branch information
ltamaster authored Jul 25, 2022
2 parents cdfaf7a + 052212e commit 224f3d7
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ class AzureFileStoragePlugin implements ExecutionFileStoragePlugin, ExecutionMul
)
private String path

@PluginProperty(
title = "Container Name",
description = "(Optional) Define the container name where the logs will be saved. If not set, it'll be obtained from `path` property. Eg: If the path=\"project/\${job.project}/\${job.execid}\" then the containerName property will be \"project\""
)
protected String containerName = null

Map<String, ?> context;
CloudBlobClient serviceClient
Expand Down Expand Up @@ -120,13 +125,10 @@ class AzureFileStoragePlugin implements ExecutionFileStoragePlugin, ExecutionMul
serviceClient = account.createCloudBlobClient();

// Container name must be lower case.
String containerName = expandedPath.substring(0,expandedPath.indexOf("/")).toLowerCase()
this.containerName = this.containerName ? this.containerName.toLowerCase : expandedPath.substring(0,expandedPath.indexOf("/")).toLowerCase()

container = serviceClient.getContainerReference(containerName)
container.createIfNotExists()




}

@Override
Expand Down

0 comments on commit 224f3d7

Please sign in to comment.