mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-08-15 19:56:06 +00:00
azure: fix for breaking change in blob.GetSASURI
Signed-off-by: Steve Kriss <steve@heptio.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user