azure: fix for breaking change in blob.GetSASURI

Signed-off-by: Steve Kriss <steve@heptio.com>
This commit is contained in:
Steve Kriss
2018-08-28 13:19:21 -07:00
parent a440029c2f
commit cd4e9f5336
+10 -3
View File
@@ -147,8 +147,6 @@ func (o *objectStore) DeleteObject(bucket string, key string) error {
return errors.WithStack(blob.Delete(nil))
}
const sasURIReadPermission = "r"
func (o *objectStore) CreateSignedURL(bucket, key string, ttl time.Duration) (string, error) {
container, err := getContainerReference(o.blobClient, bucket)
if err != nil {
@@ -160,7 +158,16 @@ func (o *objectStore) CreateSignedURL(bucket, key string, ttl time.Duration) (st
return "", err
}
return blob.GetSASURI(time.Now().Add(ttl), sasURIReadPermission)
opts := storage.BlobSASOptions{
SASOptions: storage.SASOptions{
Expiry: time.Now().Add(ttl),
},
BlobServiceSASPermissions: storage.BlobServiceSASPermissions{
Read: true,
},
}
return blob.GetSASURI(opts)
}
func getContainerReference(blobClient *storage.BlobStorageClient, bucket string) (*storage.Container, error) {