-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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 incorrect error info when creating an azure file PVC failed #56550
fix incorrect error info when creating an azure file PVC failed #56550
Conversation
I just got lots of this incorrect error info when customer create azure file failed, mostly it's due to the azure file name length bug, while k8s just return |
@@ -42,14 +42,12 @@ func (az *Cloud) CreateFileShare(name, storageAccount, storageType, location str | |||
// find the access key with this account | |||
key, err := az.getStorageAccesskey(account.Name) | |||
if err != nil { | |||
glog.V(2).Infof("no key found for storage account %s", account.Name) | |||
continue | |||
return "", "", fmt.Errorf("no key found for storage account %s", account.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why return here when there are still other accounts to try?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds reasonable, I have used err
var to save the error info, and return err
in the end, that would be more error clear for user.
remember error info in CreateFileShare fix typo
81b4e8b
to
08f40ea
Compare
/approve |
/test pull-kubernetes-unit |
/assign @brendandburns |
/test pull-kubernetes-unit |
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, brendandburns, rootfs Associated issue: #56548 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 56337, 56546, 56550, 56633, 56635). If you want to cherry-pick this change to another branch, please follow the instructions here. |
…6550-upstream-release-1.8 Automatic merge from submit-queue. Automated cherry pick of #56550: return error when create azure share failed Cherry pick of #56550 on release-1.8. #56550: return error when create azure share failed **Release note**: ``` fix incorrect error info when creating an azure file PVC failed ```
What this PR does / why we need it:
when creating an azure file PVC failed, it will always return following error which is totally incorrect:
The incorrect error info would mislead customer a lot, I would suggest return error directly if create first file share failed.
By this PR, the error info would be like following, which would provide user detailed and correct info:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #56548
Special notes for your reviewer:
Release note:
/sig azure
/assign @rootfs