azure: move the .vhd extension logic to the callers
It always felt wrong that the method uploaded the blob under a different name than the one specified in the blob metadata. This commit moves the responsibility of specifying the right extension to the callers. azure.EnsureVHDExtension helper was added to simplify this. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
9e6ade2eff
commit
f71ca8f0ca
4 changed files with 37 additions and 11 deletions
|
|
@ -43,10 +43,12 @@ func main() {
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
blobName := azure.EnsureVHDExtension(path.Base(fileName))
|
||||
|
||||
err = c.UploadPageBlob(
|
||||
azure.BlobMetadata{
|
||||
StorageAccount: storageAccount,
|
||||
BlobName: path.Base(fileName),
|
||||
BlobName: blobName,
|
||||
ContainerName: containerName,
|
||||
},
|
||||
fileName,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue