Skip to content

Commit

Permalink
Merge pull request #1492 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1490-to-release-1.24

[release-1.24] feat: add metadata tag on the storage account created by the driver
  • Loading branch information
k8s-ci-robot authored Jul 18, 2024
2 parents 3d2e7ad + 23400c2 commit 4615337
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 @@ -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
Expand Down

0 comments on commit 4615337

Please sign in to comment.