From 9f6ebfa06de9f2f7355480945e49b19b9976b7d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Mar=C3=A7al?= Date: Thu, 18 Jul 2019 11:05:56 +0200 Subject: [PATCH] Fixed unused assignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Marçal --- source/crd.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/crd.go b/source/crd.go index cbab76efe..52b993c62 100644 --- a/source/crd.go +++ b/source/crd.go @@ -110,7 +110,6 @@ func NewCRDSource(crdClient rest.Interface, namespace, kind string, scheme *runt // Endpoints returns endpoint objects. func (cs *crdSource) Endpoints() ([]*endpoint.Endpoint, error) { endpoints := []*endpoint.Endpoint{} - crdEndpoints := []*endpoint.Endpoint{} result, err := cs.List(&metav1.ListOptions{}) if err != nil { @@ -119,7 +118,7 @@ func (cs *crdSource) Endpoints() ([]*endpoint.Endpoint, error) { for _, dnsEndpoint := range result.Items { // Make sure that all endpoints have targets for A or CNAME type - crdEndpoints = []*endpoint.Endpoint{} + crdEndpoints := []*endpoint.Endpoint{} for _, ep := range dnsEndpoint.Spec.Endpoints { if (ep.RecordType == "CNAME" || ep.RecordType == "A") && len(ep.Targets) < 1 { log.Warnf("Endpoint %s with DNSName %s has an empty list of targets", dnsEndpoint.ObjectMeta.Name, ep.DNSName)