From 08ba489231b45897eef6434d655e2fe53d402c24 Mon Sep 17 00:00:00 2001 From: Ashutosh Kumar Date: Wed, 17 Nov 2021 12:07:28 +0530 Subject: [PATCH] incorporate review comments Signed-off-by: Ashutosh Kumar --- azure/services/privatedns/client.go | 10 +++++----- azure/services/privatedns/privatedns.go | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/azure/services/privatedns/client.go b/azure/services/privatedns/client.go index f7bb9b3767f..f4f9e2b8a10 100644 --- a/azure/services/privatedns/client.go +++ b/azure/services/privatedns/client.go @@ -80,11 +80,11 @@ func newRecordSetsClient(subscriptionID string, baseURI string, authorizer autor func (ac *azureClient) GetZone(ctx context.Context, resourceGroupName, zoneName string) (privatedns.PrivateZone, error) { ctx, _, done := tele.StartSpanWithLogger(ctx, "privatedns.AzureClient.GetZone") defer done() - gotZone, err := ac.privatezones.Get(ctx, resourceGroupName, zoneName) + zone, err := ac.privatezones.Get(ctx, resourceGroupName, zoneName) if err != nil { return privatedns.PrivateZone{}, err } - return gotZone, nil + return zone, nil } // CreateOrUpdateZone creates or updates a private zone. @@ -122,13 +122,13 @@ func (ac *azureClient) DeleteZone(ctx context.Context, resourceGroupName, name s // GetLink returns a vnet link. func (ac *azureClient) GetLink(ctx context.Context, resourceGroupName, zoneName, vnetLinkName string) (privatedns.VirtualNetworkLink, error) { - ctx, _, done := tele.StartSpanWithLogger(ctx, "privatedns.AzureClient.GetZone") + ctx, _, done := tele.StartSpanWithLogger(ctx, "privatedns.AzureClient.GetLink") defer done() - gotVnetLink, err := ac.vnetlinks.Get(ctx, resourceGroupName, zoneName, vnetLinkName) + vnetLink, err := ac.vnetlinks.Get(ctx, resourceGroupName, zoneName, vnetLinkName) if err != nil { return privatedns.VirtualNetworkLink{}, err } - return gotVnetLink, nil + return vnetLink, nil } // CreateOrUpdateLink creates or updates a virtual network link to the specified Private DNS zone. diff --git a/azure/services/privatedns/privatedns.go b/azure/services/privatedns/privatedns.go index f1a43141fc9..1c1574c4411 100644 --- a/azure/services/privatedns/privatedns.go +++ b/azure/services/privatedns/privatedns.go @@ -208,21 +208,21 @@ func (s *Service) Delete(ctx context.Context) error { // isPrivateDNSManaged returns true if the private DNS has an owned tag with the cluster name as value, // meaning that the DNS lifecycle is managed. func (s *Service) isPrivateDNSManaged(ctx context.Context, resourceGroup, zoneName string) (bool, error) { - gotZone, err := s.client.GetZone(ctx, resourceGroup, zoneName) + zone, err := s.client.GetZone(ctx, resourceGroup, zoneName) if err != nil { return false, err } - tags := converters.MapToTags(gotZone.Tags) + tags := converters.MapToTags(zone.Tags) return tags.HasOwned(s.Scope.ClusterName()), nil } // isVnetLinkManaged returns true if the vnet link has an owned tag with the cluster name as value, // meaning that the vnet link lifecycle is managed. func (s *Service) isVnetLinkManaged(ctx context.Context, resourceGroupName, zoneName, vnetLinkName string) (bool, error) { - gotZone, err := s.client.GetLink(ctx, resourceGroupName, zoneName, vnetLinkName) + zone, err := s.client.GetLink(ctx, resourceGroupName, zoneName, vnetLinkName) if err != nil { return false, err } - tags := converters.MapToTags(gotZone.Tags) + tags := converters.MapToTags(zone.Tags) return tags.HasOwned(s.Scope.ClusterName()), nil }