-
Notifications
You must be signed in to change notification settings - Fork 194
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
Refactor: migrate disk client to track2 sdk #2155
Refactor: migrate disk client to track2 sdk #2155
Conversation
Skipping CI for Draft Pull Request. |
/retest |
if err != nil { | ||
return false, err | ||
} | ||
if _, err := diskClient.Get(ctx, resourceGroup, diskName); err != nil { |
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 not add subsID
in DisksClient.Get
func? there would be easier to use in csi driver
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.
Yes. I agree. but the subid is part of client object. https://github.com/Azure/azure-sdk-for-go/blob/775c7070836e584f796bc72c6de5c77649a67bb2/sdk/resourcemanager/compute/armcompute/disks_client.go#L27
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.
could you write a wrapper func in this driver for this? I see this code is duplicated multiple times in this PR.
diskClient, err := c.clientFactory.GetDiskClientForSub(subsID)
if err != nil {
return false, err
}
if _, err := diskClient.Get(ctx, resourceGroup, diskName); err != nil {
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.
I don't think it is necessary because different method is invoked (get/delete/list)
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.
this diskClient.Get
func is called 13 times in this PR, why not wrap as a Driver func, that could reduce duplicated code a lot
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.
diskClient.Delete
is also invoked , diskclient can't be shared in one function if we put diskclient into wrapper.
Signed-off-by: Fan Shang Xiang <shafan@microsoft.com>
/retest |
5 similar comments
/retest |
/retest |
/retest |
/retest |
/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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, MartinForReal 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 |
What type of PR is this?
Refactor: migrate disk client to track2 sdk
/kind cleanup
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Requirements:
Special notes for your reviewer:
Release note: