Skip to content
This repository has been archived by the owner on Feb 11, 2025. It is now read-only.

[Bug] Fixed inputs for Azure #257

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
[#256](https://github.com/meltwater/drone-cache/pull/257) Fixed inputs for Azure

### Added
[#230](https://github.com/meltwater/drone-cache/pull/233) Added command line flag to enable/disable SSL for AWS S3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ GLOBAL OPTIONS:
--archive-format value archive format to use to store the cache directories (tar, gzip, zstd) (default: "tar") [$PLUGIN_ARCHIVE_FORMAT]
--azure.account-key value Azure Blob Storage Account Key [$PLUGIN_ACCOUNT_KEY, $AZURE_ACCOUNT_KEY]
--azure.account-name value Azure Blob Storage Account Name [$PLUGIN_ACCOUNT_NAME, $AZURE_ACCOUNT_NAME]
--azure.blob-container-name value Azure Blob Storage container name [$PLUGIN_CONTAINER, $AZURE_CONTAINER_NAME]
--azure.container-name value Azure Blob Storage container name [$PLUGIN_CONTAINER, $AZURE_CONTAINER_NAME]
--azure.blob-max-retry-requets value Azure Blob Storage Max Retry Requests (default: 4) [$AZURE_BLOB_MAX_RETRY_REQUESTS]
--azure.blob-storage-url value Azure Blob Storage URL (default: "blob.core.windows.net") [$AZURE_BLOB_STORAGE_URL]
--backend value cache backend to use in plugin (s3, filesystem, sftp, azure, gcs) (default: "s3") [$PLUGIN_BACKEND]
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ func main() {
EnvVars: []string{"PLUGIN_ACCOUNT_KEY", "AZURE_ACCOUNT_KEY"},
},
&cli.StringFlag{
Name: "azure.blob-container-name",
Name: "azure.container-name",
Usage: "Azure Blob Storage container name",
EnvVars: []string{"PLUGIN_CONTAINER", "AZURE_CONTAINER_NAME"},
},
Expand Down
5 changes: 5 additions & 0 deletions storage/backend/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ func New(l log.Logger, c Config) (*Backend, error) {
// 3. Azurite has different URL pattern than production Azure Blob Storage.
var blobURL *url.URL
if c.Azurite {
fmt.Println("Container Name: ", c.ContainerName)
level.Info(l).Log("Container name: ", c.ContainerName)
blobURL, err = url.Parse(fmt.Sprintf("http://%s/%s/%s", c.BlobStorageURL, c.AccountName, c.ContainerName))
} else {
// add print statement
fmt.Println("Container Name: ", c.ContainerName)
level.Info(l).Log("Container name: ", c.ContainerName)
blobURL, err = url.Parse(fmt.Sprintf("https://%s.%s/%s", c.AccountName, c.BlobStorageURL, c.ContainerName))
}

Expand Down