diff --git a/CHANGELOG.md b/CHANGELOG.md index ec546473..6486daf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 6d1a3167..0460f3fa 100644 --- a/README.md +++ b/README.md @@ -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] diff --git a/main.go b/main.go index 87cb71f5..49d99f94 100644 --- a/main.go +++ b/main.go @@ -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"}, }, diff --git a/storage/backend/azure/azure.go b/storage/backend/azure/azure.go index 66289ece..4c91e497 100644 --- a/storage/backend/azure/azure.go +++ b/storage/backend/azure/azure.go @@ -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)) }