Skip to content

Commit

Permalink
add metadata in container creating
Browse files Browse the repository at this point in the history
  • Loading branch information
umagnus committed Jul 17, 2024
1 parent 03a5933 commit 013b56e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/blob/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ const (
MSI = "MSI"
SPN = "SPN"
authorizationPermissionMismatch = "AuthorizationPermissionMismatch"

createdByMetadata = "createdBy"
)

// CreateVolume provisions a volume
Expand Down Expand Up @@ -691,11 +693,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
Expand Down

0 comments on commit 013b56e

Please sign in to comment.