Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: account match algorithm when source account name is provided #2415

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

andyzhangx
Copy link
Member

What type of PR is this?

/kind bug

What this PR does / why we need it:

fix: account match algorithm when source account name is provided, this is used in volume clone and snapshot restore scenarios, related to fix: kubernetes-sigs/cloud-provider-azure#8560

I0306 12:52:31.840777       1 utils.go:105] GRPC call: /csi.v1.Controller/CreateVolume
I0306 12:52:31.840801       1 utils.go:106] GRPC request: {"capacity_range":{"required_bytes":5368709120},"name":"pvc-23e65b01-80b4-4c71-8f42-1fe6fccbd64b","parameters":{"csi.storage.k8s.io/pv/name":"pvc-23e65b01-80b4-4c71-8f42-1fe6fccbd64b","csi.storage.k8s.io/pvc/name":"afspvc","csi.storage.k8s.io/pvc/namespace":"choudharypr-test-target","skuName":"Standard_LRS"},"volume_capabilities":[{"AccessType":{"Mount":{"mount_flags":["mfsymlinks","actimeo=30","nosharesock"]}},"access_mode":{"mode":5}}],"volume_content_source":{"Type":{"Snapshot":{"snapshot_id":"MC_AKSFileShareBugBash_BugBashCluster1_eastasia#f39e394b362714a2d9af7b0#pvc-e556c261-8372-450c-924a-26997b159e6e###choudharypr-test#2025-03-05T09:36:53.0000000Z"}}}}
I0306 12:52:31.841343       1 controllerserver.go:463] source volume account name: f39e394b362714a2d9af7b0, sourceID: MC_AKSFileShareBugBash_BugBashCluster1_eastasia#f39e394b362714a2d9af7b0#pvc-e556c261-8372-450c-924a-26997b159e6e###choudharypr-test#2025-03-05T09:36:53.0000000Z
I0306 12:52:32.168351       1 azure_storageaccount.go:151] checking account f0044b1ae4bd84caca03d7b
I0306 12:52:32.168378       1 azure_storageaccount.go:151] checking account f39e394b362714a2d9af7b0
I0306 12:52:32.168388       1 azure_storageaccount.go:421] found 2 matching accounts
I0306 12:52:32.168397       1 azure_storageaccount.go:435] source account name(f39e394b362714a2d9af7b0) is provided, try to find a matching account with source account name
I0306 12:52:32.168415       1 azure_storageaccount.go:437] account f0044b1ae4bd84caca03d7b type Standard_LRS location eastasia
I0306 12:52:32.168421       1 azure_storageaccount.go:437] account f39e394b362714a2d9af7b0 type Standard_LRS location eastasia
I0306 12:52:32.168437       1 azure_storageaccount.go:439] found a matching account f39e394b362714a2d9af7b0 type Standard_LRS location eastasia with source account name
I0306 12:52:32.168457       1 azure_storageaccount.go:445] found a matching account f39e394b362714a2d9af7b0 with index%!(EXTRA int=0)
I0306 12:52:32.481293       1 controllerserver.go:586] begin to create file share(pvc-23e65b01-80b4-4c71-8f42-1fe6fccbd64b) on account(f39e394b362714a2d9af7b0) type(Standard_LRS) subID() rg(MC_AKSFileShareBugBash_BugBashCluster1_eastasia) location() size(5) protocol(SMB)
I0306 12:52:32.941972       1 azurefile_mgmt_client.go:87] created share pvc-23e65b01-80b4-4c71-8f42-1fe6fccbd64b in account f39e394b362714a2d9af7b0
I0306 12:52:32.942020       1 controllerserver.go:1418] use system-assigned managed identity to authorize azcopy
I0306 12:52:32.970200       1 controllerserver.go:1137] azcopy job status: NotFound, copy percent: %, error: <nil>
I0306 12:52:32.970240       1 controllerserver.go:1155] copy fileshare f39e394b362714a2d9af7b0:pvc-e556c261-8372-450c-924a-26997b159e6e(snapshot: 2025-03-05T09:36:53.0000000Z) to f39e394b362714a2d9af7b0:pvc-23e65b01-80b4-4c71-8f42-1fe6fccbd64b
I0306 12:52:35.423986       1 controllerserver.go:1172] copied fileshare pvc-e556c261-8372-450c-924a-26997b159e6e(snapshot: 2025-03-05T09:36:53.0000000Z) to pvc-23e65b01-80b4-4c71-8f42-1fe6fccbd64b successfully
I0306 12:52:35.455170       1 controllerserver.go:633] create file share pvc-23e65b01-80b4-4c71-8f42-1fe6fccbd64b on storage account f39e394b362714a2d9af7b0 successfully

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

fix: account match algorithm when source account name is provided

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

fix: account match algorithm when source account name is provided

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 6, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 6, 2025
@k8s-ci-robot
Copy link
Contributor

@andyzhangx: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-azurefile-csi-driver-e2e-capz c05b143 link true /test pull-azurefile-csi-driver-e2e-capz

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@andyzhangx
Copy link
Member Author

/retest

@andyzhangx andyzhangx merged commit e5f5156 into master Mar 7, 2025
27 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants