mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-06 09:36:58 +02:00
*: fix goreportcard golint warnings
This commit applies fixes for the golint warnings shown on goreportcard. Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
This commit is contained in:
parent
117dfd5e4c
commit
a54ee2da37
@ -159,6 +159,7 @@ func NewEndpointWithTTL(dnsName, recordType string, ttl TTL, targets ...string)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithSetIdentifier applies the given set identifier to the endpoint.
|
||||||
func (e *Endpoint) WithSetIdentifier(setIdentifier string) *Endpoint {
|
func (e *Endpoint) WithSetIdentifier(setIdentifier string) *Endpoint {
|
||||||
e.SetIdentifier = setIdentifier
|
e.SetIdentifier = setIdentifier
|
||||||
return e
|
return e
|
||||||
|
@ -184,11 +184,11 @@ func (r *Route53APIStub) ChangeResourceRecordSetsWithContext(ctx context.Context
|
|||||||
change.ResourceRecordSet.AliasTarget.DNSName = aws.String(wildcardEscape(ensureTrailingDot(aws.StringValue(change.ResourceRecordSet.AliasTarget.DNSName))))
|
change.ResourceRecordSet.AliasTarget.DNSName = aws.String(wildcardEscape(ensureTrailingDot(aws.StringValue(change.ResourceRecordSet.AliasTarget.DNSName))))
|
||||||
}
|
}
|
||||||
|
|
||||||
setId := ""
|
setID := ""
|
||||||
if change.ResourceRecordSet.SetIdentifier != nil {
|
if change.ResourceRecordSet.SetIdentifier != nil {
|
||||||
setId = aws.StringValue(change.ResourceRecordSet.SetIdentifier)
|
setID = aws.StringValue(change.ResourceRecordSet.SetIdentifier)
|
||||||
}
|
}
|
||||||
key := aws.StringValue(change.ResourceRecordSet.Name) + "::" + aws.StringValue(change.ResourceRecordSet.Type) + "::" + setId
|
key := aws.StringValue(change.ResourceRecordSet.Name) + "::" + aws.StringValue(change.ResourceRecordSet.Type) + "::" + setID
|
||||||
switch aws.StringValue(change.Action) {
|
switch aws.StringValue(change.Action) {
|
||||||
case route53.ChangeActionCreate:
|
case route53.ChangeActionCreate:
|
||||||
if _, found := recordSets[key]; found {
|
if _, found := recordSets[key]; found {
|
||||||
|
@ -173,9 +173,9 @@ func (m *mockCloudFlareClient) ListZones(zoneID ...string) ([]cloudflare.Zone, e
|
|||||||
|
|
||||||
result := []cloudflare.Zone{}
|
result := []cloudflare.Zone{}
|
||||||
|
|
||||||
for zoneId, zoneName := range m.Zones {
|
for zoneID, zoneName := range m.Zones {
|
||||||
result = append(result, cloudflare.Zone{
|
result = append(result, cloudflare.Zone{
|
||||||
ID: zoneId,
|
ID: zoneID,
|
||||||
Name: zoneName,
|
Name: zoneName,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ const (
|
|||||||
vultrTTL = 3600
|
vultrTTL = 3600
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// VultrProvider is an implementation of Provider for Vultr DNS.
|
||||||
type VultrProvider struct {
|
type VultrProvider struct {
|
||||||
client govultr.Client
|
client govultr.Client
|
||||||
|
|
||||||
@ -43,6 +44,7 @@ type VultrProvider struct {
|
|||||||
DryRun bool
|
DryRun bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// VultrChanges differentiates between ChangActions.
|
||||||
type VultrChanges struct {
|
type VultrChanges struct {
|
||||||
Action string
|
Action string
|
||||||
|
|
||||||
@ -78,6 +80,7 @@ func (p *VultrProvider) Zones(ctx context.Context) ([]govultr.DNSDomain, error)
|
|||||||
return zones, nil
|
return zones, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Records returns the list of records.
|
||||||
func (p *VultrProvider) Records(ctx context.Context) ([]*endpoint.Endpoint, error) {
|
func (p *VultrProvider) Records(ctx context.Context) ([]*endpoint.Endpoint, error) {
|
||||||
zones, err := p.Zones(ctx)
|
zones, err := p.Zones(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -201,6 +204,7 @@ func (p *VultrProvider) submitChanges(ctx context.Context, changes []*VultrChang
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ApplyChanges applies a given set of changes in a given zone.
|
||||||
func (p *VultrProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error {
|
func (p *VultrProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error {
|
||||||
combinedChanges := make([]*VultrChanges, 0, len(changes.Create)+len(changes.UpdateNew)+len(changes.Delete))
|
combinedChanges := make([]*VultrChanges, 0, len(changes.Create)+len(changes.UpdateNew)+len(changes.Delete))
|
||||||
|
|
||||||
|
@ -37,7 +37,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
defaultIdleConnTimeout = 30 * time.Second
|
defaultIdleConnTimeout = 30 * time.Second
|
||||||
|
// DefaultRoutegroupVersion is the default version for route groups.
|
||||||
DefaultRoutegroupVersion = "zalando.org/v1"
|
DefaultRoutegroupVersion = "zalando.org/v1"
|
||||||
routeGroupListResource = "/apis/%s/routegroups"
|
routeGroupListResource = "/apis/%s/routegroups"
|
||||||
routeGroupNamespacedResource = "/apis/%s/namespaces/%s/routegroups"
|
routeGroupNamespacedResource = "/apis/%s/namespaces/%s/routegroups"
|
||||||
|
Loading…
Reference in New Issue
Block a user