From 23400c2e2b6c69f68a7471254e53ccd39032e35a Mon Sep 17 00:00:00 2001 From: umagnus Date: Tue, 16 Jul 2024 09:04:49 +0000 Subject: [PATCH] add metadata in container creating --- pkg/blob/controllerserver.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/blob/controllerserver.go b/pkg/blob/controllerserver.go index 8879b4185..b95be7fbd 100644 --- a/pkg/blob/controllerserver.go +++ b/pkg/blob/controllerserver.go @@ -61,6 +61,8 @@ const ( MSI = "MSI" SPN = "SPN" authorizationPermissionMismatch = "AuthorizationPermissionMismatch" + + createdByMetadata = "createdBy" ) // CreateVolume provisions a volume @@ -686,11 +688,13 @@ func (d *Driver) CreateBlobContainer(ctx context.Context, subsID, resourceGroupN if getErr != nil { return true, getErr } + container.Metadata = map[string]string{createdByMetadata: d.Name} _, err = container.CreateIfNotExists(&azstorage.CreateContainerOptions{Access: azstorage.ContainerAccessTypePrivate}) } else { blobContainer := armstorage.BlobContainer{ ContainerProperties: &armstorage.ContainerProperties{ PublicAccess: to.Ptr(armstorage.PublicAccessNone), + Metadata: map[string]*string{createdByMetadata: to.Ptr(d.Name)}, }, } var blobClient blobcontainerclient.Interface