From b318f666ba8284382cb47eff51a1f27565be3812 Mon Sep 17 00:00:00 2001 From: Zhang Jinghui Date: Thu, 14 Nov 2019 23:55:18 +0800 Subject: [PATCH] normalize function return and comments on exported type --- internal/testutils/endpoint.go | 1 + provider/azure_test.go | 3 +-- provider/transip.go | 2 +- source/ingress.go | 4 ++-- source/ingressroute.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/testutils/endpoint.go b/internal/testutils/endpoint.go index f54fb9ced9..c9726f527e 100644 --- a/internal/testutils/endpoint.go +++ b/internal/testutils/endpoint.go @@ -76,6 +76,7 @@ func SameEndpoints(a, b []*endpoint.Endpoint) bool { return true } +// SameEndpointLabels verifies that labels of the two slices of endpoints are the same func SameEndpointLabels(a, b []*endpoint.Endpoint) bool { if len(a) != len(b) { return false diff --git a/provider/azure_test.go b/provider/azure_test.go index 2835dec801..c67aec4332 100644 --- a/provider/azure_test.go +++ b/provider/azure_test.go @@ -370,9 +370,8 @@ func testAzureApplyChangesInternal(t *testing.T, dryRun bool, client RecordSetsC result := results[0] results = nil return result, nil - } else { - return dns.ZoneListResult{}, nil } + return dns.ZoneListResult{}, nil }) mockZoneClientIterator := dns.NewZoneListResultIterator(mockZoneListResultPage) diff --git a/provider/transip.go b/provider/transip.go index 58192e79ab..8a09ea5a75 100644 --- a/provider/transip.go +++ b/provider/transip.go @@ -304,7 +304,7 @@ func (p *TransIPProvider) dnsEntriesAreEqual(a, b transip.DNSEntries) bool { continue } - match += 1 + match++ } } diff --git a/source/ingress.go b/source/ingress.go index c841ca26d3..c3551b8cbc 100644 --- a/source/ingress.go +++ b/source/ingress.go @@ -38,9 +38,9 @@ import ( ) const ( - // The annotation used for determining if an ALB ingress is dualstack + // ALBDualstackAnnotationKey is the annotation used for determining if an ALB ingress is dualstack ALBDualstackAnnotationKey = "alb.ingress.kubernetes.io/ip-address-type" - // The value of the ALB dualstack annotation that indicates it is dualstack + // ALBDualstackAnnotationValue is the value of the ALB dualstack annotation that indicates it is dualstack ALBDualstackAnnotationValue = "dualstack" ) diff --git a/source/ingressroute.go b/source/ingressroute.go index ad8df10c9c..4f492aa30a 100644 --- a/source/ingressroute.go +++ b/source/ingressroute.go @@ -53,7 +53,7 @@ type ingressRouteSource struct { ingressRouteInformer extinformers.IngressRouteInformer } -// NewIngressRouteSource creates a new ingressRouteSource with the given config. +// NewContourIngressRouteSource creates a new contourIngressRouteSource with the given config. func NewContourIngressRouteSource( kubeClient kubernetes.Interface, contourClient contour.Interface,