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 private dns zone before creation #2723
fix: check private dns zone before creation #2723
Conversation
✅ Deploy Preview for kubernetes-sigs-cloud-provide-azure canceled.
|
8030c6d
to
b1a3b5b
Compare
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.
pls submit a candidate PR in azure file csi driver, only modify the vendor change, and then we could verify whether e2e test pass
pkg/provider/azure_storageaccount.go
Outdated
@@ -607,3 +613,13 @@ func isPrivateEndpointAsExpected(account storage.Account, accountOptions *Accoun | |||
} | |||
return false | |||
} | |||
|
|||
func (az *Cloud) getPrivateDNSZone(ctx context.Context, vnetResourceGroup string) (privatedns.PrivateZone, *retry.Error) { | |||
klog.V(2).Infof("Getting private dns zone(%s) in resourceGroup (%s)", PrivateDNSZoneName, vnetResourceGroup) |
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.
no need to print Getting private dns zone
logs
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.
since there is only one line of code, I think it's better cancel this function, and use az.privatednsclient.Get
directly.
pkg/provider/azure_storageaccount.go
Outdated
|
||
func (az *Cloud) getVNetLink(ctx context.Context, vNetLinkName, vnetResourceGroup, vnetName string) (privatedns.VirtualNetworkLink, *retry.Error) { | ||
klog.V(2).Infof("Getting virtual link for vnet(%s) and DNS Zone(%s) in resourceGroup(%s)", vNetLinkName, PrivateDNSZoneName, vnetResourceGroup) | ||
return az.virtualNetworkLinksClient.Get(ctx, vnetResourceGroup, PrivateDNSZoneName, vNetLinkName) |
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.
cancel this function and use az.virtualNetworkLinksClient.Get
in outer call
Signed-off-by: Ji An Liu <jiliu8@microsoft.com>
b1a3b5b
to
a17afbc
Compare
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, ZeroMagic 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 |
1 similar comment
/retest |
What type of PR is this?
/kind bug
What this PR does / why we need it:
We should add get PrivateDNSZone and get VNetLink to make this func idempotent, so that even creation return failed, it should succeeded in next try
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: