-
Notifications
You must be signed in to change notification settings - Fork 145
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: check storage account type if parameter is missing #1391
Conversation
53a2a8e
to
02c0291
Compare
682bf44
to
f51d55b
Compare
pkg/azurefile/controllerserver.go
Outdated
@@ -312,6 +312,16 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) | |||
return nil, status.Errorf(codes.InvalidArgument, "fsType(%s) is not supported with protocol(%s)", fsType, protocol) | |||
} | |||
|
|||
if account != "" && sku == "" { |
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.
also add fileShareSize < minimumPremiumShareSize
check, that could save one StorageAccountClient.GetProperties
call: sku is only needed when fileShareSize < minimumPremiumShareSize
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.
Added, along with one more unit test to verify StorageAccountClient.GetProperties
is not called in this case.
f51d55b
to
20764f9
Compare
20764f9
to
bfdc371
Compare
/hold I get an error while obtaining storage account properties, need to investigate.
|
The only working combination I could find so far was when I set network
@andyzhangx Any idea how this should be handled? Seems like |
1b9131b
to
d629463
Compare
I've found a similar issue with CLI where the workaround was to add a resource group name, not sure if it might be related or if the same fix is planned for Azure SDK. Anyway, Testing it with the same storage class I've posted in previous comment (but without |
/unhold |
797a7a7
to
086a8e4
Compare
/retest |
1 similar comment
/retest |
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.
/lgtm
/retest
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, RomanBednar 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 |
/retest |
/cherrypick release-1.29 |
@andyzhangx: failed to push cherry-picked changes in GitHub: pushToNamedFork is not implemented in the v2 client In response to this:
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/test-infra repository. |
/cherrypick release-1.29 |
@andyzhangx: failed to push cherry-picked changes in GitHub: pushToNamedFork is not implemented in the v2 client In response to this:
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/test-infra repository. |
/cherrypick release-1.29 |
@andyzhangx: failed to push cherry-picked changes in GitHub: pushToNamedFork is not implemented in the v2 client In response to this:
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/test-infra repository. |
/cherrypick release-1.29 |
@andyzhangx: new pull request created: #1479 In response to this:
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/test-infra repository. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
While using StorageClass with samba protocol without explicitly specifying strorage account type users get a misleading message and volume creation fails:
Status=400 Code="InvalidHeaderValue" Message="The value for one of the HTTP headers is not in the correct format.
This happens in a scenario when creating a volume with size < 100Gi and storage account name (premium type) was provided as a parameter in
StorageClass
whileskuName
was omitted. Premium requirement is that a fileshare must have at least 100Gi in size.Driver can lookup storage account type via storage account client and use that instead of relying on the
skuName
parameter that users otherwise need to set manually.Which issue(s) this PR fixes:
Fixes #1390
Requirements:
Special notes for your reviewer:
Release note: