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
Provider/Azure: Enrich the unit tests for azure_vmss.go. #90273
Provider/Azure: Enrich the unit tests for azure_vmss.go. #90273
Conversation
/priority important-soon |
/sig cloud-provider |
@@ -712,7 +712,7 @@ func (ss *scaleSet) GetPrimaryInterface(nodeName string) (network.Interface, err | |||
exists, realErr := checkResourceExistsFromError(rerr) | |||
if realErr != nil { | |||
klog.Errorf("error: ss.GetPrimaryInterface(%s), ss.GetVirtualMachineScaleSetNetworkInterface.Get(%s, %s, %s), err=%v", nodeName, resourceGroup, ssName, nicName, realErr) | |||
return network.Interface{}, err | |||
return network.Interface{}, realErr.Error() |
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.
thanks for fixing the bug here
VirtualMachineScaleSetIPConfigurationProperties: &compute.VirtualMachineScaleSetIPConfigurationProperties{}, | ||
VirtualMachineScaleSetIPConfigurationProperties: &compute.VirtualMachineScaleSetIPConfigurationProperties{ | ||
Primary: to.BoolPtr(true), | ||
LoadBalancerBackendAddressPools: &[]compute.SubResource{{ID: to.StringPtr("/subscriptions/sub/resourceGroups/rg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backendpool-0")}}, |
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.
nit: define a const for LoadBalancerBackendAddressPoolId
@@ -106,12 +116,16 @@ func buildTestVirtualMachineEnv(ss *Cloud, scaleSetName, zone string, faultDomai | |||
}, | |||
InstanceView: &compute.VirtualMachineScaleSetVMInstanceView{ | |||
PlatformFaultDomain: &faultDomain, | |||
Statuses: &[]compute.InstanceViewStatus{ | |||
{Code: to.StringPtr("PowerState/Running")}, |
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.
same here, define a const for power state
d66a383
to
3fdceba
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
/retest
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: feiskyer, nilo19 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 |
Hey @nilo19, may I ask here too to change the PR release notes block to just |
What type of PR is this?
What this PR does / why we need it:
Enrich the unit tests for azure_vmss.go. The test coverage increases from 19.7% to 82.9%.
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.: