@@ -61,6 +61,8 @@ const (
61
61
MSI = "MSI"
62
62
SPN = "SPN"
63
63
authorizationPermissionMismatch = "AuthorizationPermissionMismatch"
64
+
65
+ createdByMetadata = "createdBy"
64
66
)
65
67
66
68
// CreateVolume provisions a volume
@@ -312,6 +314,10 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
312
314
return nil , status .Errorf (codes .InvalidArgument , err .Error ())
313
315
}
314
316
317
+ if err != nil {
318
+ return nil , status .Errorf (codes .InvalidArgument , err .Error ())
319
+ }
320
+
315
321
if strings .TrimSpace (storageEndpointSuffix ) == "" {
316
322
storageEndpointSuffix = d .getStorageEndPointSuffix ()
317
323
}
@@ -691,11 +697,17 @@ func (d *Driver) CreateBlobContainer(ctx context.Context, subsID, resourceGroupN
691
697
if getErr != nil {
692
698
return true , getErr
693
699
}
700
+ metadata := make (map [string ]string )
701
+ metadata [createdByMetadata ] = d .Name
702
+ container .Metadata = metadata
694
703
_ , err = container .CreateIfNotExists (& azstorage.CreateContainerOptions {Access : azstorage .ContainerAccessTypePrivate })
695
704
} else {
705
+ metadataPtr := make (map [string ]* string )
706
+ metadataPtr [createdByMetadata ] = to .Ptr (d .Name )
696
707
blobContainer := armstorage.BlobContainer {
697
708
ContainerProperties : & armstorage.ContainerProperties {
698
709
PublicAccess : to .Ptr (armstorage .PublicAccessNone ),
710
+ Metadata : metadataPtr ,
699
711
},
700
712
}
701
713
var blobClient blobcontainerclient.Interface
0 commit comments