Unverified Commit 2196b0a0 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #61391 from hanxiaoshuai/fixtodo0320

Automatic merge from submit-queue (batch tested with PRs 60476, 62462, 61391, 62535, 62394). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Use function aws.Int64Value replace of deprecated function orZero **What this PR does / why we need it**: ``` // orZero returns the value, or 0 if the pointer is nil // Deprecated: prefer aws.Int64Value func orZero(v *int64) int64 { return aws.Int64Value(v) } ``` Use function aws.Int64Value replace of deprecated function orZero and remove unused orZero . **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 # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
parents 92065407 f78c7d3d
...@@ -1027,10 +1027,10 @@ func (c *Cloud) ensureLoadBalancer(namespacedName types.NamespacedName, loadBala ...@@ -1027,10 +1027,10 @@ func (c *Cloud) ensureLoadBalancer(namespacedName types.NamespacedName, loadBala
if elbProtocolsAreEqual(actual.InstanceProtocol, expected.InstanceProtocol) { if elbProtocolsAreEqual(actual.InstanceProtocol, expected.InstanceProtocol) {
continue continue
} }
if orZero(actual.InstancePort) != orZero(expected.InstancePort) { if aws.Int64Value(actual.InstancePort) != aws.Int64Value(expected.InstancePort) {
continue continue
} }
if orZero(actual.LoadBalancerPort) != orZero(expected.LoadBalancerPort) { if aws.Int64Value(actual.LoadBalancerPort) != aws.Int64Value(expected.LoadBalancerPort) {
continue continue
} }
if awsArnEquals(actual.SSLCertificateId, expected.SSLCertificateId) { if awsArnEquals(actual.SSLCertificateId, expected.SSLCertificateId) {
......
...@@ -42,9 +42,3 @@ func stringSetFromPointers(in []*string) sets.String { ...@@ -42,9 +42,3 @@ func stringSetFromPointers(in []*string) sets.String {
} }
return out return out
} }
// orZero returns the value, or 0 if the pointer is nil
// Deprecated: prefer aws.Int64Value
func orZero(v *int64) int64 {
return aws.Int64Value(v)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment