11644: Use storage account and bucket name as DeviceID for Azure volumes.
authorTom Clegg <tom@curoverse.com>
Mon, 15 May 2017 14:11:20 +0000 (10:11 -0400)
committerTom Clegg <tom@curoverse.com>
Mon, 15 May 2017 14:11:20 +0000 (10:11 -0400)
services/keepstore/azure_blob_volume.go

index 16f1a0bd97c427446cd8325eec1e4ae130ef5f47..3090b95cb22909614c909d1e8b4b56cffe4e0c40 100644 (file)
@@ -174,6 +174,11 @@ func (v *AzureBlobVolume) Start() error {
        return nil
 }
 
+// DeviceID returns a globally unique ID for the storage container.
+func (v *AzureBlobVolume) DeviceID() string {
+       return "azure://" + v.StorageBaseURL + "/" + v.StorageAccountName + "/" + v.ContainerName
+}
+
 // Return true if expires_at metadata attribute is found on the block
 func (v *AzureBlobVolume) checkTrashed(loc string) (bool, map[string]string, error) {
        metadata, err := v.bsClient.GetBlobMetadata(v.ContainerName, loc)