From 82b0fab8eb662387b3bcb7babf898a2472688205 Mon Sep 17 00:00:00 2001 From: Julilla Paul Date: Wed, 26 Jun 2024 09:22:31 -0700 Subject: [PATCH 01/82] feat: add soft errors to pdns provider Add soft errors to pdns provider where it is possible to retry or recover --- provider/pdns/pdns.go | 17 +++++++---------- provider/pdns/pdns_test.go | 12 ++++++++---- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/provider/pdns/pdns.go b/provider/pdns/pdns.go index fbc7cc22f..fb705f519 100644 --- a/provider/pdns/pdns.go +++ b/provider/pdns/pdns.go @@ -22,6 +22,7 @@ import ( "crypto/tls" "encoding/json" "errors" + "fmt" "math" "net" "net/http" @@ -156,8 +157,7 @@ func (c *PDNSAPIClient) ListZones() (zones []pgo.Zone, resp *http.Response, err return zones, resp, err } - log.Errorf("Unable to fetch zones. %v", err) - return zones, resp, err + return zones, resp, provider.NewSoftError(fmt.Errorf("unable to list zones: %v", err)) } // PartitionZones : Method returns a slice of zones that adhere to the domain filter and a slice of ones that does not adhere to the filter @@ -190,8 +190,7 @@ func (c *PDNSAPIClient) ListZone(zoneID string) (zone pgo.Zone, resp *http.Respo return zone, resp, err } - log.Errorf("Unable to list zone. %v", err) - return zone, resp, err + return zone, resp, provider.NewSoftError(fmt.Errorf("unable to list zone: %v", err)) } // PatchZone : Method used to update the contents of a particular zone from PowerDNS @@ -208,8 +207,7 @@ func (c *PDNSAPIClient) PatchZone(zoneID string, zoneStruct pgo.Zone) (resp *htt return resp, err } - log.Errorf("Unable to patch zone. %v", err) - return resp, err + return resp, provider.NewSoftError(fmt.Errorf("unable to patch zone: %v", err)) } // PDNSProvider is an implementation of the Provider interface for PowerDNS @@ -335,7 +333,7 @@ func (p *PDNSProvider) ConvertEndpointsToZones(eps []*endpoint.Endpoint, changet // DELETEs explicitly forbid a TTL, therefore only PATCHes need the TTL if changetype == PdnsReplace { if int64(ep.RecordTTL) > int64(math.MaxInt32) { - return nil, errors.New("value of record TTL overflows, limited to int32") + return nil, provider.NewSoftError(fmt.Errorf("value of record TTL overflows, limited to int32")) } if ep.RecordTTL == 0 { // No TTL was specified for the record, we use the default @@ -394,7 +392,7 @@ func (p *PDNSProvider) mutateRecords(endpoints []*endpoint.Endpoint, changetype for _, zone := range zonelist { jso, err := json.Marshal(zone) if err != nil { - log.Errorf("JSON Marshal for zone struct failed!") + return provider.NewSoftError(fmt.Errorf("JSON Marshal for zone struct failed: %v", err)) } else { log.Debugf("Struct for PatchZone:\n%s", string(jso)) } @@ -418,8 +416,7 @@ func (p *PDNSProvider) Records(ctx context.Context) (endpoints []*endpoint.Endpo for _, zone := range filteredZones { z, _, err := p.client.ListZone(zone.Id) if err != nil { - log.Warnf("Unable to fetch Records") - return nil, err + return nil, provider.NewSoftError(fmt.Errorf("unable to fetch records: %v", err)) } for _, rr := range z.Rrsets { diff --git a/provider/pdns/pdns_test.go b/provider/pdns/pdns_test.go index 01489da9c..ac80bcd38 100644 --- a/provider/pdns/pdns_test.go +++ b/provider/pdns/pdns_test.go @@ -18,7 +18,7 @@ package pdns import ( "context" - "errors" + "fmt" "net/http" "regexp" "strings" @@ -29,6 +29,7 @@ import ( "github.com/stretchr/testify/suite" "sigs.k8s.io/external-dns/endpoint" + "sigs.k8s.io/external-dns/provider" ) // FIXME: What do we do about labels? @@ -691,7 +692,7 @@ type PDNSAPIClientStubPatchZoneFailure struct { // Just overwrite the PatchZone method to introduce a failure func (c *PDNSAPIClientStubPatchZoneFailure) PatchZone(zoneID string, zoneStruct pgo.Zone) (*http.Response, error) { - return nil, errors.New("Generic PDNS Error") + return nil, provider.NewSoftError(fmt.Errorf("Generic PDNS Error")) } /******************************************************************************/ @@ -703,7 +704,7 @@ type PDNSAPIClientStubListZoneFailure struct { // Just overwrite the ListZone method to introduce a failure func (c *PDNSAPIClientStubListZoneFailure) ListZone(zoneID string) (pgo.Zone, *http.Response, error) { - return pgo.Zone{}, nil, errors.New("Generic PDNS Error") + return pgo.Zone{}, nil, provider.NewSoftError(fmt.Errorf("Generic PDNS Error")) } /******************************************************************************/ @@ -715,7 +716,7 @@ type PDNSAPIClientStubListZonesFailure struct { // Just overwrite the ListZones method to introduce a failure func (c *PDNSAPIClientStubListZonesFailure) ListZones() ([]pgo.Zone, *http.Response, error) { - return []pgo.Zone{}, nil, errors.New("Generic PDNS Error") + return []pgo.Zone{}, nil, provider.NewSoftError(fmt.Errorf("Generic PDNS Error")) } /******************************************************************************/ @@ -879,12 +880,14 @@ func (suite *NewPDNSProviderTestSuite) TestPDNSRecords() { } _, err = p.Records(ctx) assert.NotNil(suite.T(), err) + assert.ErrorIs(suite.T(), err, provider.SoftError) p = &PDNSProvider{ client: &PDNSAPIClientStubListZonesFailure{}, } _, err = p.Records(ctx) assert.NotNil(suite.T(), err) + assert.ErrorIs(suite.T(), err, provider.SoftError) } func (suite *NewPDNSProviderTestSuite) TestPDNSConvertEndpointsToZones() { @@ -1024,6 +1027,7 @@ func (suite *NewPDNSProviderTestSuite) TestPDNSmutateRecords() { // Check inserting endpoints from a single zone err = p.mutateRecords(endpointsSimpleRecord, pdnsChangeType("REPLACE")) assert.NotNil(suite.T(), err) + assert.ErrorIs(suite.T(), err, provider.SoftError) } func (suite *NewPDNSProviderTestSuite) TestPDNSClientPartitionZones() { From 99290e402c21dbd7749bf337bb8296a9c4fa85d6 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sat, 29 Jun 2024 13:18:19 +0100 Subject: [PATCH 02/82] fix(issue-4448): make sure nulls not propagated Signed-off-by: ivan katliarchuk --- provider/coredns/coredns.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/provider/coredns/coredns.go b/provider/coredns/coredns.go index eeb545aea..de23cc690 100644 --- a/provider/coredns/coredns.go +++ b/provider/coredns/coredns.go @@ -323,8 +323,10 @@ func (p coreDNSProvider) Records(ctx context.Context) ([]*endpoint.Endpoint, err endpoint.RecordTypeTXT, service.Text, ) - ep.Labels[randomPrefixLabel] = prefix - result = append(result, ep) + if ep != nil { + ep.Labels[randomPrefixLabel] = prefix + result = append(result, ep) + } } } return result, nil From d1122193362b780e865a90d0446599b4b92a88b6 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sat, 29 Jun 2024 16:00:20 +0100 Subject: [PATCH 03/82] fix(issue-4448): no longer crash Signed-off-by: ivan katliarchuk --- provider/aws/aws.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index 8e13d290f..6f4e1283b 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -435,10 +435,12 @@ func (p *AWSProvider) records(ctx context.Context, zones map[string]*profiledZon } ep := endpoint.NewEndpointWithTTL(wildcardUnescape(aws.StringValue(r.Name)), aws.StringValue(r.Type), ttl, targets...) - if aws.StringValue(r.Type) == endpoint.RecordTypeCNAME { - ep = ep.WithProviderSpecific(providerSpecificAlias, "false") + if ep != nil { + if aws.StringValue(r.Type) == endpoint.RecordTypeCNAME { + ep = ep.WithProviderSpecific(providerSpecificAlias, "false") + } + newEndpoints = append(newEndpoints, ep) } - newEndpoints = append(newEndpoints, ep) } if r.AliasTarget != nil { From 761ca1da09fb014377e9de78a86733f6a27c6de7 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sun, 30 Jun 2024 07:58:52 +0100 Subject: [PATCH 04/82] fix(issue-4448): single change required to fix Signed-off-by: ivan katliarchuk --- provider/aws/aws.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index 6f4e1283b..e2bec907e 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -435,12 +435,10 @@ func (p *AWSProvider) records(ctx context.Context, zones map[string]*profiledZon } ep := endpoint.NewEndpointWithTTL(wildcardUnescape(aws.StringValue(r.Name)), aws.StringValue(r.Type), ttl, targets...) - if ep != nil { - if aws.StringValue(r.Type) == endpoint.RecordTypeCNAME { - ep = ep.WithProviderSpecific(providerSpecificAlias, "false") - } - newEndpoints = append(newEndpoints, ep) + if aws.StringValue(r.Type) == endpoint.RecordTypeCNAME { + ep = ep.WithProviderSpecific(providerSpecificAlias, "false") } + newEndpoints = append(newEndpoints, ep) } if r.AliasTarget != nil { @@ -630,6 +628,7 @@ func (p *AWSProvider) submitChanges(ctx context.Context, changes Route53Changes, batchCs := append(batchChangeSet(newChanges, p.batchChangeSize, p.batchChangeSizeBytes, p.batchChangeSizeValues), batchChangeSet(retriedChanges, p.batchChangeSize, p.batchChangeSizeBytes, p.batchChangeSizeValues)...) + for i, b := range batchCs { if len(b) == 0 { continue From 99827b1fecef3096727f44230c48e62b063f3700 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sun, 30 Jun 2024 08:00:08 +0100 Subject: [PATCH 05/82] fix(issue-4448): single change required to fix Signed-off-by: ivan katliarchuk --- provider/aws/aws.go | 1 - 1 file changed, 1 deletion(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index e2bec907e..8e13d290f 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -628,7 +628,6 @@ func (p *AWSProvider) submitChanges(ctx context.Context, changes Route53Changes, batchCs := append(batchChangeSet(newChanges, p.batchChangeSize, p.batchChangeSizeBytes, p.batchChangeSizeValues), batchChangeSet(retriedChanges, p.batchChangeSize, p.batchChangeSizeBytes, p.batchChangeSizeValues)...) - for i, b := range batchCs { if len(b) == 0 { continue From df6d68e9a66f74dac5d7ccff7bc4f7ce7f7445d3 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sun, 30 Jun 2024 11:29:37 +0100 Subject: [PATCH 06/82] fix(issue-4448): added octal decode method Signed-off-by: ivan katliarchuk --- go.mod | 2 +- go.sum | 2 ++ provider/aws/aws.go | 38 ++++++++++++++++++++++++++++++++++++-- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 93bc77ee8..73e146a00 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/alecthomas/kingpin/v2 v2.4.0 github.com/aliyun/alibaba-cloud-sdk-go v1.62.771 github.com/ans-group/sdk-go v1.17.0 - github.com/aws/aws-sdk-go v1.54.4 + github.com/aws/aws-sdk-go v1.54.11 github.com/bodgit/tsig v1.2.2 github.com/cenkalti/backoff/v4 v4.3.0 github.com/civo/civogo v0.3.70 diff --git a/go.sum b/go.sum index 8731741ed..9c0559ab6 100644 --- a/go.sum +++ b/go.sum @@ -154,6 +154,8 @@ github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZo github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.54.4 h1:xZga3fPu7uxVgh83DIaQlb7r0cixFx1xKiiROTWAhpU= github.com/aws/aws-sdk-go v1.54.4/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= +github.com/aws/aws-sdk-go v1.54.11 h1:Zxuv/R+IVS0B66yz4uezhxH9FN9/G2nbxejYqAMFjxk= +github.com/aws/aws-sdk-go v1.54.11/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= diff --git a/provider/aws/aws.go b/provider/aws/aws.go index 8e13d290f..658e27bcc 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -24,6 +24,7 @@ import ( "strconv" "strings" "time" + "regexp" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" @@ -403,6 +404,38 @@ func wildcardUnescape(s string) string { return strings.Replace(s, "\\052", "*", 1) } +// See https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html +// convertOctalToAscii decodes inputs that contain octal escape sequences into their original ASCII characters. +// The function returns converted string where any octal escape sequences have been replaced with their corresponding ASCII characters. +func convertOctalToAscii(input string) string { + if !containsOctalSequence(input) { + return input + } + var result strings.Builder + for i := 0; i < len(input); i++ { + if input[i] == '\\' && i+3 < len(input) { + octalStr := input[i+1 : i+4] + if octal, err := strconv.ParseInt(octalStr, 8, 8); err == nil { + result.WriteByte(byte(octal)) + i += 3 // Skip the next 3 characters (the octal code) + } else { + result.WriteByte(input[i]) + } + } else { + result.WriteByte(input[i]) + } + } + return result.String() +} + +// validateDomainName checks if the domain name contains valid octal escape sequences. +func containsOctalSequence(domain string) bool { + // Pattern to match valid octal escape sequences + octalEscapePattern := `\\[0-3][0-7]{2}` + octalEscapeRegex := regexp.MustCompile(octalEscapePattern) + return octalEscapeRegex.MatchString(domain) +} + // Records returns the list of records in a given hosted zone. func (p *AWSProvider) Records(ctx context.Context) (endpoints []*endpoint.Endpoint, _ error) { zones, err := p.zones(ctx) @@ -433,8 +466,8 @@ func (p *AWSProvider) records(ctx context.Context, zones map[string]*profiledZon for idx, rr := range r.ResourceRecords { targets[idx] = aws.StringValue(rr.Value) } - - ep := endpoint.NewEndpointWithTTL(wildcardUnescape(aws.StringValue(r.Name)), aws.StringValue(r.Type), ttl, targets...) + escaped := convertOctalToAscii(wildcardUnescape(aws.StringValue(r.Name))) + ep := endpoint.NewEndpointWithTTL(escaped, aws.StringValue(r.Type), ttl, targets...) if aws.StringValue(r.Type) == endpoint.RecordTypeCNAME { ep = ep.WithProviderSpecific(providerSpecificAlias, "false") } @@ -583,6 +616,7 @@ func (p *AWSProvider) GetDomainFilter() endpoint.DomainFilter { // ApplyChanges applies a given set of changes in a given zone. func (p *AWSProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error { + fmt.Println("586 ApplyChanges", changes) zones, err := p.zones(ctx) if err != nil { return provider.NewSoftError(fmt.Errorf("failed to list zones, not applying changes: %w", err)) From cc1f4ab1487a75029d5b12a4539007954000b506 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sun, 30 Jun 2024 12:44:11 +0100 Subject: [PATCH 07/82] fix(issue-4448): added unittest Signed-off-by: ivan katliarchuk --- provider/aws/aws.go | 1 - provider/aws/aws_test.go | 21 +++++++++++++++++++++ provider/coredns/coredns.go | 6 ++---- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index 658e27bcc..6475ec6dd 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -616,7 +616,6 @@ func (p *AWSProvider) GetDomainFilter() endpoint.DomainFilter { // ApplyChanges applies a given set of changes in a given zone. func (p *AWSProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error { - fmt.Println("586 ApplyChanges", changes) zones, err := p.zones(ctx) if err != nil { return provider.NewSoftError(fmt.Errorf("failed to list zones, not applying changes: %w", err)) diff --git a/provider/aws/aws_test.go b/provider/aws/aws_test.go index 418e05d09..899e0b69f 100644 --- a/provider/aws/aws_test.go +++ b/provider/aws/aws_test.go @@ -143,6 +143,20 @@ func wildcardEscape(s string) string { return s } +// Route53 octal escapeshttps://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html +func specialCharactersEscape(s string) string { + var result strings.Builder + for _, char := range s { + if (char >= 'a' && char <= 'z') || (char >= '0' && char <= '9') || char == '-' || char == '.' { + result.WriteRune(char) + } else { + octalCode := fmt.Sprintf("\\%03o", char) + result.WriteString(octalCode) + } + } + return result.String() +} + func (r *Route53APIStub) ListTagsForResourceWithContext(ctx context.Context, input *route53.ListTagsForResourceInput, opts ...request.Option) (*route53.ListTagsForResourceOutput, error) { if aws.StringValue(input.ResourceType) == "hostedzone" { tags := r.zoneTags[aws.StringValue(input.ResourceId)] @@ -359,6 +373,12 @@ func TestAWSRecords(t *testing.T) { TTL: aws.Int64(recordTTL), ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, + { + Name: aws.String(specialCharactersEscape("escape-%!s()-codes.zone-2.ext-dns-test-2.teapot.zalan.do.")), + Type: aws.String(route53.RRTypeCname), + TTL: aws.Int64(recordTTL), + ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("example")}}, + }, { Name: aws.String("list-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), Type: aws.String(route53.RRTypeA), @@ -501,6 +521,7 @@ func TestAWSRecords(t *testing.T) { endpoint.NewEndpointWithTTL("list-test.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "1.2.3.4"), endpoint.NewEndpointWithTTL("list-test.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "8.8.8.8"), endpoint.NewEndpointWithTTL("*.wildcard-test.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "8.8.8.8"), + endpoint.NewEndpointWithTTL("escape-%!s()-codes.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeCNAME, endpoint.TTL(recordTTL), "example").WithProviderSpecific(providerSpecificAlias, "false"), endpoint.NewEndpointWithTTL("list-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "foo.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "false").WithProviderSpecific(providerSpecificAlias, "true"), endpoint.NewEndpointWithTTL("*.wildcard-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "foo.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "false").WithProviderSpecific(providerSpecificAlias, "true"), endpoint.NewEndpointWithTTL("list-test-alias-evaluate.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "foo.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "true").WithProviderSpecific(providerSpecificAlias, "true"), diff --git a/provider/coredns/coredns.go b/provider/coredns/coredns.go index de23cc690..eeb545aea 100644 --- a/provider/coredns/coredns.go +++ b/provider/coredns/coredns.go @@ -323,10 +323,8 @@ func (p coreDNSProvider) Records(ctx context.Context) ([]*endpoint.Endpoint, err endpoint.RecordTypeTXT, service.Text, ) - if ep != nil { - ep.Labels[randomPrefixLabel] = prefix - result = append(result, ep) - } + ep.Labels[randomPrefixLabel] = prefix + result = append(result, ep) } } return result, nil From d2f58246f0cc1f7f095c65c7b930814bc888bcc7 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sun, 30 Jun 2024 13:22:46 +0100 Subject: [PATCH 08/82] fix(issue-4448): added test TestAWSApplyChanges Signed-off-by: ivan katliarchuk --- provider/aws/aws_test.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/provider/aws/aws_test.go b/provider/aws/aws_test.go index 899e0b69f..7ef5c612e 100644 --- a/provider/aws/aws_test.go +++ b/provider/aws/aws_test.go @@ -368,7 +368,7 @@ func TestAWSRecords(t *testing.T) { ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { - Name: aws.String("*.wildcard-test.zone-2.ext-dns-test-2.teapot.zalan.do."), + Name: aws.String(wildcardEscape("*.wildcard-test.zone-2.ext-dns-test-2.teapot.zalan.do.")), Type: aws.String(route53.RRTypeA), TTL: aws.Int64(recordTTL), ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, @@ -710,6 +710,14 @@ func TestAWSApplyChanges(t *testing.T) { TTL: aws.Int64(recordTTL), ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("30 mailhost1.foo.elb.amazonaws.com")}}, }, + { + Name: aws.String(specialCharactersEscape("escape-%!s()-codes.zone-2.ext-dns-test-2.teapot.zalan.do.")), + Type: aws.String(route53.RRTypeA), + TTL: aws.Int64(recordTTL), + ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + SetIdentifier: aws.String("no-change"), + Weight: aws.Int64(10), + }, }) createRecords := []*endpoint.Endpoint{ @@ -735,6 +743,7 @@ func TestAWSApplyChanges(t *testing.T) { endpoint.NewEndpoint("set-identifier-change.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4").WithSetIdentifier("before").WithProviderSpecific(providerSpecificWeight, "10"), endpoint.NewEndpoint("set-identifier-no-change.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4").WithSetIdentifier("no-change").WithProviderSpecific(providerSpecificWeight, "10"), endpoint.NewEndpoint("update-test-mx.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeMX, "10 mailhost2.bar.elb.amazonaws.com"), + // endpoint.NewEndpoint("escape-%!s()-codes.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4").WithSetIdentifier("policy-change").WithSetIdentifier("no-change").WithProviderSpecific(providerSpecificWeight, "10"), } updatedRecords := []*endpoint.Endpoint{ endpoint.NewEndpoint("update-test.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4"), @@ -876,6 +885,14 @@ func TestAWSApplyChanges(t *testing.T) { }, }) validateRecords(t, listAWSRecords(t, provider.clients[defaultAWSProfile], "/hostedzone/zone-2.ext-dns-test-2.teapot.zalan.do."), []*route53.ResourceRecordSet{ + { + Name: aws.String("escape-\\045\\041s\\050\\074nil\\076\\051-codes.zone-2.ext-dns-test-2.teapot.zalan.do."), + Type: aws.String(route53.RRTypeA), + TTL: aws.Int64(recordTTL), + ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + SetIdentifier: aws.String("no-change"), + Weight: aws.Int64(10), + }, { Name: aws.String("create-test.zone-2.ext-dns-test-2.teapot.zalan.do."), Type: aws.String(route53.RRTypeA), From 20634785ee8041bd32d973b3c6c3f7190d289f96 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sun, 30 Jun 2024 13:35:24 +0100 Subject: [PATCH 09/82] fix(issue-4448): added tests for A and Alias records Signed-off-by: ivan katliarchuk --- provider/aws/aws.go | 7 ++++--- provider/aws/aws_test.go | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index 6475ec6dd..4f9d11f03 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -456,6 +456,8 @@ func (p *AWSProvider) records(ctx context.Context, zones map[string]*profiledZon continue } + name := convertOctalToAscii(wildcardUnescape(aws.StringValue(r.Name))) + var ttl endpoint.TTL if r.TTL != nil { ttl = endpoint.TTL(*r.TTL) @@ -466,8 +468,7 @@ func (p *AWSProvider) records(ctx context.Context, zones map[string]*profiledZon for idx, rr := range r.ResourceRecords { targets[idx] = aws.StringValue(rr.Value) } - escaped := convertOctalToAscii(wildcardUnescape(aws.StringValue(r.Name))) - ep := endpoint.NewEndpointWithTTL(escaped, aws.StringValue(r.Type), ttl, targets...) + ep := endpoint.NewEndpointWithTTL(name, aws.StringValue(r.Type), ttl, targets...) if aws.StringValue(r.Type) == endpoint.RecordTypeCNAME { ep = ep.WithProviderSpecific(providerSpecificAlias, "false") } @@ -480,7 +481,7 @@ func (p *AWSProvider) records(ctx context.Context, zones map[string]*profiledZon ttl = recordTTL } ep := endpoint. - NewEndpointWithTTL(wildcardUnescape(aws.StringValue(r.Name)), endpoint.RecordTypeA, ttl, aws.StringValue(r.AliasTarget.DNSName)). + NewEndpointWithTTL(name, endpoint.RecordTypeA, ttl, aws.StringValue(r.AliasTarget.DNSName)). WithProviderSpecific(providerSpecificEvaluateTargetHealth, fmt.Sprintf("%t", aws.BoolValue(r.AliasTarget.EvaluateTargetHealth))). WithProviderSpecific(providerSpecificAlias, "true") newEndpoints = append(newEndpoints, ep) diff --git a/provider/aws/aws_test.go b/provider/aws/aws_test.go index 7ef5c612e..cec505bc5 100644 --- a/provider/aws/aws_test.go +++ b/provider/aws/aws_test.go @@ -379,6 +379,22 @@ func TestAWSRecords(t *testing.T) { TTL: aws.Int64(recordTTL), ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("example")}}, }, + { + Name: aws.String(specialCharactersEscape("escape-%!s()-codes-a.zone-2.ext-dns-test-2.teapot.zalan.do.")), + Type: aws.String(route53.RRTypeA), + TTL: aws.Int64(recordTTL), + ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + }, + { + Name: aws.String(specialCharactersEscape("escape-%!s()-codes-alias.zone-2.ext-dns-test-2.teapot.zalan.do.")), + Type: aws.String(route53.RRTypeA), + TTL: aws.Int64(recordTTL), + AliasTarget: &route53.AliasTarget{ + DNSName: aws.String("escape-codes.eu-central-1.elb.amazonaws.com."), + EvaluateTargetHealth: aws.Bool(false), + HostedZoneId: aws.String("Z215JYRZR1TBD5"), + }, + }, { Name: aws.String("list-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), Type: aws.String(route53.RRTypeA), @@ -522,6 +538,8 @@ func TestAWSRecords(t *testing.T) { endpoint.NewEndpointWithTTL("list-test.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "8.8.8.8"), endpoint.NewEndpointWithTTL("*.wildcard-test.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "8.8.8.8"), endpoint.NewEndpointWithTTL("escape-%!s()-codes.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeCNAME, endpoint.TTL(recordTTL), "example").WithProviderSpecific(providerSpecificAlias, "false"), + endpoint.NewEndpointWithTTL("escape-%!s()-codes-a.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "1.2.3.4"), + endpoint.NewEndpointWithTTL("escape-%!s()-codes-alias.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "escape-codes.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "false").WithProviderSpecific(providerSpecificAlias, "true"), endpoint.NewEndpointWithTTL("list-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "foo.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "false").WithProviderSpecific(providerSpecificAlias, "true"), endpoint.NewEndpointWithTTL("*.wildcard-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "foo.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "false").WithProviderSpecific(providerSpecificAlias, "true"), endpoint.NewEndpointWithTTL("list-test-alias-evaluate.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "foo.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "true").WithProviderSpecific(providerSpecificAlias, "true"), From 33514943fdc413a814e0fa31b753dc51d4de9be8 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sun, 30 Jun 2024 13:55:53 +0100 Subject: [PATCH 10/82] fix(issue-4448): aws.go intedation to tabs Signed-off-by: ivan katliarchuk --- provider/aws/aws.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index 4f9d11f03..c005cc78c 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -412,20 +412,20 @@ func convertOctalToAscii(input string) string { return input } var result strings.Builder - for i := 0; i < len(input); i++ { - if input[i] == '\\' && i+3 < len(input) { - octalStr := input[i+1 : i+4] - if octal, err := strconv.ParseInt(octalStr, 8, 8); err == nil { - result.WriteByte(byte(octal)) - i += 3 // Skip the next 3 characters (the octal code) - } else { - result.WriteByte(input[i]) - } - } else { - result.WriteByte(input[i]) - } - } - return result.String() + for i := 0; i < len(input); i++ { + if input[i] == '\\' && i+3 < len(input) { + octalStr := input[i+1 : i+4] + if octal, err := strconv.ParseInt(octalStr, 8, 8); err == nil { + result.WriteByte(byte(octal)) + i += 3 // Skip the next 3 characters (the octal code) + } else { + result.WriteByte(input[i]) + } + } else { + result.WriteByte(input[i]) + } + } + return result.String() } // validateDomainName checks if the domain name contains valid octal escape sequences. From 7249c6402a4d02fad0f537b635bb578c07c698f8 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sun, 30 Jun 2024 13:57:21 +0100 Subject: [PATCH 11/82] fix(issue-4448): aws.go intedation to tabs Signed-off-by: ivan katliarchuk --- provider/aws/aws_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider/aws/aws_test.go b/provider/aws/aws_test.go index cec505bc5..e813fcf05 100644 --- a/provider/aws/aws_test.go +++ b/provider/aws/aws_test.go @@ -143,7 +143,7 @@ func wildcardEscape(s string) string { return s } -// Route53 octal escapeshttps://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html +// Route53 octal escapes https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html func specialCharactersEscape(s string) string { var result strings.Builder for _, char := range s { From ee2219358b736696864a3be9a788b2a989adaf39 Mon Sep 17 00:00:00 2001 From: Julilla Paul <18239431+julillae@users.noreply.github.com> Date: Thu, 4 Jul 2024 13:06:19 -0700 Subject: [PATCH 12/82] fix: json marshal failure should be a real error --- provider/pdns/pdns.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider/pdns/pdns.go b/provider/pdns/pdns.go index fb705f519..ec92314b9 100644 --- a/provider/pdns/pdns.go +++ b/provider/pdns/pdns.go @@ -392,7 +392,7 @@ func (p *PDNSProvider) mutateRecords(endpoints []*endpoint.Endpoint, changetype for _, zone := range zonelist { jso, err := json.Marshal(zone) if err != nil { - return provider.NewSoftError(fmt.Errorf("JSON Marshal for zone struct failed: %v", err)) + log.Errorf("JSON Marshal for zone struct failed!") } else { log.Debugf("Struct for PatchZone:\n%s", string(jso)) } From 3aa5c91c23b022c109b6889001df65ca0df7ee3b Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Fri, 5 Jul 2024 20:15:38 +0100 Subject: [PATCH 13/82] fix(issue-4448): added another flavour of same function with tests Signed-off-by: ivan katliarchuk --- provider/aws/aws.go | 54 ++++++++++++++++++++++++++++++++++++++++ provider/aws/aws_test.go | 40 ++++++++++++++++++++++++++--- 2 files changed, 91 insertions(+), 3 deletions(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index c005cc78c..29befd2de 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -416,6 +416,7 @@ func convertOctalToAscii(input string) string { if input[i] == '\\' && i+3 < len(input) { octalStr := input[i+1 : i+4] if octal, err := strconv.ParseInt(octalStr, 8, 8); err == nil { + fmt.Println("string:", octalStr, " char:", byte(octal)) result.WriteByte(byte(octal)) i += 3 // Skip the next 3 characters (the octal code) } else { @@ -428,6 +429,59 @@ func convertOctalToAscii(input string) string { return result.String() } +var octalCharTable = map[string]byte{ + "041": byte(33), // exclamation mark + "042": byte(34), // double quote + "043": byte(35), // # number sing + "044": byte(36), // $ dollar + "045": byte(37), // % percentage + "046": byte(38), // & ampersand + "047": byte(39), // single quote + "050": byte(40), // ( left parenthesis + "051": byte(41), // ) right parenthesis + "052": byte(42), // * asterisk + "053": byte(43), // + plus + "054": byte(44), // , comma + "057": byte(47), // / forward slash + "072": byte(58), // : colon + "073": byte(59), // ; semicolon + "074": byte(60), // < less than sign + "075": byte(61), // = equal + "076": byte(62), // > greater than sign + "077": byte(63), // question mark + "100": byte(64), // @ at symbol + "133": byte(91), // [ left square bracket + "134": byte(92), // ] right square bracket + "135": byte(93), // ^ caret + "136": byte(94), // _ underscore + "140": byte(96), // ` backtick + "173": byte(123), // { left curly brace + "174": byte(124), // | vertical baar + "175": byte(125), // } right curly brace + "176": byte(126), // tilda +} + +func convertOctalToAsciiWithHashTable(input string) string { + if !containsOctalSequence(input) { + return input + } + var result strings.Builder + for i := 0; i < len(input); i++ { + if input[i] == '\\' && i+3 < len(input) { + octalStr := input[i+1 : i+4] + if char, ok := octalCharTable[octalStr]; ok { + result.WriteByte(char) + i += 3 // Skip the next 3 characters (the octal code) + } else { + result.WriteString(input[i : i+4]) // Keep the entire sequence if not found + } + } else { + result.WriteByte(input[i]) + } + } + return result.String() +} + // validateDomainName checks if the domain name contains valid octal escape sequences. func containsOctalSequence(domain string) bool { // Pattern to match valid octal escape sequences diff --git a/provider/aws/aws_test.go b/provider/aws/aws_test.go index e813fcf05..e74250ee3 100644 --- a/provider/aws/aws_test.go +++ b/provider/aws/aws_test.go @@ -386,9 +386,9 @@ func TestAWSRecords(t *testing.T) { ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, }, { - Name: aws.String(specialCharactersEscape("escape-%!s()-codes-alias.zone-2.ext-dns-test-2.teapot.zalan.do.")), - Type: aws.String(route53.RRTypeA), - TTL: aws.Int64(recordTTL), + Name: aws.String(specialCharactersEscape("escape-%!s()-codes-alias.zone-2.ext-dns-test-2.teapot.zalan.do.")), + Type: aws.String(route53.RRTypeA), + TTL: aws.Int64(recordTTL), AliasTarget: &route53.AliasTarget{ DNSName: aws.String("escape-codes.eu-central-1.elb.amazonaws.com."), EvaluateTargetHealth: aws.Bool(false), @@ -2084,3 +2084,37 @@ func TestRequiresDeleteCreate(t *testing.T) { assert.False(t, provider.requiresDeleteCreate(oldSetIdentifier, oldSetIdentifier), "actual and expected endpoints don't match. %+v:%+v", oldSetIdentifier, oldSetIdentifier) assert.True(t, provider.requiresDeleteCreate(oldSetIdentifier, newSetIdentifier), "actual and expected endpoints don't match. %+v:%+v", oldSetIdentifier, newSetIdentifier) } + +func TestConvertOctalToAscii(t *testing.T) { + tests := []struct { + name string + input string + expected string + }{ + { + name: "Characters escaped !\"#$%&'()*+,-/:;", + input: "txt-\\041\\042\\043\\044\\045\\046\\047\\050\\051\\052\\053\\054-\\057\\072\\073-test.example.com", + expected: "txt-!\"#$%&'()*+,-/:;-test.example.com", + }, + { + name: "Characters escaped <=>?@[\\]^_`{|}~", + input: "txt-\\074\\075\\076\\077\\100\\133\\134\\135\\136_\\140\\173\\174\\175\\176-test2.example.com", + expected: "txt-<=>?@[\\]^_`{|}~-test2.example.com", + }, + { + name: "No escaped characters in domain", + input: "txt-awesome-test3.example.com", + expected: "txt-awesome-test3.example.com", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // actual := convertOctalToAscii(tt.input) + // assert.Equal(t, tt.expected, actual) + + actualv := convertOctalToAsciiWithHashTable(tt.input) + assert.Equal(t, tt.expected, actualv) + }) + } +} From fca99146137b27a7000a7e91e07d81c566b42d04 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Fri, 5 Jul 2024 20:29:40 +0100 Subject: [PATCH 14/82] fix(issue-4448): uncomment test Signed-off-by: ivan katliarchuk --- provider/aws/aws_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provider/aws/aws_test.go b/provider/aws/aws_test.go index e74250ee3..b33d2bb61 100644 --- a/provider/aws/aws_test.go +++ b/provider/aws/aws_test.go @@ -2110,8 +2110,8 @@ func TestConvertOctalToAscii(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - // actual := convertOctalToAscii(tt.input) - // assert.Equal(t, tt.expected, actual) + actual := convertOctalToAscii(tt.input) + assert.Equal(t, tt.expected, actual) actualv := convertOctalToAsciiWithHashTable(tt.input) assert.Equal(t, tt.expected, actualv) From b1bfffbe51c0087ede10c910d4c46a810daa4270 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Fri, 5 Jul 2024 20:37:00 +0100 Subject: [PATCH 15/82] fix(issue-4448): uncomment test Signed-off-by: ivan katliarchuk --- provider/aws/aws.go | 1 - provider/aws/aws_test.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index 29befd2de..68ed15f0b 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -416,7 +416,6 @@ func convertOctalToAscii(input string) string { if input[i] == '\\' && i+3 < len(input) { octalStr := input[i+1 : i+4] if octal, err := strconv.ParseInt(octalStr, 8, 8); err == nil { - fmt.Println("string:", octalStr, " char:", byte(octal)) result.WriteByte(byte(octal)) i += 3 // Skip the next 3 characters (the octal code) } else { diff --git a/provider/aws/aws_test.go b/provider/aws/aws_test.go index b33d2bb61..f095d6d8f 100644 --- a/provider/aws/aws_test.go +++ b/provider/aws/aws_test.go @@ -761,7 +761,7 @@ func TestAWSApplyChanges(t *testing.T) { endpoint.NewEndpoint("set-identifier-change.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4").WithSetIdentifier("before").WithProviderSpecific(providerSpecificWeight, "10"), endpoint.NewEndpoint("set-identifier-no-change.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4").WithSetIdentifier("no-change").WithProviderSpecific(providerSpecificWeight, "10"), endpoint.NewEndpoint("update-test-mx.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeMX, "10 mailhost2.bar.elb.amazonaws.com"), - // endpoint.NewEndpoint("escape-%!s()-codes.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4").WithSetIdentifier("policy-change").WithSetIdentifier("no-change").WithProviderSpecific(providerSpecificWeight, "10"), + endpoint.NewEndpoint("escape-%!s()-codes.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4").WithSetIdentifier("policy-change").WithSetIdentifier("no-change").WithProviderSpecific(providerSpecificWeight, "10"), } updatedRecords := []*endpoint.Endpoint{ endpoint.NewEndpoint("update-test.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4"), From a5b1d0f51b570787993fe6c8f7e1358d7124820c Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Tue, 9 Jul 2024 20:53:57 +0100 Subject: [PATCH 16/82] swap with golang function Signed-off-by: ivan katliarchuk --- provider/aws/aws.go | 71 +++------------------------------------------ 1 file changed, 4 insertions(+), 67 deletions(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index 68ed15f0b..b2effb867 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -20,11 +20,11 @@ import ( "context" "errors" "fmt" + "regexp" "sort" "strconv" "strings" "time" - "regexp" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" @@ -411,74 +411,11 @@ func convertOctalToAscii(input string) string { if !containsOctalSequence(input) { return input } - var result strings.Builder - for i := 0; i < len(input); i++ { - if input[i] == '\\' && i+3 < len(input) { - octalStr := input[i+1 : i+4] - if octal, err := strconv.ParseInt(octalStr, 8, 8); err == nil { - result.WriteByte(byte(octal)) - i += 3 // Skip the next 3 characters (the octal code) - } else { - result.WriteByte(input[i]) - } - } else { - result.WriteByte(input[i]) - } - } - return result.String() -} - -var octalCharTable = map[string]byte{ - "041": byte(33), // exclamation mark - "042": byte(34), // double quote - "043": byte(35), // # number sing - "044": byte(36), // $ dollar - "045": byte(37), // % percentage - "046": byte(38), // & ampersand - "047": byte(39), // single quote - "050": byte(40), // ( left parenthesis - "051": byte(41), // ) right parenthesis - "052": byte(42), // * asterisk - "053": byte(43), // + plus - "054": byte(44), // , comma - "057": byte(47), // / forward slash - "072": byte(58), // : colon - "073": byte(59), // ; semicolon - "074": byte(60), // < less than sign - "075": byte(61), // = equal - "076": byte(62), // > greater than sign - "077": byte(63), // question mark - "100": byte(64), // @ at symbol - "133": byte(91), // [ left square bracket - "134": byte(92), // ] right square bracket - "135": byte(93), // ^ caret - "136": byte(94), // _ underscore - "140": byte(96), // ` backtick - "173": byte(123), // { left curly brace - "174": byte(124), // | vertical baar - "175": byte(125), // } right curly brace - "176": byte(126), // tilda -} - -func convertOctalToAsciiWithHashTable(input string) string { - if !containsOctalSequence(input) { + result, err := strconv.Unquote("\"" + input + "\"") + if err != nil { return input } - var result strings.Builder - for i := 0; i < len(input); i++ { - if input[i] == '\\' && i+3 < len(input) { - octalStr := input[i+1 : i+4] - if char, ok := octalCharTable[octalStr]; ok { - result.WriteByte(char) - i += 3 // Skip the next 3 characters (the octal code) - } else { - result.WriteString(input[i : i+4]) // Keep the entire sequence if not found - } - } else { - result.WriteByte(input[i]) - } - } - return result.String() + return result } // validateDomainName checks if the domain name contains valid octal escape sequences. From eb7320227074cad0f8af834a97abcf4ad14e9123 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Tue, 9 Jul 2024 20:56:26 +0100 Subject: [PATCH 17/82] swap with golang function Signed-off-by: ivan katliarchuk --- go.mod | 2 +- go.sum | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 73e146a00..93bc77ee8 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/alecthomas/kingpin/v2 v2.4.0 github.com/aliyun/alibaba-cloud-sdk-go v1.62.771 github.com/ans-group/sdk-go v1.17.0 - github.com/aws/aws-sdk-go v1.54.11 + github.com/aws/aws-sdk-go v1.54.4 github.com/bodgit/tsig v1.2.2 github.com/cenkalti/backoff/v4 v4.3.0 github.com/civo/civogo v0.3.70 diff --git a/go.sum b/go.sum index 9c0559ab6..8731741ed 100644 --- a/go.sum +++ b/go.sum @@ -154,8 +154,6 @@ github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZo github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.54.4 h1:xZga3fPu7uxVgh83DIaQlb7r0cixFx1xKiiROTWAhpU= github.com/aws/aws-sdk-go v1.54.4/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= -github.com/aws/aws-sdk-go v1.54.11 h1:Zxuv/R+IVS0B66yz4uezhxH9FN9/G2nbxejYqAMFjxk= -github.com/aws/aws-sdk-go v1.54.11/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= From 2b14345083aa1492eb31b0efdc2612cea99d6d21 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Tue, 9 Jul 2024 21:05:57 +0100 Subject: [PATCH 18/82] issue-4448: fix test Signed-off-by: ivan katliarchuk --- provider/aws/aws_test.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/provider/aws/aws_test.go b/provider/aws/aws_test.go index f095d6d8f..4badf7421 100644 --- a/provider/aws/aws_test.go +++ b/provider/aws/aws_test.go @@ -2112,9 +2112,6 @@ func TestConvertOctalToAscii(t *testing.T) { t.Run(tt.name, func(t *testing.T) { actual := convertOctalToAscii(tt.input) assert.Equal(t, tt.expected, actual) - - actualv := convertOctalToAsciiWithHashTable(tt.input) - assert.Equal(t, tt.expected, actualv) }) } } From f653ea1eddbb6fc74f9f780f8766bb6cacc58264 Mon Sep 17 00:00:00 2001 From: Saravanan Palanisamy Date: Thu, 1 Aug 2024 13:54:17 +0400 Subject: [PATCH 19/82] Add trailing dot for MX and SRV records in pdns provider --- provider/pdns/pdns.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider/pdns/pdns.go b/provider/pdns/pdns.go index fbc7cc22f..1d9b56332 100644 --- a/provider/pdns/pdns.go +++ b/provider/pdns/pdns.go @@ -314,7 +314,7 @@ func (p *PDNSProvider) ConvertEndpointsToZones(eps []*endpoint.Endpoint, changet records := []pgo.Record{} RecordType_ := ep.RecordType for _, t := range ep.Targets { - if ep.RecordType == "CNAME" || ep.RecordType == "ALIAS" { + if ep.RecordType == "CNAME" || ep.RecordType == "ALIAS" || ep.RecordType == "MX" || ep.RecordType == "SRV" { t = provider.EnsureTrailingDot(t) } records = append(records, pgo.Record{Content: t}) From f4eeeae7f79acc6285a043b9baea579e81650e55 Mon Sep 17 00:00:00 2001 From: Saravanan Palanisamy Date: Fri, 2 Aug 2024 16:20:03 +0400 Subject: [PATCH 20/82] update pdns tutorial documentation --- docs/tutorials/pdns.md | 99 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/docs/tutorials/pdns.md b/docs/tutorials/pdns.md index 72aa3fc85..0c394dc33 100644 --- a/docs/tutorials/pdns.md +++ b/docs/tutorials/pdns.md @@ -172,3 +172,102 @@ Once the API shows the record correctly, you can double check your record using: ```bash $ dig @${PDNS_FQDN} echo.example.com. ``` + +## Using CRD source to manage DNS records in PowerDNS + +[CRD source](https://github.com/kubernetes-sigs/external-dns/blob/master/docs/contributing/crd-source.md) provides a generic mechanism and declarative way to manage DNS records in PowerDNS using external-dns. + +```bash +external-dns --source=crd --provider=pdns \ + --pdns-server={{ pdns-api-url }} \ + --pdns-api-key={{ pdns-api-key }} \ + --domain-filter=example.com \ + --managed-record-types=A \ + --managed-record-types=CNAME \ + --managed-record-types=TXT \ + --managed-record-types=MX \ + --managed-record-types=SRV +``` + +Not all the record types are enabled by default so we can enable the required record types using `--managed-record-types`. + +* Example for record type `A` + +```yaml +apiVersion: externaldns.k8s.io/v1alpha1 +kind: DNSEndpoint +metadata: + name: examplearecord +spec: + endpoints: + - dnsName: example.com + recordTTL: 60 + recordType: A + targets: + - 10.0.0.1 +``` + +* Example for record type `CNAME` + +```yaml +apiVersion: externaldns.k8s.io/v1alpha1 +kind: DNSEndpoint +metadata: + name: examplecnamerecord +spec: + endpoints: + - dnsName: test-a.example.com + recordTTL: 300 + recordType: CNAME + targets: + - example.com +``` + +* Example for record type `TXT` + +```yaml +apiVersion: externaldns.k8s.io/v1alpha1 +kind: DNSEndpoint +metadata: + name: exampletxtrecord +spec: + endpoints: + - dnsName: example.com + recordTTL: 3600 + recordType: TXT + targets: + - '"v=spf1 include:spf.protection.example.com include:example.org -all"' + - '"apple-domain-verification=XXXXXXXXXXXXX"' +``` + +* Example for record type `MX` + +```yaml +apiVersion: externaldns.k8s.io/v1alpha1 +kind: DNSEndpoint +metadata: + name: examplemxrecord +spec: + endpoints: + - dnsName: example.com + recordTTL: 3600 + recordType: MX + targets: + - "10 mailhost1.example.com" +``` + +* Example for record type `SRV` + +```yaml +apiVersion: externaldns.k8s.io/v1alpha1 +kind: DNSEndpoint +metadata: + name: examplesrvrecord +spec: + endpoints: + - dnsName: _service._tls.example.com + recordTTL: 180 + recordType: SRV + targets: + - "100 1 443 service.example.com" +``` \ No newline at end of file From 0ec4ae3c47d2db834243853cc5c6ccf70b0a9833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Thu, 8 Aug 2024 15:52:05 +0200 Subject: [PATCH 21/82] [helm] Add global.imagePullSecrets --- charts/external-dns/templates/deployment.yaml | 2 +- charts/external-dns/values.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/external-dns/templates/deployment.yaml b/charts/external-dns/templates/deployment.yaml index 71b00937f..7597a57cd 100644 --- a/charts/external-dns/templates/deployment.yaml +++ b/charts/external-dns/templates/deployment.yaml @@ -40,7 +40,7 @@ spec: {{- if not (quote .Values.automountServiceAccountToken | empty) }} automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} {{- end }} - {{- with .Values.imagePullSecrets }} + {{- with (.Values.global.imagePullSecrets | default .Values.imagePullSecrets) }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/external-dns/values.yaml b/charts/external-dns/values.yaml index 060dd1ffe..531a0436a 100644 --- a/charts/external-dns/values.yaml +++ b/charts/external-dns/values.yaml @@ -2,6 +2,10 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. +global: + # -- Global image pull secrets. + imagePullSecrets: [] + image: # -- Image repository for the `external-dns` container. repository: registry.k8s.io/external-dns/external-dns From ab58f50c9e676170b5aa73f75e3b578ef9d93643 Mon Sep 17 00:00:00 2001 From: Saravanan Palanisamy Date: Sun, 11 Aug 2024 21:24:17 +0400 Subject: [PATCH 22/82] update test cases --- provider/pdns/pdns_test.go | 39 +++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/provider/pdns/pdns_test.go b/provider/pdns/pdns_test.go index 01489da9c..13f5a7efc 100644 --- a/provider/pdns/pdns_test.go +++ b/provider/pdns/pdns_test.go @@ -117,6 +117,27 @@ var ( }, } + // RRSet with MX record + RRSetMXRecord = pgo.RrSet{ + Name: "example.com.", + Type_: "MX", + Ttl: 300, + Records: []pgo.Record{ + {Content: "10 mailhost1.example.com", Disabled: false, SetPtr: false}, + {Content: "10 mailhost2.example.com", Disabled: false, SetPtr: false}, + }, + } + + // RRSet with SRV record + RRSetSRVRecord = pgo.RrSet{ + Name: "_service._tls.example.com.", + Type_: "SRV", + Ttl: 300, + Records: []pgo.Record{ + {Content: "100 1 443 service.example.com", Disabled: false, SetPtr: false}, + }, + } + endpointsDisabledRecord = []*endpoint.Endpoint{ endpoint.NewEndpointWithTTL("example.com", endpoint.RecordTypeA, endpoint.TTL(300), "8.8.8.8"), } @@ -144,6 +165,8 @@ var ( endpoint.NewEndpointWithTTL("example.com", endpoint.RecordTypeTXT, endpoint.TTL(300), "'would smell as sweet'"), endpoint.NewEndpointWithTTL("example.com", endpoint.RecordTypeA, endpoint.TTL(300), "8.8.8.8", "8.8.4.4", "4.4.4.4"), endpoint.NewEndpointWithTTL("alias.example.com", endpoint.RecordTypeCNAME, endpoint.TTL(300), "example.by.any.other.name.com"), + endpoint.NewEndpointWithTTL("example.com", endpoint.RecordTypeMX, endpoint.TTL(300), "10 mailhost1.example.com", "10 mailhost2.example.com"), + endpoint.NewEndpointWithTTL("_service._tls.example.com", endpoint.RecordTypeSRV, endpoint.TTL(300), "100 1 443 service.example.com"), } endpointsMultipleZones = []*endpoint.Endpoint{ @@ -233,7 +256,7 @@ var ( Type_: "Zone", Url: "/api/v1/servers/localhost/zones/example.com.", Kind: "Native", - Rrsets: []pgo.RrSet{RRSetCNAMERecord, RRSetTXTRecord, RRSetMultipleRecords, RRSetALIASRecord}, + Rrsets: []pgo.RrSet{RRSetCNAMERecord, RRSetTXTRecord, RRSetMultipleRecords, RRSetALIASRecord, RRSetMXRecord, RRSetSRVRecord}, } ZoneEmptyToSimplePatch = pgo.Zone{ @@ -944,6 +967,20 @@ func (suite *NewPDNSProviderTestSuite) TestPDNSConvertEndpointsToZones() { } } + // Check endpoints of type MX and SRV always have their values end with a trailing dot. + zlist, err = p.ConvertEndpointsToZones(endpointsMixedRecords, PdnsReplace) + assert.Nil(suite.T(), err) + + for _, z := range zlist { + for _, rs := range z.Rrsets { + if rs.Type_ == "MX" || rs.Type_ == "SRV" { + for _, r := range rs.Records { + assert.Equal(suite.T(), uint8(0x2e), r.Content[len(r.Content)-1]) + } + } + } + } + // Check endpoints of type CNAME are converted to ALIAS on the domain apex zlist, err = p.ConvertEndpointsToZones(endpointsApexRecords, PdnsReplace) assert.Nil(suite.T(), err) From 92ced0920a1126aaae923553b3574b70bb8efdb0 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Mon, 12 Aug 2024 09:11:23 +0100 Subject: [PATCH 23/82] chore(github-actions): added scorecard github action Signed-off-by: ivan katliarchuk --- .github/workflows/scorecards.yml | 69 ++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/scorecards.yml diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml new file mode 100644 index 000000000..60be0ecf7 --- /dev/null +++ b/.github/workflows/scorecards.yml @@ -0,0 +1,69 @@ +name: Scorecard supply-chain security +on: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: '25 7 * * 0' + push: + branches: [ "main" ] + +# Declare default permissions as read only. +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + # Uncomment the permissions below if installing in a private repository. + # contents: read + # actions: read + + steps: + - name: "Checkout code" + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 + with: + results_file: results.sarif + results_format: sarif + # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: + # - you want to enable the Branch-Protection check on a *public* repository, or + # - you are installing Scorecard on a *private* repository + # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional. + # repo_token: ${{ secrets.SCORECARD_TOKEN }} + + # Public repositories: + # - Publish results to OpenSSF REST API for easy access by consumers + # - Allows the repository to include the Scorecard badge. + # - See https://github.com/ossf/scorecard-action#publishing-results. + # For private repositories: + # - `publish_results` will always be set to `false`, regardless + # of the value entered here. + publish_results: true + + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF + # format to the repository Actions tab. + - name: "Upload artifact" + uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard (optional). + # Commenting out will disable upload of results to your repo's Code Scanning dashboard + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: results.sarif From 828f68f09f619f2c40c3aa7f3a41608e9cf9434f Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Mon, 12 Aug 2024 09:14:56 +0100 Subject: [PATCH 24/82] chore(github-actions): added scorecard github action Signed-off-by: ivan katliarchuk --- .github/workflows/scorecards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 60be0ecf7..6dc19d2e0 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -8,7 +8,7 @@ on: schedule: - cron: '25 7 * * 0' push: - branches: [ "main" ] + branches: [ "main" , "issue-4673"] # Declare default permissions as read only. permissions: read-all From 4b0954ca6bbbd4ea27357f5e572e938e0c654ae4 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Mon, 12 Aug 2024 09:25:59 +0100 Subject: [PATCH 25/82] chore(github-actions): test with workflow dispatch Signed-off-by: ivan katliarchuk --- .github/workflows/scorecards.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 6dc19d2e0..bd7890cad 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -9,6 +9,7 @@ on: - cron: '25 7 * * 0' push: branches: [ "main" , "issue-4673"] + workflow_dispatch: # Declare default permissions as read only. permissions: read-all From 3f73f86da044fbcd58f140e5c459cc3c6b030ad4 Mon Sep 17 00:00:00 2001 From: EWK20 Date: Thu, 15 Aug 2024 10:56:46 +0100 Subject: [PATCH 26/82] adds soft error for google provider --- provider/google/google.go | 6 +++--- provider/google/google_test.go | 15 +++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/provider/google/google.go b/provider/google/google.go index c3c9270f0..3502d6474 100644 --- a/provider/google/google.go +++ b/provider/google/google.go @@ -194,7 +194,7 @@ func (p *GoogleProvider) Zones(ctx context.Context) (map[string]*dns.ManagedZone log.Debugf("Matching zones against domain filters: %v", p.domainFilter) if err := p.managedZonesClient.List(p.project).Pages(ctx, f); err != nil { - return nil, err + return nil, provider.NewSoftError(fmt.Errorf("failed to list zones: %w", err)) } if len(zones) == 0 { @@ -228,7 +228,7 @@ func (p *GoogleProvider) Records(ctx context.Context) (endpoints []*endpoint.End for _, z := range zones { if err := p.resourceRecordSetsClient.List(p.project, z.Name).Pages(ctx, f); err != nil { - return nil, err + return nil, provider.NewSoftError(fmt.Errorf("failed to list records in zone %s: %w", z.Name, err)) } } @@ -302,7 +302,7 @@ func (p *GoogleProvider) submitChange(ctx context.Context, change *dns.Change) e } if _, err := p.changesClient.Create(p.project, zone, c).Do(); err != nil { - return err + return provider.NewSoftError(fmt.Errorf("failed to create changes: %w", err)) } time.Sleep(p.batchChangeInterval) diff --git a/provider/google/google_test.go b/provider/google/google_test.go index dea1774a7..ea1428392 100644 --- a/provider/google/google_test.go +++ b/provider/google/google_test.go @@ -242,7 +242,7 @@ func TestGoogleZonesVisibilityFilterPrivatePeering(t *testing.T) { zones, err := provider.Zones(context.Background()) require.NoError(t, err) - + validateZones(t, zones, map[string]*dns.ManagedZone{ "svc-local": {Name: "svc-local", DnsName: "svc.local.", Id: 1005, Visibility: "private"}, }) @@ -647,7 +647,7 @@ func validateChangeRecord(t *testing.T, record *dns.ResourceRecordSet, expected assert.Equal(t, expected.Type, record.Type) } -func newGoogleProviderZoneOverlap(t *testing.T, domainFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, zoneTypeFilter provider.ZoneTypeFilter, dryRun bool, records []*endpoint.Endpoint) *GoogleProvider { +func newGoogleProviderZoneOverlap(t *testing.T, domainFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, zoneTypeFilter provider.ZoneTypeFilter, dryRun bool, _ []*endpoint.Endpoint) *GoogleProvider { provider := &GoogleProvider{ project: "zalando-external-dns-test", dryRun: false, @@ -694,7 +694,6 @@ func newGoogleProviderZoneOverlap(t *testing.T, domainFilter endpoint.DomainFilt Visibility: "private", }) - createZone(t, provider, &dns.ManagedZone{ Name: "svc-local", DnsName: "svc.local.", @@ -703,13 +702,13 @@ func newGoogleProviderZoneOverlap(t *testing.T, domainFilter endpoint.DomainFilt }) createZone(t, provider, &dns.ManagedZone{ - Name: "svc-local-peer", - DnsName: "svc.local.", - Id: 10006, - Visibility: "private", + Name: "svc-local-peer", + DnsName: "svc.local.", + Id: 10006, + Visibility: "private", PeeringConfig: &dns.ManagedZonePeeringConfig{TargetNetwork: nil}, }) - + provider.dryRun = dryRun return provider From cc4439f6245deec8e2153af588ee5d1d6a133bcf Mon Sep 17 00:00:00 2001 From: Kim Sondrup Date: Mon, 19 Aug 2024 23:47:16 +0200 Subject: [PATCH 27/82] doc: Update webhook-provider API to fix K8s probe --- docs/tutorials/webhook-provider.md | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/docs/tutorials/webhook-provider.md b/docs/tutorials/webhook-provider.md index 684ab1acc..e3e52f06b 100644 --- a/docs/tutorials/webhook-provider.md +++ b/docs/tutorials/webhook-provider.md @@ -16,24 +16,32 @@ Providers implementing the HTTP API have to keep in sync with changes to the JSO The following table represents the methods to implement mapped to their HTTP method and route. -| Provider method | HTTP Method | Route | -| --- | --- | --- | -| Records | GET | /records | -| AdjustEndpoints | POST | /adjustendpoints | -| ApplyChanges | POST | /records | -| K8s probe | GET | /healthz | + +### Provider endpoints + +| Provider method | HTTP Method | Route | Description | +| --------------- | ----------- | ---------------- | ---------------------------------------- | +| Negotiate | GET | / | Negotiate `DomainFilter` | +| Records | GET | /records | Get records | +| AdjustEndpoints | POST | /adjustendpoints | Provider specific adjustments of records | +| ApplyChanges | POST | /records | Apply record | ExternalDNS will also make requests to the `/` endpoint for negotiation and for deserialization of the `DomainFilter`. The server needs to respond to those requests by reading the `Accept` header and responding with a corresponding `Content-Type` header specifying the supported media type format and version. -The default recommended port is 8888, and should listen only on localhost (ie: only accessible for k8s probes and external-dns). +The default recommended port for the provider endpoints is `8888`, and should listen only on `localhost` (ie: only accessible for external-dns). **NOTE**: only `5xx` responses will be retried and only `20x` will be considered as successful. All status codes different from those will be considered a failure on ExternalDNS's side. -## Metrics support +### Exposed endpoints -The metrics should listen ":8080" on `/metrics` following [Open Metrics](https://github.com/OpenObservability/OpenMetrics) format. +| Provider method | HTTP Method | Route | Description | +| --------------- | ----------- | -------- | -------------------------------------------------------------------------------------------- | +| K8s probe | GET | /healthz | Used by `livenessProbe` and `readinessProbe` | +| Open Metrics | GET | /metrics | Optional endpoint to expose [Open Metrics](https://github.com/OpenObservability/OpenMetrics) | + +The default recommended port for the exposed endpoints is `8080`, and it should be bound to all interfaces (`0.0.0.0`) ## Custom Annotations From 9637c58e91ea4f18803f8047f981b7f2532e31c3 Mon Sep 17 00:00:00 2001 From: Oleksandr Simonov Date: Mon, 19 Aug 2024 20:12:06 +0300 Subject: [PATCH 28/82] add support for MX and TXT records for DigitalOcean provider --- provider/digitalocean/digital_ocean.go | 68 +++++++- provider/digitalocean/digital_ocean_test.go | 162 ++++++++++++++++++-- 2 files changed, 210 insertions(+), 20 deletions(-) diff --git a/provider/digitalocean/digital_ocean.go b/provider/digitalocean/digital_ocean.go index 20cfcefa0..777d8c80d 100644 --- a/provider/digitalocean/digital_ocean.go +++ b/provider/digitalocean/digital_ocean.go @@ -20,6 +20,7 @@ import ( "context" "fmt" "os" + "strconv" "strings" "github.com/digitalocean/godo" @@ -158,13 +159,15 @@ func (p *DigitalOceanProvider) Records(ctx context.Context) ([]*endpoint.Endpoin endpoints := []*endpoint.Endpoint{} for _, zone := range zones { records, err := p.fetchRecords(ctx, zone.Name) + if err != nil { return nil, err } for _, r := range records { - if provider.SupportedRecordType(r.Type) { + if p.SupportedRecordType(r.Type) { name := r.Name + "." + zone.Name + data := r.Data // root name is identified by @ and should be // translated to zone name for the endpoint entry. @@ -172,7 +175,11 @@ func (p *DigitalOceanProvider) Records(ctx context.Context) ([]*endpoint.Endpoin name = zone.Name } - ep := endpoint.NewEndpointWithTTL(name, r.Type, endpoint.TTL(r.TTL), r.Data) + if r.Type == endpoint.RecordTypeMX { + data = fmt.Sprintf("%d %s", r.Priority, r.Data) + } + + ep := endpoint.NewEndpointWithTTL(name, r.Type, endpoint.TTL(r.TTL), data) endpoints = append(endpoints, ep) } @@ -283,16 +290,26 @@ func makeDomainEditRequest(domain, name, recordType, data string, ttl int) *godo // For some reason the DO API requires the '.' at the end of "data" in case of CNAME request. // Example: {"type":"CNAME","name":"hello","data":"www.example.com."} - if recordType == endpoint.RecordTypeCNAME && !strings.HasSuffix(data, ".") { + if (recordType == endpoint.RecordTypeCNAME || recordType == endpoint.RecordTypeMX) && !strings.HasSuffix(data, ".") { data += "." } - return &godo.DomainRecordEditRequest{ + request := &godo.DomainRecordEditRequest{ Name: adjustedName, Type: recordType, Data: data, TTL: ttl, } + + if recordType == endpoint.RecordTypeMX { + priority, domain, err := parseMxTarget(data) + if err == nil { + request.Priority = int(priority) + request.Data = provider.EnsureTrailingDot(domain) + } + } + + return request } // submitChanges applies an instance of `digitalOceanChanges` to the DigitalOcean API. @@ -303,13 +320,19 @@ func (p *DigitalOceanProvider) submitChanges(ctx context.Context, changes *digit } for _, c := range changes.Creates { - log.WithFields(log.Fields{ + logFields := log.Fields{ "domain": c.Domain, "dnsName": c.Options.Name, "recordType": c.Options.Type, "data": c.Options.Data, "ttl": c.Options.TTL, - }).Debug("Creating domain record") + } + + if c.Options.Type == endpoint.RecordTypeMX { + logFields["priotity"] = c.Options.Priority + } + + log.WithFields(logFields).Debug("Creating domain record") if p.DryRun { continue @@ -322,13 +345,17 @@ func (p *DigitalOceanProvider) submitChanges(ctx context.Context, changes *digit } for _, u := range changes.Updates { - log.WithFields(log.Fields{ + logFields := log.Fields{ "domain": u.Domain, "dnsName": u.Options.Name, "recordType": u.Options.Type, "data": u.Options.Data, "ttl": u.Options.TTL, - }).Debug("Updating domain record") + } + if u.Options.Type == endpoint.RecordTypeMX { + logFields["priotity"] = u.Options.Priority + } + log.WithFields(logFields).Debug("Updating domain record") if p.DryRun { continue @@ -589,6 +616,16 @@ func processDeleteActions( return nil } +// SupportedRecordType returns true if the record type is supported by the provider +func (p *DigitalOceanProvider) SupportedRecordType(recordType string) bool { + switch recordType { + case "MX", "TXT": + return true + default: + return provider.SupportedRecordType(recordType) + } +} + // ApplyChanges applies the given set of generic changes to the provider. func (p *DigitalOceanProvider) ApplyChanges(ctx context.Context, planChanges *plan.Changes) error { // TODO: This should only retrieve zones affected by the given `planChanges`. @@ -617,3 +654,18 @@ func (p *DigitalOceanProvider) ApplyChanges(ctx context.Context, planChanges *pl return p.submitChanges(ctx, &changes) } + +func parseMxTarget(mxTarget string) (priority int64, exchange string, err error) { + targetParts := strings.SplitN(mxTarget, " ", 2) + if len(targetParts) != 2 { + return priority, exchange, fmt.Errorf("mx target needs to be of form '10 example.com'") + } + + priorityRaw, exchange := targetParts[0], targetParts[1] + priority, err = strconv.ParseInt(priorityRaw, 10, 32) + if err != nil { + return priority, exchange, fmt.Errorf("invalid priority specified") + } + + return priority, exchange, nil +} diff --git a/provider/digitalocean/digital_ocean_test.go b/provider/digitalocean/digital_ocean_test.go index d16be2471..567c56619 100644 --- a/provider/digitalocean/digital_ocean_test.go +++ b/provider/digitalocean/digital_ocean_test.go @@ -100,6 +100,9 @@ func (m *mockDigitalOceanClient) Records(ctx context.Context, domain string, opt {ID: 1, Name: "foo.ext-dns-test", Type: "CNAME"}, {ID: 2, Name: "bar.ext-dns-test", Type: "CNAME"}, {ID: 3, Name: "@", Type: endpoint.RecordTypeCNAME}, + {ID: 4, Name: "@", Type: endpoint.RecordTypeMX, Priority: 10, Data: "mx1.foo.com."}, + {ID: 5, Name: "@", Type: endpoint.RecordTypeMX, Priority: 10, Data: "mx2.foo.com."}, + {ID: 6, Name: "@", Type: endpoint.RecordTypeTXT, Data: "SOME-TXT-TEXT"}, }, &godo.Response{ Links: &godo.Links{ Pages: &godo.Pages{ @@ -344,6 +347,28 @@ func TestDigitalOceanMakeDomainEditRequest(t *testing.T) { Data: "bar.example.com.", TTL: customTTL, }, r4) + + // Ensure that MX records have `.` appended. + r5 := makeDomainEditRequest("example.com", "foo.example.com", endpoint.RecordTypeMX, + "10 mx.example.com", digitalOceanRecordTTL) + assert.Equal(t, &godo.DomainRecordEditRequest{ + Type: endpoint.RecordTypeMX, + Name: "foo", + Data: "mx.example.com.", + Priority: 10, + TTL: digitalOceanRecordTTL, + }, r5) + + // Ensure that MX records do not have an extra `.` appended if they already have a `.` + r6 := makeDomainEditRequest("example.com", "foo.example.com", endpoint.RecordTypeMX, + "10 mx.example.com.", digitalOceanRecordTTL) + assert.Equal(t, &godo.DomainRecordEditRequest{ + Type: endpoint.RecordTypeMX, + Name: "foo", + Data: "mx.example.com.", + Priority: 10, + TTL: digitalOceanRecordTTL, + }, r6) } func TestDigitalOceanApplyChanges(t *testing.T) { @@ -375,6 +400,8 @@ func TestDigitalOceanProcessCreateActions(t *testing.T) { "example.com": { endpoint.NewEndpoint("foo.example.com", endpoint.RecordTypeA, "1.2.3.4"), endpoint.NewEndpoint("example.com", endpoint.RecordTypeCNAME, "foo.example.com"), + endpoint.NewEndpoint("example.com", endpoint.RecordTypeMX, "10 mx.example.com"), + endpoint.NewEndpoint("example.com", endpoint.RecordTypeTXT, "SOME-TXT-TEXT"), }, } @@ -382,7 +409,7 @@ func TestDigitalOceanProcessCreateActions(t *testing.T) { err := processCreateActions(recordsByDomain, createsByDomain, &changes) require.NoError(t, err) - assert.Equal(t, 2, len(changes.Creates)) + assert.Equal(t, 4, len(changes.Creates)) assert.Equal(t, 0, len(changes.Updates)) assert.Equal(t, 0, len(changes.Deletes)) @@ -405,6 +432,25 @@ func TestDigitalOceanProcessCreateActions(t *testing.T) { TTL: digitalOceanRecordTTL, }, }, + { + Domain: "example.com", + Options: &godo.DomainRecordEditRequest{ + Name: "@", + Type: endpoint.RecordTypeMX, + Priority: 10, + Data: "mx.example.com.", + TTL: digitalOceanRecordTTL, + }, + }, + { + Domain: "example.com", + Options: &godo.DomainRecordEditRequest{ + Name: "@", + Type: endpoint.RecordTypeTXT, + Data: "SOME-TXT-TEXT", + TTL: digitalOceanRecordTTL, + }, + }, } if !elementsMatch(t, expectedCreates, changes.Creates) { @@ -436,6 +482,29 @@ func TestDigitalOceanProcessUpdateActions(t *testing.T) { Data: "foo.example.com.", TTL: digitalOceanRecordTTL, }, + { + ID: 4, + Name: "@", + Type: endpoint.RecordTypeMX, + Data: "mx1.example.com.", + Priority: 10, + TTL: digitalOceanRecordTTL, + }, + { + ID: 5, + Name: "@", + Type: endpoint.RecordTypeMX, + Data: "mx2.example.com.", + Priority: 10, + TTL: digitalOceanRecordTTL, + }, + { + ID: 6, + Name: "@", + Type: endpoint.RecordTypeTXT, + Data: "SOME_TXTX_TEXT", + TTL: digitalOceanRecordTTL, + }, }, } @@ -443,6 +512,8 @@ func TestDigitalOceanProcessUpdateActions(t *testing.T) { "example.com": { endpoint.NewEndpoint("foo.example.com", endpoint.RecordTypeA, "10.11.12.13"), endpoint.NewEndpoint("example.com", endpoint.RecordTypeCNAME, "bar.example.com"), + endpoint.NewEndpoint("example.com", endpoint.RecordTypeMX, "10 mx3.example.com"), + endpoint.NewEndpoint("example.com", endpoint.RecordTypeTXT, "ANOTHER-TXT"), }, } @@ -450,9 +521,9 @@ func TestDigitalOceanProcessUpdateActions(t *testing.T) { err := processUpdateActions(recordsByDomain, updatesByDomain, &changes) require.NoError(t, err) - assert.Equal(t, 2, len(changes.Creates)) + assert.Equal(t, 4, len(changes.Creates)) assert.Equal(t, 0, len(changes.Updates)) - assert.Equal(t, 3, len(changes.Deletes)) + assert.Equal(t, 6, len(changes.Deletes)) expectedCreates := []*digitalOceanChangeCreate{ { @@ -473,6 +544,25 @@ func TestDigitalOceanProcessUpdateActions(t *testing.T) { TTL: digitalOceanRecordTTL, }, }, + { + Domain: "example.com", + Options: &godo.DomainRecordEditRequest{ + Name: "@", + Type: endpoint.RecordTypeMX, + Data: "mx3.example.com.", + Priority: 10, + TTL: digitalOceanRecordTTL, + }, + }, + { + Domain: "example.com", + Options: &godo.DomainRecordEditRequest{ + Name: "@", + Type: endpoint.RecordTypeTXT, + Data: "ANOTHER-TXT", + TTL: digitalOceanRecordTTL, + }, + }, } if !elementsMatch(t, expectedCreates, changes.Creates) { @@ -492,6 +582,18 @@ func TestDigitalOceanProcessUpdateActions(t *testing.T) { Domain: "example.com", RecordID: 3, }, + { + Domain: "example.com", + RecordID: 4, + }, + { + Domain: "example.com", + RecordID: 5, + }, + { + Domain: "example.com", + RecordID: 6, + }, } if !elementsMatch(t, expectedDeletes, changes.Deletes) { @@ -597,6 +699,26 @@ func TestDigitalOceanGetMatchingDomainRecords(t *testing.T) { Type: endpoint.RecordTypeA, Data: "9.10.11.12", }, + { + ID: 5, + Name: "@", + Type: endpoint.RecordTypeMX, + Priority: 10, + Data: "mx1.foo.com.", + }, + { + ID: 6, + Name: "@", + Type: endpoint.RecordTypeMX, + Priority: 10, + Data: "mx2.foo.com.", + }, + { + ID: 7, + Name: "@", + Type: endpoint.RecordTypeTXT, + Data: "MYTXT", + }, } ep1 := endpoint.NewEndpoint("foo.com", endpoint.RecordTypeCNAME) @@ -627,6 +749,17 @@ func TestDigitalOceanGetMatchingDomainRecords(t *testing.T) { r2 := getMatchingDomainRecords(records, "example.com", ep4) assert.Equal(t, 1, len(r2)) assert.Equal(t, "9.10.11.12", r2[0].Data) + + ep5 := endpoint.NewEndpoint("example.com", endpoint.RecordTypeMX) + r3 := getMatchingDomainRecords(records, "example.com", ep5) + assert.Equal(t, 2, len(r3)) + assert.Equal(t, "mx1.foo.com.", r3[0].Data) + assert.Equal(t, "mx2.foo.com.", r3[1].Data) + + ep6 := endpoint.NewEndpoint("example.com", endpoint.RecordTypeTXT) + r4 := getMatchingDomainRecords(records, "example.com", ep6) + assert.Equal(t, 1, len(r4)) + assert.Equal(t, "MYTXT", r4[0].Data) } func validateDigitalOceanZones(t *testing.T, zones []godo.Domain, expected []godo.Domain) { @@ -663,7 +796,7 @@ func TestDigitalOceanAllRecords(t *testing.T) { if err != nil { t.Errorf("should not fail, %s", err) } - require.Equal(t, 5, len(records)) + require.Equal(t, 7, len(records)) provider.Client = &mockDigitalOceanRecordsFail{} _, err = provider.Records(ctx) @@ -678,11 +811,13 @@ func TestDigitalOceanMergeRecordsByNameType(t *testing.T) { endpoint.NewEndpoint("bar.example.com", "A", "1.2.3.4"), endpoint.NewEndpoint("foo.example.com", "A", "5.6.7.8"), endpoint.NewEndpoint("foo.example.com", "CNAME", "somewhere.out.there.com"), + endpoint.NewEndpoint("bar.example.com", "MX", "10 bar.mx1.com"), + endpoint.NewEndpoint("bar.example.com", "MX", "10 bar.mx2.com"), } merged := mergeEndpointsByNameType(xs) - assert.Equal(t, 3, len(merged)) + assert.Equal(t, 4, len(merged)) sort.SliceStable(merged, func(i, j int) bool { if merged[i].DNSName != merged[j].DNSName { return merged[i].DNSName < merged[j].DNSName @@ -693,14 +828,17 @@ func TestDigitalOceanMergeRecordsByNameType(t *testing.T) { assert.Equal(t, "A", merged[0].RecordType) assert.Equal(t, 1, len(merged[0].Targets)) assert.Equal(t, "1.2.3.4", merged[0].Targets[0]) - - assert.Equal(t, "foo.example.com", merged[1].DNSName) - assert.Equal(t, "A", merged[1].RecordType) + assert.Equal(t, "MX", merged[1].RecordType) assert.Equal(t, 2, len(merged[1].Targets)) - assert.ElementsMatch(t, []string{"1.2.3.4", "5.6.7.8"}, merged[1].Targets) + assert.ElementsMatch(t, []string{"10 bar.mx1.com", "10 bar.mx2.com"}, merged[1].Targets) assert.Equal(t, "foo.example.com", merged[2].DNSName) - assert.Equal(t, "CNAME", merged[2].RecordType) - assert.Equal(t, 1, len(merged[2].Targets)) - assert.Equal(t, "somewhere.out.there.com", merged[2].Targets[0]) + assert.Equal(t, "A", merged[2].RecordType) + assert.Equal(t, 2, len(merged[2].Targets)) + assert.ElementsMatch(t, []string{"1.2.3.4", "5.6.7.8"}, merged[2].Targets) + + assert.Equal(t, "foo.example.com", merged[3].DNSName) + assert.Equal(t, "CNAME", merged[3].RecordType) + assert.Equal(t, 1, len(merged[3].Targets)) + assert.Equal(t, "somewhere.out.there.com", merged[3].Targets[0]) } From 5d7f75bb72a253d3c72f75378c5d83fee5b96020 Mon Sep 17 00:00:00 2001 From: Oleksandr Simonov Date: Mon, 19 Aug 2024 20:38:15 +0300 Subject: [PATCH 29/82] documentation --- README.md | 1 + docs/sources/mx-record.md | 4 +-- docs/sources/txt-record.md | 30 +++++++++++++++++++++ provider/digitalocean/digital_ocean_test.go | 9 ++++++- 4 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 docs/sources/txt-record.md diff --git a/README.md b/README.md index 2aea7367a..d0ddbb553 100644 --- a/README.md +++ b/README.md @@ -181,6 +181,7 @@ The following tutorials are provided: * [NS1](docs/tutorials/ns1.md) * [NS Record Creation with CRD Source](docs/sources/ns-record.md) * [MX Record Creation with CRD Source](docs/sources/mx-record.md) +* [TXT Record Creation with CRD Source](docs/sources/txt-record.md) * [OpenStack Designate](docs/tutorials/designate.md) * [Oracle Cloud Infrastructure (OCI) DNS](docs/tutorials/oracle.md) * [PowerDNS](docs/tutorials/pdns.md) diff --git a/docs/sources/mx-record.md b/docs/sources/mx-record.md index 53c2b3065..9f318bf27 100644 --- a/docs/sources/mx-record.md +++ b/docs/sources/mx-record.md @@ -1,12 +1,12 @@ # MX record with CRD source You can create and manage MX records with the help of [CRD source](../contributing/crd-source.md) -and `DNSEndpoint` CRD. Currently, this feature is only supported by `aws`, `azure`, and `google` providers. +and `DNSEndpoint` CRD. Currently, this feature is only supported by `aws`, `azure`, `google` and `digital_ocean` providers. In order to start managing MX records you need to set the `--managed-record-types MX` flag. ```console -external-dns --source crd --provider {aws|azure|google} --managed-record-types A --managed-record-types CNAME --managed-record-types MX +external-dns --source crd --provider {aws|azure|google|digital_ocean} --managed-record-types A --managed-record-types CNAME --managed-record-types MX ``` Targets within the CRD need to be specified according to the RFC 1034 (section 3.6.1). Below is an example of diff --git a/docs/sources/txt-record.md b/docs/sources/txt-record.md new file mode 100644 index 000000000..c094d373c --- /dev/null +++ b/docs/sources/txt-record.md @@ -0,0 +1,30 @@ +# Creating TXT record with CRD source + +You can create and manage TXT records with the help of [CRD source](../contributing/crd-source.md) +and `DNSEndpoint` CRD. Currently, this feature is only supported by `digital_ocean` providers. + +In order to start managing MX records you need to set the `--managed-record-types TXT` flag. + +```console +external-dns --source crd --provider {digital_ocean} --managed-record-types A --managed-record-types CNAME --managed-record-types TXT +``` + +Targets within the CRD need to be specified according to the RFC 1035 (section 3.3.14). Below is an example of +`example.com` DNS TXT two records creation. + +**NOTE** Current implementation do not support RFC 6763 (section 6). + +```yaml +apiVersion: externaldns.k8s.io/v1alpha1 +kind: DNSEndpoint +metadata: + name: examplemxrecord +spec: + endpoints: + - dnsName: example.com + recordTTL: 180 + recordType: TXT + targets: + - SOMETXT + - ANOTHERTXT +``` diff --git a/provider/digitalocean/digital_ocean_test.go b/provider/digitalocean/digital_ocean_test.go index 567c56619..cd5555b32 100644 --- a/provider/digitalocean/digital_ocean_test.go +++ b/provider/digitalocean/digital_ocean_test.go @@ -813,11 +813,13 @@ func TestDigitalOceanMergeRecordsByNameType(t *testing.T) { endpoint.NewEndpoint("foo.example.com", "CNAME", "somewhere.out.there.com"), endpoint.NewEndpoint("bar.example.com", "MX", "10 bar.mx1.com"), endpoint.NewEndpoint("bar.example.com", "MX", "10 bar.mx2.com"), + endpoint.NewEndpoint("foo.example.com", "TXT", "txtone"), + endpoint.NewEndpoint("foo.example.com", "TXT", "txttwo"), } merged := mergeEndpointsByNameType(xs) - assert.Equal(t, 4, len(merged)) + assert.Equal(t, 5, len(merged)) sort.SliceStable(merged, func(i, j int) bool { if merged[i].DNSName != merged[j].DNSName { return merged[i].DNSName < merged[j].DNSName @@ -841,4 +843,9 @@ func TestDigitalOceanMergeRecordsByNameType(t *testing.T) { assert.Equal(t, "CNAME", merged[3].RecordType) assert.Equal(t, 1, len(merged[3].Targets)) assert.Equal(t, "somewhere.out.there.com", merged[3].Targets[0]) + + assert.Equal(t, "foo.example.com", merged[4].DNSName) + assert.Equal(t, "TXT", merged[4].RecordType) + assert.Equal(t, 2, len(merged[4].Targets)) + assert.ElementsMatch(t, []string{"txtone", "txttwo"}, merged[4].Targets) } From dd19bedc37e2ce51076445b91749010850d9f415 Mon Sep 17 00:00:00 2001 From: Oleksandr Simonov Date: Tue, 20 Aug 2024 09:21:53 +0300 Subject: [PATCH 30/82] fix typos --- docs/sources/mx-record.md | 4 ++-- docs/sources/txt-record.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/sources/mx-record.md b/docs/sources/mx-record.md index 9f318bf27..725491b23 100644 --- a/docs/sources/mx-record.md +++ b/docs/sources/mx-record.md @@ -1,12 +1,12 @@ # MX record with CRD source You can create and manage MX records with the help of [CRD source](../contributing/crd-source.md) -and `DNSEndpoint` CRD. Currently, this feature is only supported by `aws`, `azure`, `google` and `digital_ocean` providers. +and `DNSEndpoint` CRD. Currently, this feature is only supported by `aws`, `azure`, `google` and `digitalocean` providers. In order to start managing MX records you need to set the `--managed-record-types MX` flag. ```console -external-dns --source crd --provider {aws|azure|google|digital_ocean} --managed-record-types A --managed-record-types CNAME --managed-record-types MX +external-dns --source crd --provider {aws|azure|google|digitalocean} --managed-record-types A --managed-record-types CNAME --managed-record-types MX ``` Targets within the CRD need to be specified according to the RFC 1034 (section 3.6.1). Below is an example of diff --git a/docs/sources/txt-record.md b/docs/sources/txt-record.md index c094d373c..1786d2499 100644 --- a/docs/sources/txt-record.md +++ b/docs/sources/txt-record.md @@ -1,12 +1,12 @@ # Creating TXT record with CRD source You can create and manage TXT records with the help of [CRD source](../contributing/crd-source.md) -and `DNSEndpoint` CRD. Currently, this feature is only supported by `digital_ocean` providers. +and `DNSEndpoint` CRD. Currently, this feature is only supported by `digitalocean` providers. -In order to start managing MX records you need to set the `--managed-record-types TXT` flag. +In order to start managing TXT records you need to set the `--managed-record-types TXT` flag. ```console -external-dns --source crd --provider {digital_ocean} --managed-record-types A --managed-record-types CNAME --managed-record-types TXT +external-dns --source crd --provider {digitalocean} --managed-record-types A --managed-record-types CNAME --managed-record-types TXT ``` Targets within the CRD need to be specified according to the RFC 1035 (section 3.3.14). Below is an example of From ebc1052612f0ddbbfda93e8f7f25ede7b787d130 Mon Sep 17 00:00:00 2001 From: Oleksandr Simonov Date: Tue, 20 Aug 2024 10:31:32 +0300 Subject: [PATCH 31/82] improvements --- provider/digitalocean/digital_ocean.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/provider/digitalocean/digital_ocean.go b/provider/digitalocean/digital_ocean.go index 777d8c80d..29412e84d 100644 --- a/provider/digitalocean/digital_ocean.go +++ b/provider/digitalocean/digital_ocean.go @@ -306,6 +306,13 @@ func makeDomainEditRequest(domain, name, recordType, data string, ttl int) *godo if err == nil { request.Priority = int(priority) request.Data = provider.EnsureTrailingDot(domain) + } else { + log.WithFields(log.Fields{ + "domain": domain, + "dnsName": name, + "recordType": recordType, + "data": data, + }).Warn("Unable to parse MX target") } } @@ -329,7 +336,7 @@ func (p *DigitalOceanProvider) submitChanges(ctx context.Context, changes *digit } if c.Options.Type == endpoint.RecordTypeMX { - logFields["priotity"] = c.Options.Priority + logFields["priority"] = c.Options.Priority } log.WithFields(logFields).Debug("Creating domain record") @@ -353,7 +360,7 @@ func (p *DigitalOceanProvider) submitChanges(ctx context.Context, changes *digit "ttl": u.Options.TTL, } if u.Options.Type == endpoint.RecordTypeMX { - logFields["priotity"] = u.Options.Priority + logFields["priority"] = u.Options.Priority } log.WithFields(logFields).Debug("Updating domain record") @@ -619,7 +626,7 @@ func processDeleteActions( // SupportedRecordType returns true if the record type is supported by the provider func (p *DigitalOceanProvider) SupportedRecordType(recordType string) bool { switch recordType { - case "MX", "TXT": + case "MX": return true default: return provider.SupportedRecordType(recordType) From ce1ab808f29139b3dfb23b60f3127953df1ff847 Mon Sep 17 00:00:00 2001 From: Michael Shen Date: Mon, 29 Jul 2024 00:13:18 -0400 Subject: [PATCH 32/82] Refactor DynamoDB registry to aws-sdk-go-v2 Signed-off-by: Michael Shen --- go.mod | 17 ++++ go.sum | 34 +++++++ main.go | 13 +-- provider/aws/session.go | 60 +++++++++++++ provider/aws/session_test.go | 40 +++++++++ registry/dynamodb.go | 166 +++++++++++++++++++++-------------- registry/dynamodb_test.go | 150 +++++++++++++++++-------------- 7 files changed, 342 insertions(+), 138 deletions(-) diff --git a/go.mod b/go.mod index da536da00..543b2ebdf 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,12 @@ require ( github.com/alecthomas/kingpin/v2 v2.4.0 github.com/aliyun/alibaba-cloud-sdk-go v1.63.0 github.com/aws/aws-sdk-go v1.55.5 + github.com/aws/aws-sdk-go-v2 v1.30.3 + github.com/aws/aws-sdk-go-v2/config v1.27.27 + github.com/aws/aws-sdk-go-v2/credentials v1.17.27 + github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.14.10 + github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.4 + github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 github.com/bodgit/tsig v1.2.2 github.com/cenkalti/backoff/v4 v4.3.0 github.com/civo/civogo v0.3.73 @@ -85,6 +91,17 @@ require ( github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect + github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.16 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 // indirect + github.com/aws/smithy-go v1.20.3 // indirect github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect diff --git a/go.sum b/go.sum index 1e7d64fc8..1798b3272 100644 --- a/go.sum +++ b/go.sum @@ -119,6 +119,40 @@ github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP8dY= +github.com/aws/aws-sdk-go-v2 v1.30.3/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc= +github.com/aws/aws-sdk-go-v2/config v1.27.27 h1:HdqgGt1OAP0HkEDDShEl0oSYa9ZZBSOmKpdpsDMdO90= +github.com/aws/aws-sdk-go-v2/config v1.27.27/go.mod h1:MVYamCg76dFNINkZFu4n4RjDixhVr51HLj4ErWzrVwg= +github.com/aws/aws-sdk-go-v2/credentials v1.17.27 h1:2raNba6gr2IfA0eqqiP2XiQ0UVOpGPgDSi0I9iAP+UI= +github.com/aws/aws-sdk-go-v2/credentials v1.17.27/go.mod h1:gniiwbGahQByxan6YjQUMcW4Aov6bLC3m+evgcoN4r4= +github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.14.10 h1:orAIBscNu5aIjDOnKIrjO+IUFPMLKj3Lp0bPf4chiPc= +github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.14.10/go.mod h1:GNjJ8daGhv10hmQYCnmkV8HuY6xXOXV4vzBssSjEIlU= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 h1:KreluoV8FZDEtI6Co2xuNk/UqI9iwMrOx/87PBNIKqw= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11/go.mod h1:SeSUYBLsMYFoRvHE0Tjvn7kbxaUhl75CJi1sbfhMxkU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 h1:SoNJ4RlFEQEbtDcCEt+QG56MY4fm4W8rYirAmq+/DdU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15/go.mod h1:U9ke74k1n2bf+RIgoX1SXFed1HLs51OgUSs+Ph0KJP8= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 h1:C6WHdGnTDIYETAm5iErQUiVNsclNx9qbJVPIt03B6bI= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15/go.mod h1:ZQLZqhcu+JhSrA9/NXRm8SkDvsycE+JkV3WGY41e+IM= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.4 h1:utG3S4T+X7nONPIpRoi1tVcQdAdJxntiVS2yolPJyXc= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.4/go.mod h1:q9vzW3Xr1KEXa8n4waHiFt1PrppNDlMymlYP+xpsFbY= +github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.3 h1:r27/FnxLPixKBRIlslsvhqscBuMK8uysCYG9Kfgm098= +github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.3/go.mod h1:jqOFyN+QSWSoQC+ppyc4weiO8iNQXbzRbxDjQ1ayYd4= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 h1:dT3MqvGhSoaIhRseqw2I0yH81l7wiR2vjs57O51EAm8= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3/go.mod h1:GlAeCkHwugxdHaueRr4nhPuY+WW+gR8UjlcqzPr1SPI= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.16 h1:lhAX5f7KpgwyieXjbDnRTjPEUI0l3emSRyxXj1PXP8w= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.16/go.mod h1:AblAlCwvi7Q/SFowvckgN+8M3uFPlopSYeLlbNDArhA= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 h1:HGErhhrxZlQ044RiM+WdoZxp0p+EGM62y3L6pwA4olE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17/go.mod h1:RkZEx4l0EHYDJpWppMJ3nD9wZJAa8/0lq9aVC+r2UII= +github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 h1:BXx0ZIxvrJdSgSvKTZ+yRBeSqqgPM89VPlulEcl37tM= +github.com/aws/aws-sdk-go-v2/service/sso v1.22.4/go.mod h1:ooyCOXjvJEsUw7x+ZDHeISPMhtwI3ZCB7ggFMcFfWLU= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 h1:yiwVzJW2ZxZTurVbYWA7QOrAaCYQR72t0wrSBfoesUE= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4/go.mod h1:0oxfLkpz3rQ/CHlx5hB7H69YUpFiI1tql6Q6Ne+1bCw= +github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 h1:ZsDKRLXGWHk8WdtyYMoGNO7bTudrvuKpDKgMVRlepGE= +github.com/aws/aws-sdk-go-v2/service/sts v1.30.3/go.mod h1:zwySh8fpFyXp9yOr/KVzxOl8SRqgf/IDw5aUt9UKFcQ= +github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE= +github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= diff --git a/main.go b/main.go index dfdde6692..27f91877c 100644 --- a/main.go +++ b/main.go @@ -25,8 +25,7 @@ import ( "syscall" "time" - awsSDK "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/dynamodb" + "github.com/aws/aws-sdk-go-v2/service/dynamodb" "github.com/aws/aws-sdk-go/service/route53" sd "github.com/aws/aws-sdk-go/service/servicediscovery" "github.com/go-logr/logr" @@ -383,11 +382,15 @@ func main() { var r registry.Registry switch cfg.Registry { case "dynamodb": - config := awsSDK.NewConfig() + var dynamodbOpts []func(*dynamodb.Options) if cfg.AWSDynamoDBRegion != "" { - config = config.WithRegion(cfg.AWSDynamoDBRegion) + dynamodbOpts = []func(*dynamodb.Options){ + func(opts *dynamodb.Options) { + opts.Region = cfg.AWSDynamoDBRegion + }, + } } - r, err = registry.NewDynamoDBRegistry(p, cfg.TXTOwnerID, dynamodb.New(aws.CreateDefaultSession(cfg), config), cfg.AWSDynamoDBTable, cfg.TXTPrefix, cfg.TXTSuffix, cfg.TXTWildcardReplacement, cfg.ManagedDNSRecordTypes, cfg.ExcludeDNSRecordTypes, []byte(cfg.TXTEncryptAESKey), cfg.TXTCacheInterval) + r, err = registry.NewDynamoDBRegistry(p, cfg.TXTOwnerID, dynamodb.NewFromConfig(aws.CreateDefaultV2Config(cfg), dynamodbOpts...), cfg.AWSDynamoDBTable, cfg.TXTPrefix, cfg.TXTSuffix, cfg.TXTWildcardReplacement, cfg.ManagedDNSRecordTypes, cfg.ExcludeDNSRecordTypes, []byte(cfg.TXTEncryptAESKey), cfg.TXTCacheInterval) case "noop": r, err = registry.NewNoopRegistry(p) case "txt": diff --git a/provider/aws/session.go b/provider/aws/session.go index da578b292..8de5d0f40 100644 --- a/provider/aws/session.go +++ b/provider/aws/session.go @@ -17,9 +17,16 @@ limitations under the License. package aws import ( + "context" "fmt" + "net/http" "strings" + awsv2 "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/config" + stscredsv2 "github.com/aws/aws-sdk-go-v2/credentials/stscreds" + "github.com/aws/aws-sdk-go-v2/service/sts" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials/stscreds" "github.com/aws/aws-sdk-go/aws/request" @@ -38,6 +45,20 @@ type AWSSessionConfig struct { Profile string } +func CreateDefaultV2Config(cfg *externaldns.Config) awsv2.Config { + result, err := newV2Config( + AWSSessionConfig{ + AssumeRole: cfg.AWSAssumeRole, + AssumeRoleExternalID: cfg.AWSAssumeRoleExternalID, + APIRetries: cfg.AWSAPIRetries, + }, + ) + if err != nil { + logrus.Fatal(err) + } + return result +} + func CreateDefaultSession(cfg *externaldns.Config) *session.Session { result, err := newSession( AWSSessionConfig{ @@ -123,3 +144,42 @@ func newSession(awsConfig AWSSessionConfig) (*session.Session, error) { return session, nil } + +func newV2Config(awsConfig AWSSessionConfig) (awsv2.Config, error) { + defaultOpts := []func(*config.LoadOptions) error{ + config.WithRetryer(func() awsv2.Retryer { + return retry.AddWithMaxAttempts(retry.NewStandard(), awsConfig.APIRetries) + }), + config.WithHTTPClient(instrumented_http.NewClient(&http.Client{}, &instrumented_http.Callbacks{ + PathProcessor: func(path string) string { + parts := strings.Split(path, "/") + return parts[len(parts)-1] + }, + })), + config.WithSharedConfigProfile(awsConfig.Profile), + } + + cfg, err := config.LoadDefaultConfig(context.Background(), defaultOpts...) + if err != nil { + return awsv2.Config{}, fmt.Errorf("instantiating AWS config: %w", err) + } + + if awsConfig.AssumeRole != "" { + stsSvc := sts.NewFromConfig(cfg) + var assumeRoleOpts []func(*stscredsv2.AssumeRoleOptions) + if awsConfig.AssumeRoleExternalID != "" { + logrus.Infof("Assuming role: %s with external id %s", awsConfig.AssumeRole, awsConfig.AssumeRoleExternalID) + assumeRoleOpts = []func(*stscredsv2.AssumeRoleOptions){ + func(opts *stscredsv2.AssumeRoleOptions) { + opts.ExternalID = &awsConfig.AssumeRoleExternalID + }, + } + } else { + logrus.Infof("Assuming role: %s", awsConfig.AssumeRole) + } + creds := stscredsv2.NewAssumeRoleProvider(stsSvc, awsConfig.AssumeRole, assumeRoleOpts...) + cfg.Credentials = awsv2.NewCredentialsCache(creds) + } + + return cfg, nil +} diff --git a/provider/aws/session_test.go b/provider/aws/session_test.go index 206fcf940..b73485c03 100644 --- a/provider/aws/session_test.go +++ b/provider/aws/session_test.go @@ -17,6 +17,7 @@ limitations under the License. package aws import ( + "context" "os" "testing" @@ -63,6 +64,45 @@ func Test_newSession(t *testing.T) { }) } +func Test_newV2Config(t *testing.T) { + t.Run("should use profile from credentials file", func(t *testing.T) { + // setup + credsFile, err := prepareCredentialsFile(t) + defer os.Remove(credsFile.Name()) + require.NoError(t, err) + os.Setenv("AWS_SHARED_CREDENTIALS_FILE", credsFile.Name()) + defer os.Unsetenv("AWS_SHARED_CREDENTIALS_FILE") + + // when + cfg, err := newV2Config(AWSSessionConfig{Profile: "profile2"}) + require.NoError(t, err) + creds, err := cfg.Credentials.Retrieve(context.Background()) + + // then + assert.NoError(t, err) + assert.Equal(t, "AKID2345", creds.AccessKeyID) + assert.Equal(t, "SECRET2", creds.SecretAccessKey) + }) + + t.Run("should respect env variables without profile", func(t *testing.T) { + // setup + os.Setenv("AWS_ACCESS_KEY_ID", "AKIAIOSFODNN7EXAMPLE") + os.Setenv("AWS_SECRET_ACCESS_KEY", "topsecret") + defer os.Unsetenv("AWS_ACCESS_KEY_ID") + defer os.Unsetenv("AWS_SECRET_ACCESS_KEY") + + // when + cfg, err := newV2Config(AWSSessionConfig{}) + require.NoError(t, err) + creds, err := cfg.Credentials.Retrieve(context.Background()) + + // then + assert.NoError(t, err) + assert.Equal(t, "AKIAIOSFODNN7EXAMPLE", creds.AccessKeyID) + assert.Equal(t, "topsecret", creds.SecretAccessKey) + }) +} + func prepareCredentialsFile(t *testing.T) (*os.File, error) { credsFile, err := os.CreateTemp("", "aws-*.creds") require.NoError(t, err) diff --git a/registry/dynamodb.go b/registry/dynamodb.go index b13d55ce9..805985f34 100644 --- a/registry/dynamodb.go +++ b/registry/dynamodb.go @@ -23,9 +23,10 @@ import ( "strings" "time" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/dynamodb" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue" + "github.com/aws/aws-sdk-go-v2/service/dynamodb" + dynamodbtypes "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" log "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/util/sets" @@ -34,11 +35,11 @@ import ( "sigs.k8s.io/external-dns/provider" ) -// DynamoDBAPI is the subset of the AWS Route53 API that we actually use. Add methods as required. Signatures must match exactly. +// DynamoDBAPI is the subset of the AWS DynamoDB API that we actually use. Add methods as required. Signatures must match exactly. type DynamoDBAPI interface { - DescribeTableWithContext(ctx aws.Context, input *dynamodb.DescribeTableInput, opts ...request.Option) (*dynamodb.DescribeTableOutput, error) - ScanPagesWithContext(ctx aws.Context, input *dynamodb.ScanInput, fn func(*dynamodb.ScanOutput, bool) bool, opts ...request.Option) error - BatchExecuteStatementWithContext(aws.Context, *dynamodb.BatchExecuteStatementInput, ...request.Option) (*dynamodb.BatchExecuteStatementOutput, error) + DescribeTable(context.Context, *dynamodb.DescribeTableInput, ...func(*dynamodb.Options)) (*dynamodb.DescribeTableOutput, error) + Scan(context.Context, *dynamodb.ScanInput, ...func(*dynamodb.Options)) (*dynamodb.ScanOutput, error) + BatchExecuteStatement(context.Context, *dynamodb.BatchExecuteStatementInput, ...func(*dynamodb.Options)) (*dynamodb.BatchExecuteStatementOutput, error) } // DynamoDBRegistry implements registry interface with ownership implemented via an AWS DynamoDB table. @@ -225,7 +226,7 @@ func (im *DynamoDBRegistry) ApplyChanges(ctx context.Context, changes *plan.Chan Delete: endpoint.FilterEndpointsByOwnerID(im.ownerID, changes.Delete), } - statements := make([]*dynamodb.BatchStatementRequest, 0, len(filteredChanges.Create)+len(filteredChanges.UpdateNew)) + statements := make([]dynamodbtypes.BatchStatementRequest, 0, len(filteredChanges.Create)+len(filteredChanges.UpdateNew)) for _, r := range filteredChanges.Create { if r.Labels == nil { r.Labels = make(map[string]string) @@ -286,12 +287,15 @@ func (im *DynamoDBRegistry) ApplyChanges(ctx context.Context, changes *plan.Chan } } - err := im.executeStatements(ctx, statements, func(request *dynamodb.BatchStatementRequest, response *dynamodb.BatchStatementResponse) error { + err := im.executeStatements(ctx, statements, func(request dynamodbtypes.BatchStatementRequest, response dynamodbtypes.BatchStatementResponse) error { var context string if strings.HasPrefix(*request.Statement, "INSERT") { - if aws.StringValue(response.Error.Code) == "DuplicateItem" { + if response.Error.Code == dynamodbtypes.BatchStatementErrorCodeEnumDuplicateItem { // We lost a race with a different owner or another owner has an orphaned ownership record. - key := fromDynamoKey(request.Parameters[0]) + key, err := fromDynamoKey(request.Parameters[0]) + if err != nil { + return err + } for i, endpoint := range filteredChanges.Create { if endpoint.Key() == key { log.Infof("Skipping endpoint %v because owner does not match", endpoint) @@ -303,11 +307,19 @@ func (im *DynamoDBRegistry) ApplyChanges(ctx context.Context, changes *plan.Chan } } } - context = fmt.Sprintf("inserting dynamodb record %q", aws.StringValue(request.Parameters[0].S)) + var record string + if err := attributevalue.Unmarshal(request.Parameters[0], &record); err != nil { + return fmt.Errorf("inserting dynamodb record: %w", err) + } + context = fmt.Sprintf("inserting dynamodb record %q", record) } else { - context = fmt.Sprintf("updating dynamodb record %q", aws.StringValue(request.Parameters[1].S)) + var record string + if err := attributevalue.Unmarshal(request.Parameters[1], &record); err != nil { + return fmt.Errorf("inserting dynamodb record: %w", err) + } + context = fmt.Sprintf("updating dynamodb record %q", record) } - return fmt.Errorf("%s: %s: %s", context, aws.StringValue(response.Error.Code), aws.StringValue(response.Error.Message)) + return fmt.Errorf("%s: %s: %s", context, response.Error.Code, *response.Error.Message) }) if err != nil { im.recordsCache = nil @@ -326,7 +338,7 @@ func (im *DynamoDBRegistry) ApplyChanges(ctx context.Context, changes *plan.Chan return err } - statements = make([]*dynamodb.BatchStatementRequest, 0, len(filteredChanges.Delete)+len(im.orphanedLabels)) + statements = make([]dynamodbtypes.BatchStatementRequest, 0, len(filteredChanges.Delete)+len(im.orphanedLabels)) for _, r := range filteredChanges.Delete { statements = im.appendDelete(statements, r.Key()) } @@ -335,9 +347,13 @@ func (im *DynamoDBRegistry) ApplyChanges(ctx context.Context, changes *plan.Chan delete(im.labels, r) } im.orphanedLabels = nil - return im.executeStatements(ctx, statements, func(request *dynamodb.BatchStatementRequest, response *dynamodb.BatchStatementResponse) error { + return im.executeStatements(ctx, statements, func(request dynamodbtypes.BatchStatementRequest, response dynamodbtypes.BatchStatementResponse) error { im.labels = nil - return fmt.Errorf("deleting dynamodb record %q: %s: %s", aws.StringValue(request.Parameters[0].S), aws.StringValue(response.Error.Code), aws.StringValue(response.Error.Message)) + record, err := fromDynamoKey(request.Parameters[0]) + if err != nil { + return fmt.Errorf("deleting dynamodb record: %w", err) + } + return fmt.Errorf("deleting dynamodb record %q: %s: %s", record, response.Error.Code, *response.Error.Message) }) } @@ -347,7 +363,7 @@ func (im *DynamoDBRegistry) AdjustEndpoints(endpoints []*endpoint.Endpoint) ([]* } func (im *DynamoDBRegistry) readLabels(ctx context.Context) error { - table, err := im.dynamodbAPI.DescribeTableWithContext(ctx, &dynamodb.DescribeTableInput{ + table, err := im.dynamodbAPI.DescribeTable(ctx, &dynamodb.DescribeTableInput{ TableName: aws.String(im.table), }) if err != nil { @@ -356,8 +372,8 @@ func (im *DynamoDBRegistry) readLabels(ctx context.Context) error { foundKey := false for _, def := range table.Table.AttributeDefinitions { - if aws.StringValue(def.AttributeName) == "k" { - if aws.StringValue(def.AttributeType) != "S" { + if *def.AttributeName == "k" { + if def.AttributeType != dynamodbtypes.ScalarAttributeTypeS { return fmt.Errorf("table %q attribute \"k\" must have type \"S\"", im.table) } foundKey = true @@ -367,7 +383,7 @@ func (im *DynamoDBRegistry) readLabels(ctx context.Context) error { return fmt.Errorf("table %q must have attribute \"k\" of type \"S\"", im.table) } - if aws.StringValue(table.Table.KeySchema[0].AttributeName) != "k" { + if *table.Table.KeySchema[0].AttributeName != "k" { return fmt.Errorf("table %q must have hash key \"k\"", im.table) } if len(table.Table.KeySchema) > 1 { @@ -375,76 +391,92 @@ func (im *DynamoDBRegistry) readLabels(ctx context.Context) error { } labels := map[endpoint.EndpointKey]endpoint.Labels{} - err = im.dynamodbAPI.ScanPagesWithContext(ctx, &dynamodb.ScanInput{ + scanPaginator := dynamodb.NewScanPaginator(im.dynamodbAPI, &dynamodb.ScanInput{ TableName: aws.String(im.table), FilterExpression: aws.String("o = :ownerval"), - ExpressionAttributeValues: map[string]*dynamodb.AttributeValue{ - ":ownerval": {S: aws.String(im.ownerID)}, + ExpressionAttributeValues: map[string]dynamodbtypes.AttributeValue{ + ":ownerval": &dynamodbtypes.AttributeValueMemberS{Value: im.ownerID}, }, ProjectionExpression: aws.String("k,l"), ConsistentRead: aws.Bool(true), - }, func(output *dynamodb.ScanOutput, last bool) bool { - for _, item := range output.Items { - labels[fromDynamoKey(item["k"])] = fromDynamoLabels(item["l"], im.ownerID) - } - return true }) - if err != nil { - return fmt.Errorf("querying dynamodb: %w", err) + for scanPaginator.HasMorePages() { + output, err := scanPaginator.NextPage(ctx) + if err != nil { + return fmt.Errorf("scanning table %q: %w", im.table, err) + } + for _, item := range output.Items { + k, err := fromDynamoKey(item["k"]) + if err != nil { + return fmt.Errorf("querying dynamodb for key: %w", err) + } + l, err := fromDynamoLabels(item["l"], im.ownerID) + if err != nil { + return fmt.Errorf("querying dynamodb for labels: %w", err) + } + + labels[k] = l + } } im.labels = labels return nil } -func fromDynamoKey(key *dynamodb.AttributeValue) endpoint.EndpointKey { - split := strings.SplitN(aws.StringValue(key.S), "#", 3) +func fromDynamoKey(key dynamodbtypes.AttributeValue) (endpoint.EndpointKey, error) { + var ep string + if err := attributevalue.Unmarshal(key, &ep); err != nil { + return endpoint.EndpointKey{}, fmt.Errorf("unmarshalling endpoint key: %w", err) + } + split := strings.SplitN(ep, "#", 3) return endpoint.EndpointKey{ DNSName: split[0], RecordType: split[1], SetIdentifier: split[2], + }, nil +} + +func toDynamoKey(key endpoint.EndpointKey) dynamodbtypes.AttributeValue { + return &dynamodbtypes.AttributeValueMemberS{ + Value: fmt.Sprintf("%s#%s#%s", key.DNSName, key.RecordType, key.SetIdentifier), } } -func toDynamoKey(key endpoint.EndpointKey) *dynamodb.AttributeValue { - return &dynamodb.AttributeValue{ - S: aws.String(fmt.Sprintf("%s#%s#%s", key.DNSName, key.RecordType, key.SetIdentifier)), - } -} - -func fromDynamoLabels(label *dynamodb.AttributeValue, owner string) endpoint.Labels { +func fromDynamoLabels(label dynamodbtypes.AttributeValue, owner string) (endpoint.Labels, error) { labels := endpoint.NewLabels() - for k, v := range label.M { - labels[k] = aws.StringValue(v.S) + if err := attributevalue.Unmarshal(label, &labels); err != nil { + return endpoint.Labels{}, fmt.Errorf("unmarshalling labels: %w", err) } labels[endpoint.OwnerLabelKey] = owner - return labels + return labels, nil } -func toDynamoLabels(labels endpoint.Labels) *dynamodb.AttributeValue { - labelMap := make(map[string]*dynamodb.AttributeValue, len(labels)) +func toDynamoLabels(labels endpoint.Labels) dynamodbtypes.AttributeValue { + labelMap := make(map[string]dynamodbtypes.AttributeValue, len(labels)) for k, v := range labels { if k == endpoint.OwnerLabelKey { continue } - labelMap[k] = &dynamodb.AttributeValue{S: aws.String(v)} + labelMap[k] = &dynamodbtypes.AttributeValueMemberS{Value: v} } - return &dynamodb.AttributeValue{M: labelMap} + return &dynamodbtypes.AttributeValueMemberM{Value: labelMap} } -func (im *DynamoDBRegistry) appendInsert(statements []*dynamodb.BatchStatementRequest, key endpoint.EndpointKey, new endpoint.Labels) []*dynamodb.BatchStatementRequest { - return append(statements, &dynamodb.BatchStatementRequest{ - Statement: aws.String(fmt.Sprintf("INSERT INTO %q VALUE {'k':?, 'o':?, 'l':?}", im.table)), - Parameters: []*dynamodb.AttributeValue{ +func (im *DynamoDBRegistry) appendInsert(statements []dynamodbtypes.BatchStatementRequest, key endpoint.EndpointKey, new endpoint.Labels) []dynamodbtypes.BatchStatementRequest { + return append(statements, dynamodbtypes.BatchStatementRequest{ + Statement: aws.String(fmt.Sprintf("INSERT INTO %q VALUE {'k':?, 'o':?, 'l':?}", im.table)), + ConsistentRead: aws.Bool(true), + Parameters: []dynamodbtypes.AttributeValue{ toDynamoKey(key), - {S: aws.String(im.ownerID)}, + &dynamodbtypes.AttributeValueMemberS{ + Value: im.ownerID, + }, toDynamoLabels(new), }, - ConsistentRead: aws.Bool(true), }) } -func (im *DynamoDBRegistry) appendUpdate(statements []*dynamodb.BatchStatementRequest, key endpoint.EndpointKey, old endpoint.Labels, new endpoint.Labels) []*dynamodb.BatchStatementRequest { +func (im *DynamoDBRegistry) appendUpdate(statements []dynamodbtypes.BatchStatementRequest, key endpoint.EndpointKey, old endpoint.Labels, new endpoint.Labels) []dynamodbtypes.BatchStatementRequest { if len(old) == len(new) { equal := true for k, v := range old { @@ -458,28 +490,28 @@ func (im *DynamoDBRegistry) appendUpdate(statements []*dynamodb.BatchStatementRe } } - return append(statements, &dynamodb.BatchStatementRequest{ + return append(statements, dynamodbtypes.BatchStatementRequest{ Statement: aws.String(fmt.Sprintf("UPDATE %q SET \"l\"=? WHERE \"k\"=?", im.table)), - Parameters: []*dynamodb.AttributeValue{ + Parameters: []dynamodbtypes.AttributeValue{ toDynamoLabels(new), toDynamoKey(key), }, }) } -func (im *DynamoDBRegistry) appendDelete(statements []*dynamodb.BatchStatementRequest, key endpoint.EndpointKey) []*dynamodb.BatchStatementRequest { - return append(statements, &dynamodb.BatchStatementRequest{ +func (im *DynamoDBRegistry) appendDelete(statements []dynamodbtypes.BatchStatementRequest, key endpoint.EndpointKey) []dynamodbtypes.BatchStatementRequest { + return append(statements, dynamodbtypes.BatchStatementRequest{ Statement: aws.String(fmt.Sprintf("DELETE FROM %q WHERE \"k\"=? AND \"o\"=?", im.table)), - Parameters: []*dynamodb.AttributeValue{ + Parameters: []dynamodbtypes.AttributeValue{ toDynamoKey(key), - {S: aws.String(im.ownerID)}, + &dynamodbtypes.AttributeValueMemberS{Value: im.ownerID}, }, }) } -func (im *DynamoDBRegistry) executeStatements(ctx context.Context, statements []*dynamodb.BatchStatementRequest, handleErr func(request *dynamodb.BatchStatementRequest, response *dynamodb.BatchStatementResponse) error) error { +func (im *DynamoDBRegistry) executeStatements(ctx context.Context, statements []dynamodbtypes.BatchStatementRequest, handleErr func(request dynamodbtypes.BatchStatementRequest, response dynamodbtypes.BatchStatementResponse) error) error { for len(statements) > 0 { - var chunk []*dynamodb.BatchStatementRequest + var chunk []dynamodbtypes.BatchStatementRequest if len(statements) > int(dynamodbMaxBatchSize) { chunk = statements[:dynamodbMaxBatchSize] statements = statements[dynamodbMaxBatchSize:] @@ -488,7 +520,7 @@ func (im *DynamoDBRegistry) executeStatements(ctx context.Context, statements [] statements = nil } - output, err := im.dynamodbAPI.BatchExecuteStatementWithContext(ctx, &dynamodb.BatchExecuteStatementInput{ + output, err := im.dynamodbAPI.BatchExecuteStatement(ctx, &dynamodb.BatchExecuteStatementInput{ Statements: chunk, }) if err != nil { @@ -501,9 +533,13 @@ func (im *DynamoDBRegistry) executeStatements(ctx context.Context, statements [] op, _, _ := strings.Cut(*request.Statement, " ") var key string if op == "UPDATE" { - key = *request.Parameters[1].S + if err := attributevalue.Unmarshal(request.Parameters[1], &key); err != nil { + return err + } } else { - key = *request.Parameters[0].S + if err := attributevalue.Unmarshal(request.Parameters[0], &key); err != nil { + return err + } } log.Infof("%s dynamodb record %q", op, key) } else { diff --git a/registry/dynamodb_test.go b/registry/dynamodb_test.go index 1cadd7dcd..c280554fe 100644 --- a/registry/dynamodb_test.go +++ b/registry/dynamodb_test.go @@ -22,9 +22,10 @@ import ( "testing" "time" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/dynamodb" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue" + "github.com/aws/aws-sdk-go-v2/service/dynamodb" + dynamodbtypes "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/util/sets" @@ -69,40 +70,40 @@ func TestDynamoDBRegistryNew(t *testing.T) { func TestDynamoDBRegistryRecordsBadTable(t *testing.T) { for _, tc := range []struct { name string - setup func(desc *dynamodb.TableDescription) + setup func(desc *dynamodbtypes.TableDescription) expected string }{ { name: "missing attribute k", - setup: func(desc *dynamodb.TableDescription) { + setup: func(desc *dynamodbtypes.TableDescription) { desc.AttributeDefinitions[0].AttributeName = aws.String("wrong") }, expected: "table \"test-table\" must have attribute \"k\" of type \"S\"", }, { name: "wrong attribute type", - setup: func(desc *dynamodb.TableDescription) { - desc.AttributeDefinitions[0].AttributeType = aws.String("SS") + setup: func(desc *dynamodbtypes.TableDescription) { + desc.AttributeDefinitions[0].AttributeType = "SS" }, expected: "table \"test-table\" attribute \"k\" must have type \"S\"", }, { name: "wrong key", - setup: func(desc *dynamodb.TableDescription) { + setup: func(desc *dynamodbtypes.TableDescription) { desc.KeySchema[0].AttributeName = aws.String("wrong") }, expected: "table \"test-table\" must have hash key \"k\"", }, { name: "has range key", - setup: func(desc *dynamodb.TableDescription) { - desc.AttributeDefinitions = append(desc.AttributeDefinitions, &dynamodb.AttributeDefinition{ + setup: func(desc *dynamodbtypes.TableDescription) { + desc.AttributeDefinitions = append(desc.AttributeDefinitions, dynamodbtypes.AttributeDefinition{ AttributeName: aws.String("o"), - AttributeType: aws.String("S"), + AttributeType: dynamodbtypes.ScalarAttributeTypeS, }) - desc.KeySchema = append(desc.KeySchema, &dynamodb.KeySchemaElement{ + desc.KeySchema = append(desc.KeySchema, dynamodbtypes.KeySchemaElement{ AttributeName: aws.String("o"), - KeyType: aws.String("RANGE"), + KeyType: dynamodbtypes.KeyTypeRange, }) }, expected: "table \"test-table\" must not have a range key", @@ -559,8 +560,8 @@ func TestDynamoDBRegistryApplyChanges(t *testing.T) { }, }, stubConfig: DynamoDBStubConfig{ - ExpectInsertError: map[string]string{ - "new.test-zone.example.org#CNAME#set-new": "DuplicateItem", + ExpectInsertError: map[string]dynamodbtypes.BatchStatementErrorCodeEnum{ + "new.test-zone.example.org#CNAME#set-new": dynamodbtypes.BatchStatementErrorCodeEnumDuplicateItem, }, ExpectDelete: sets.New("quux.test-zone.example.org#A#set-2"), }, @@ -620,7 +621,7 @@ func TestDynamoDBRegistryApplyChanges(t *testing.T) { }, }, stubConfig: DynamoDBStubConfig{ - ExpectInsertError: map[string]string{ + ExpectInsertError: map[string]dynamodbtypes.BatchStatementErrorCodeEnum{ "new.test-zone.example.org#CNAME#set-new": "TestingError", }, }, @@ -928,7 +929,7 @@ func TestDynamoDBRegistryApplyChanges(t *testing.T) { }, }, stubConfig: DynamoDBStubConfig{ - ExpectUpdateError: map[string]string{ + ExpectUpdateError: map[string]dynamodbtypes.BatchStatementErrorCodeEnum{ "bar.test-zone.example.org#CNAME#": "TestingError", }, }, @@ -1073,15 +1074,15 @@ func TestDynamoDBRegistryApplyChanges(t *testing.T) { type DynamoDBStub struct { t *testing.T stubConfig *DynamoDBStubConfig - tableDescription dynamodb.TableDescription + tableDescription dynamodbtypes.TableDescription changesApplied bool } type DynamoDBStubConfig struct { ExpectInsert map[string]map[string]string - ExpectInsertError map[string]string + ExpectInsertError map[string]dynamodbtypes.BatchStatementErrorCodeEnum ExpectUpdate map[string]map[string]string - ExpectUpdateError map[string]string + ExpectUpdateError map[string]dynamodbtypes.BatchStatementErrorCodeEnum ExpectDelete sets.Set[string] } @@ -1100,17 +1101,17 @@ func newDynamoDBAPIStub(t *testing.T, stubConfig *DynamoDBStubConfig) (*DynamoDB stub := &DynamoDBStub{ t: t, stubConfig: stubConfig, - tableDescription: dynamodb.TableDescription{ - AttributeDefinitions: []*dynamodb.AttributeDefinition{ + tableDescription: dynamodbtypes.TableDescription{ + AttributeDefinitions: []dynamodbtypes.AttributeDefinition{ { AttributeName: aws.String("k"), - AttributeType: aws.String("S"), + AttributeType: dynamodbtypes.ScalarAttributeTypeS, }, }, - KeySchema: []*dynamodb.KeySchemaElement{ + KeySchema: []dynamodbtypes.KeySchemaElement{ { AttributeName: aws.String("k"), - KeyType: aws.String("HASH"), + KeyType: dynamodbtypes.KeyTypeHash, }, }, }, @@ -1131,7 +1132,7 @@ func newDynamoDBAPIStub(t *testing.T, stubConfig *DynamoDBStubConfig) (*DynamoDB } } -func (r *DynamoDBStub) DescribeTableWithContext(ctx aws.Context, input *dynamodb.DescribeTableInput, opts ...request.Option) (*dynamodb.DescribeTableOutput, error) { +func (r *DynamoDBStub) DescribeTable(ctx context.Context, input *dynamodb.DescribeTableInput, opts ...func(*dynamodb.Options)) (*dynamodb.DescribeTableOutput, error) { assert.NotNil(r.t, ctx) assert.Equal(r.t, "test-table", *input.TableName, "table name") return &dynamodb.DescribeTableOutput{ @@ -1139,75 +1140,80 @@ func (r *DynamoDBStub) DescribeTableWithContext(ctx aws.Context, input *dynamodb }, nil } -func (r *DynamoDBStub) ScanPagesWithContext(ctx aws.Context, input *dynamodb.ScanInput, fn func(*dynamodb.ScanOutput, bool) bool, opts ...request.Option) error { +func (r *DynamoDBStub) Scan(ctx context.Context, input *dynamodb.ScanInput, opts ...func(*dynamodb.Options)) (*dynamodb.ScanOutput, error) { assert.NotNil(r.t, ctx) assert.Equal(r.t, "test-table", *input.TableName, "table name") assert.Equal(r.t, "o = :ownerval", *input.FilterExpression) assert.Len(r.t, input.ExpressionAttributeValues, 1) - assert.Equal(r.t, "test-owner", *input.ExpressionAttributeValues[":ownerval"].S) + var owner string + assert.Nil(r.t, attributevalue.Unmarshal(input.ExpressionAttributeValues[":ownerval"], &owner)) + assert.Equal(r.t, "test-owner", owner) assert.Equal(r.t, "k,l", *input.ProjectionExpression) assert.True(r.t, *input.ConsistentRead) - fn(&dynamodb.ScanOutput{ - Items: []map[string]*dynamodb.AttributeValue{ + return &dynamodb.ScanOutput{ + Items: []map[string]dynamodbtypes.AttributeValue{ { - "k": &dynamodb.AttributeValue{S: aws.String("bar.test-zone.example.org#CNAME#")}, - "l": &dynamodb.AttributeValue{M: map[string]*dynamodb.AttributeValue{ - endpoint.ResourceLabelKey: {S: aws.String("ingress/default/my-ingress")}, + "k": &dynamodbtypes.AttributeValueMemberS{Value: "bar.test-zone.example.org#CNAME#"}, + "l": &dynamodbtypes.AttributeValueMemberM{Value: map[string]dynamodbtypes.AttributeValue{ + endpoint.ResourceLabelKey: &dynamodbtypes.AttributeValueMemberS{Value: "ingress/default/my-ingress"}, }}, }, { - "k": &dynamodb.AttributeValue{S: aws.String("baz.test-zone.example.org#A#set-1")}, - "l": &dynamodb.AttributeValue{M: map[string]*dynamodb.AttributeValue{ - endpoint.ResourceLabelKey: {S: aws.String("ingress/default/my-ingress")}, + "k": &dynamodbtypes.AttributeValueMemberS{Value: "baz.test-zone.example.org#A#set-1"}, + "l": &dynamodbtypes.AttributeValueMemberM{Value: map[string]dynamodbtypes.AttributeValue{ + endpoint.ResourceLabelKey: &dynamodbtypes.AttributeValueMemberS{Value: "ingress/default/my-ingress"}, }}, }, { - "k": &dynamodb.AttributeValue{S: aws.String("baz.test-zone.example.org#A#set-2")}, - "l": &dynamodb.AttributeValue{M: map[string]*dynamodb.AttributeValue{ - endpoint.ResourceLabelKey: {S: aws.String("ingress/default/other-ingress")}, + "k": &dynamodbtypes.AttributeValueMemberS{Value: "baz.test-zone.example.org#A#set-2"}, + "l": &dynamodbtypes.AttributeValueMemberM{Value: map[string]dynamodbtypes.AttributeValue{ + endpoint.ResourceLabelKey: &dynamodbtypes.AttributeValueMemberS{Value: "ingress/default/other-ingress"}, }}, }, { - "k": &dynamodb.AttributeValue{S: aws.String("quux.test-zone.example.org#A#set-2")}, - "l": &dynamodb.AttributeValue{M: map[string]*dynamodb.AttributeValue{ - endpoint.ResourceLabelKey: {S: aws.String("ingress/default/quux-ingress")}, + "k": &dynamodbtypes.AttributeValueMemberS{Value: "quux.test-zone.example.org#A#set-2"}, + "l": &dynamodbtypes.AttributeValueMemberM{Value: map[string]dynamodbtypes.AttributeValue{ + endpoint.ResourceLabelKey: &dynamodbtypes.AttributeValueMemberS{Value: "ingress/default/quux-ingress"}, }}, }, }, - }, true) - return nil + }, nil } -func (r *DynamoDBStub) BatchExecuteStatementWithContext(context aws.Context, input *dynamodb.BatchExecuteStatementInput, option ...request.Option) (*dynamodb.BatchExecuteStatementOutput, error) { +func (r *DynamoDBStub) BatchExecuteStatement(context context.Context, input *dynamodb.BatchExecuteStatementInput, option ...func(*dynamodb.Options)) (*dynamodb.BatchExecuteStatementOutput, error) { assert.NotNil(r.t, context) - hasDelete := strings.HasPrefix(strings.ToLower(aws.StringValue(input.Statements[0].Statement)), "delete") + hasDelete := strings.HasPrefix(strings.ToLower(*input.Statements[0].Statement), "delete") assert.Equal(r.t, hasDelete, r.changesApplied, "delete after provider changes, everything else before") assert.LessOrEqual(r.t, len(input.Statements), 25) - responses := make([]*dynamodb.BatchStatementResponse, 0, len(input.Statements)) + responses := make([]dynamodbtypes.BatchStatementResponse, 0, len(input.Statements)) for _, statement := range input.Statements { - assert.Equal(r.t, hasDelete, strings.HasPrefix(strings.ToLower(aws.StringValue(statement.Statement)), "delete")) - switch aws.StringValue(statement.Statement) { + assert.Equal(r.t, hasDelete, strings.HasPrefix(strings.ToLower(*statement.Statement), "delete")) + switch *statement.Statement { case "DELETE FROM \"test-table\" WHERE \"k\"=? AND \"o\"=?": assert.True(r.t, r.changesApplied, "unexpected delete before provider changes") - key := aws.StringValue(statement.Parameters[0].S) + var key string + assert.Nil(r.t, attributevalue.Unmarshal(statement.Parameters[0], &key)) assert.True(r.t, r.stubConfig.ExpectDelete.Has(key), "unexpected delete for key %q", key) r.stubConfig.ExpectDelete.Delete(key) - assert.Equal(r.t, "test-owner", aws.StringValue(statement.Parameters[1].S)) + var testOwner string + assert.Nil(r.t, attributevalue.Unmarshal(statement.Parameters[1], &testOwner)) + assert.Equal(r.t, "test-owner", testOwner) - responses = append(responses, &dynamodb.BatchStatementResponse{}) + responses = append(responses, dynamodbtypes.BatchStatementResponse{}) case "INSERT INTO \"test-table\" VALUE {'k':?, 'o':?, 'l':?}": assert.False(r.t, r.changesApplied, "unexpected insert after provider changes") - key := aws.StringValue(statement.Parameters[0].S) + var key string + assert.Nil(r.t, attributevalue.Unmarshal(statement.Parameters[0], &key)) if code, exists := r.stubConfig.ExpectInsertError[key]; exists { delete(r.stubConfig.ExpectInsertError, key) - responses = append(responses, &dynamodb.BatchStatementResponse{ - Error: &dynamodb.BatchStatementError{ - Code: aws.String(code), + responses = append(responses, dynamodbtypes.BatchStatementResponse{ + Error: &dynamodbtypes.BatchStatementError{ + Code: code, Message: aws.String("testing error"), }, }) @@ -1218,10 +1224,15 @@ func (r *DynamoDBStub) BatchExecuteStatementWithContext(context aws.Context, inp assert.True(r.t, found, "unexpected insert for key %q", key) delete(r.stubConfig.ExpectInsert, key) - assert.Equal(r.t, "test-owner", aws.StringValue(statement.Parameters[1].S)) + var testOwner string + assert.Nil(r.t, attributevalue.Unmarshal(statement.Parameters[1], &testOwner)) + assert.Equal(r.t, "test-owner", testOwner) - for label, attribute := range statement.Parameters[2].M { - value := aws.StringValue(attribute.S) + var labels map[string]string + err := attributevalue.Unmarshal(statement.Parameters[2], &labels) + assert.Nil(r.t, err) + + for label, value := range labels { expectedValue, found := expectedLabels[label] assert.True(r.t, found, "insert for key %q has unexpected label %q", key, label) delete(expectedLabels, label) @@ -1232,17 +1243,18 @@ func (r *DynamoDBStub) BatchExecuteStatementWithContext(context aws.Context, inp r.t.Errorf("insert for key %q did not get expected label %q", key, label) } - responses = append(responses, &dynamodb.BatchStatementResponse{}) + responses = append(responses, dynamodbtypes.BatchStatementResponse{}) case "UPDATE \"test-table\" SET \"l\"=? WHERE \"k\"=?": assert.False(r.t, r.changesApplied, "unexpected update after provider changes") - key := aws.StringValue(statement.Parameters[1].S) + var key string + assert.Nil(r.t, attributevalue.Unmarshal(statement.Parameters[1], &key)) if code, exists := r.stubConfig.ExpectUpdateError[key]; exists { delete(r.stubConfig.ExpectInsertError, key) - responses = append(responses, &dynamodb.BatchStatementResponse{ - Error: &dynamodb.BatchStatementError{ - Code: aws.String(code), + responses = append(responses, dynamodbtypes.BatchStatementResponse{ + Error: &dynamodbtypes.BatchStatementError{ + Code: code, Message: aws.String("testing error"), }, }) @@ -1253,8 +1265,10 @@ func (r *DynamoDBStub) BatchExecuteStatementWithContext(context aws.Context, inp assert.True(r.t, found, "unexpected update for key %q", key) delete(r.stubConfig.ExpectUpdate, key) - for label, attribute := range statement.Parameters[0].M { - value := aws.StringValue(attribute.S) + var labels map[string]string + assert.Nil(r.t, attributevalue.Unmarshal(statement.Parameters[0], &labels)) + + for label, value := range labels { expectedValue, found := expectedLabels[label] assert.True(r.t, found, "update for key %q has unexpected label %q", key, label) delete(expectedLabels, label) @@ -1265,10 +1279,10 @@ func (r *DynamoDBStub) BatchExecuteStatementWithContext(context aws.Context, inp r.t.Errorf("update for key %q did not get expected label %q", key, label) } - responses = append(responses, &dynamodb.BatchStatementResponse{}) + responses = append(responses, dynamodbtypes.BatchStatementResponse{}) default: - r.t.Errorf("unexpected statement: %s", aws.StringValue(statement.Statement)) + r.t.Errorf("unexpected statement: %s", *statement.Statement) } } From c4a18a9cb642a09e0501fa4fe86fd71f7c4370fb Mon Sep 17 00:00:00 2001 From: Michael Shen Date: Mon, 29 Jul 2024 22:19:02 -0400 Subject: [PATCH 33/82] Refactor AWS Cloud Map provider to aws-sdk-go-v2 Signed-off-by: Michael Shen --- go.mod | 1 + go.sum | 2 + main.go | 4 +- provider/awssd/aws_sd.go | 272 +++++++++------------ provider/awssd/aws_sd_test.go | 437 ++++++++++++++++++---------------- 5 files changed, 358 insertions(+), 358 deletions(-) diff --git a/go.mod b/go.mod index 543b2ebdf..57e6856cb 100644 --- a/go.mod +++ b/go.mod @@ -22,6 +22,7 @@ require ( github.com/aws/aws-sdk-go-v2/credentials v1.17.27 github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.14.10 github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.4 + github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.3 github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 github.com/bodgit/tsig v1.2.2 github.com/cenkalti/backoff/v4 v4.3.0 diff --git a/go.sum b/go.sum index 1798b3272..c500ada73 100644 --- a/go.sum +++ b/go.sum @@ -145,6 +145,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.16 h1:lhAX github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.16/go.mod h1:AblAlCwvi7Q/SFowvckgN+8M3uFPlopSYeLlbNDArhA= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 h1:HGErhhrxZlQ044RiM+WdoZxp0p+EGM62y3L6pwA4olE= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17/go.mod h1:RkZEx4l0EHYDJpWppMJ3nD9wZJAa8/0lq9aVC+r2UII= +github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.3 h1:EthA93BNgTnk36FoI9DCKtv4S0m63WzdGDYlBp/CvHQ= +github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.3/go.mod h1:4xh/h0pevPhBkA4b2iYosZaqrThccxFREQxiGuZpJlc= github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 h1:BXx0ZIxvrJdSgSvKTZ+yRBeSqqgPM89VPlulEcl37tM= github.com/aws/aws-sdk-go-v2/service/sso v1.22.4/go.mod h1:ooyCOXjvJEsUw7x+ZDHeISPMhtwI3ZCB7ggFMcFfWLU= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 h1:yiwVzJW2ZxZTurVbYWA7QOrAaCYQR72t0wrSBfoesUE= diff --git a/main.go b/main.go index 27f91877c..e75b6795a 100644 --- a/main.go +++ b/main.go @@ -26,8 +26,8 @@ import ( "time" "github.com/aws/aws-sdk-go-v2/service/dynamodb" + sd "github.com/aws/aws-sdk-go-v2/service/servicediscovery" "github.com/aws/aws-sdk-go/service/route53" - sd "github.com/aws/aws-sdk-go/service/servicediscovery" "github.com/go-logr/logr" "github.com/prometheus/client_golang/prometheus/promhttp" log "github.com/sirupsen/logrus" @@ -235,7 +235,7 @@ func main() { log.Infof("Registry \"%s\" cannot be used with AWS Cloud Map. Switching to \"aws-sd\".", cfg.Registry) cfg.Registry = "aws-sd" } - p, err = awssd.NewAWSSDProvider(domainFilter, cfg.AWSZoneType, cfg.DryRun, cfg.AWSSDServiceCleanup, cfg.TXTOwnerID, sd.New(aws.CreateDefaultSession(cfg))) + p, err = awssd.NewAWSSDProvider(domainFilter, cfg.AWSZoneType, cfg.DryRun, cfg.AWSSDServiceCleanup, cfg.TXTOwnerID, sd.NewFromConfig(aws.CreateDefaultV2Config(cfg))) case "azure-dns", "azure": p, err = azure.NewAzureProvider(cfg.AzureConfigFile, domainFilter, zoneNameFilter, zoneIDFilter, cfg.AzureSubscriptionID, cfg.AzureResourceGroup, cfg.AzureUserAssignedIdentityClientID, cfg.AzureActiveDirectoryAuthorityHost, cfg.DryRun) case "azure-private-dns": diff --git a/provider/awssd/aws_sd.go b/provider/awssd/aws_sd.go index 8c41e5f86..14a977873 100644 --- a/provider/awssd/aws_sd.go +++ b/provider/awssd/aws_sd.go @@ -24,9 +24,9 @@ import ( "regexp" "strings" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - sd "github.com/aws/aws-sdk-go/service/servicediscovery" + "github.com/aws/aws-sdk-go-v2/aws" + sd "github.com/aws/aws-sdk-go-v2/service/servicediscovery" + sdtypes "github.com/aws/aws-sdk-go-v2/service/servicediscovery/types" log "github.com/sirupsen/logrus" "sigs.k8s.io/external-dns/endpoint" @@ -54,16 +54,16 @@ var ( ) // AWSSDClient is the subset of the AWS Cloud Map API that we actually use. Add methods as required. -// Signatures must match exactly. Taken from https://github.com/aws/aws-sdk-go/blob/HEAD/service/servicediscovery/api.go +// Signatures must match exactly. Taken from https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/servicediscovery type AWSSDClient interface { - CreateService(input *sd.CreateServiceInput) (*sd.CreateServiceOutput, error) - DeregisterInstance(input *sd.DeregisterInstanceInput) (*sd.DeregisterInstanceOutput, error) - DiscoverInstancesWithContext(ctx aws.Context, input *sd.DiscoverInstancesInput, opts ...request.Option) (*sd.DiscoverInstancesOutput, error) - ListNamespacesPages(input *sd.ListNamespacesInput, fn func(*sd.ListNamespacesOutput, bool) bool) error - ListServicesPages(input *sd.ListServicesInput, fn func(*sd.ListServicesOutput, bool) bool) error - RegisterInstance(input *sd.RegisterInstanceInput) (*sd.RegisterInstanceOutput, error) - UpdateService(input *sd.UpdateServiceInput) (*sd.UpdateServiceOutput, error) - DeleteService(input *sd.DeleteServiceInput) (*sd.DeleteServiceOutput, error) + CreateService(ctx context.Context, params *sd.CreateServiceInput, optFns ...func(*sd.Options)) (*sd.CreateServiceOutput, error) + DeregisterInstance(ctx context.Context, params *sd.DeregisterInstanceInput, optFns ...func(*sd.Options)) (*sd.DeregisterInstanceOutput, error) + DiscoverInstances(ctx context.Context, params *sd.DiscoverInstancesInput, optFns ...func(*sd.Options)) (*sd.DiscoverInstancesOutput, error) + ListNamespaces(ctx context.Context, params *sd.ListNamespacesInput, optFns ...func(*sd.Options)) (*sd.ListNamespacesOutput, error) + ListServices(ctx context.Context, params *sd.ListServicesInput, optFns ...func(*sd.Options)) (*sd.ListServicesOutput, error) + RegisterInstance(ctx context.Context, params *sd.RegisterInstanceInput, optFns ...func(*sd.Options)) (*sd.RegisterInstanceOutput, error) + UpdateService(ctx context.Context, params *sd.UpdateServiceInput, optFns ...func(*sd.Options)) (*sd.UpdateServiceOutput, error) + DeleteService(ctx context.Context, params *sd.DeleteServiceInput, optFns ...func(*sd.Options)) (*sd.DeleteServiceOutput, error) } // AWSSDProvider is an implementation of Provider for AWS Cloud Map. @@ -74,7 +74,7 @@ type AWSSDProvider struct { // only consider namespaces ending in this suffix namespaceFilter endpoint.DomainFilter // filter namespace by type (private or public) - namespaceTypeFilter *sd.NamespaceFilter + namespaceTypeFilter sdtypes.NamespaceFilter // enables service without instances cleanup cleanEmptyService bool // filter services for removal @@ -83,7 +83,7 @@ type AWSSDProvider struct { // NewAWSSDProvider initializes a new AWS Cloud Map based Provider. func NewAWSSDProvider(domainFilter endpoint.DomainFilter, namespaceType string, dryRun, cleanEmptyService bool, ownerID string, client AWSSDClient) (*AWSSDProvider, error) { - provider := &AWSSDProvider{ + p := &AWSSDProvider{ client: client, dryRun: dryRun, namespaceFilter: domainFilter, @@ -92,42 +92,42 @@ func NewAWSSDProvider(domainFilter endpoint.DomainFilter, namespaceType string, ownerID: ownerID, } - return provider, nil + return p, nil } // newSdNamespaceFilter initialized AWS SD Namespace Filter based on given string config -func newSdNamespaceFilter(namespaceTypeConfig string) *sd.NamespaceFilter { +func newSdNamespaceFilter(namespaceTypeConfig string) sdtypes.NamespaceFilter { switch namespaceTypeConfig { case sdNamespaceTypePublic: - return &sd.NamespaceFilter{ - Name: aws.String(sd.NamespaceFilterNameType), - Values: []*string{aws.String(sd.NamespaceTypeDnsPublic)}, + return sdtypes.NamespaceFilter{ + Name: sdtypes.NamespaceFilterNameType, + Values: []string{string(sdtypes.NamespaceTypeDnsPublic)}, } case sdNamespaceTypePrivate: - return &sd.NamespaceFilter{ - Name: aws.String(sd.NamespaceFilterNameType), - Values: []*string{aws.String(sd.NamespaceTypeDnsPrivate)}, + return sdtypes.NamespaceFilter{ + Name: sdtypes.NamespaceFilterNameType, + Values: []string{string(sdtypes.NamespaceTypeDnsPrivate)}, } default: - return nil + return sdtypes.NamespaceFilter{} } } // Records returns list of all endpoints. func (p *AWSSDProvider) Records(ctx context.Context) (endpoints []*endpoint.Endpoint, err error) { - namespaces, err := p.ListNamespaces() + namespaces, err := p.ListNamespaces(ctx) if err != nil { return nil, err } for _, ns := range namespaces { - services, err := p.ListServicesByNamespaceID(ns.Id) + services, err := p.ListServicesByNamespaceID(ctx, ns.Id) if err != nil { return nil, err } for _, srv := range services { - resp, err := p.client.DiscoverInstancesWithContext(ctx, &sd.DiscoverInstancesInput{ + resp, err := p.client.DiscoverInstances(ctx, &sd.DiscoverInstancesInput{ NamespaceName: ns.Name, ServiceName: srv.Name, }) @@ -136,8 +136,8 @@ func (p *AWSSDProvider) Records(ctx context.Context) (endpoints []*endpoint.Endp } if len(resp.Instances) == 0 { - if err := p.DeleteService(srv); err != nil { - log.Errorf("Failed to delete service %q, error: %s", aws.StringValue(srv.Name), err) + if err := p.DeleteService(ctx, srv); err != nil { + log.Errorf("Failed to delete service %q, error: %s", *srv.Name, err) } continue } @@ -149,35 +149,35 @@ func (p *AWSSDProvider) Records(ctx context.Context) (endpoints []*endpoint.Endp return endpoints, nil } -func (p *AWSSDProvider) instancesToEndpoint(ns *sd.NamespaceSummary, srv *sd.Service, instances []*sd.HttpInstanceSummary) *endpoint.Endpoint { +func (p *AWSSDProvider) instancesToEndpoint(ns *sdtypes.NamespaceSummary, srv *sdtypes.Service, instances []sdtypes.HttpInstanceSummary) *endpoint.Endpoint { // DNS name of the record is a concatenation of service and namespace recordName := *srv.Name + "." + *ns.Name labels := endpoint.NewLabels() - labels[endpoint.AWSSDDescriptionLabel] = aws.StringValue(srv.Description) + labels[endpoint.AWSSDDescriptionLabel] = *srv.Description newEndpoint := &endpoint.Endpoint{ DNSName: recordName, - RecordTTL: endpoint.TTL(aws.Int64Value(srv.DnsConfig.DnsRecords[0].TTL)), + RecordTTL: endpoint.TTL(*srv.DnsConfig.DnsRecords[0].TTL), Targets: make(endpoint.Targets, 0, len(instances)), Labels: labels, } for _, inst := range instances { // CNAME - if inst.Attributes[sdInstanceAttrCname] != nil && aws.StringValue(srv.DnsConfig.DnsRecords[0].Type) == sd.RecordTypeCname { + if inst.Attributes[sdInstanceAttrCname] != "" && srv.DnsConfig.DnsRecords[0].Type == sdtypes.RecordTypeCname { newEndpoint.RecordType = endpoint.RecordTypeCNAME - newEndpoint.Targets = append(newEndpoint.Targets, aws.StringValue(inst.Attributes[sdInstanceAttrCname])) + newEndpoint.Targets = append(newEndpoint.Targets, inst.Attributes[sdInstanceAttrCname]) // ALIAS - } else if inst.Attributes[sdInstanceAttrAlias] != nil { + } else if inst.Attributes[sdInstanceAttrAlias] != "" { newEndpoint.RecordType = endpoint.RecordTypeCNAME - newEndpoint.Targets = append(newEndpoint.Targets, aws.StringValue(inst.Attributes[sdInstanceAttrAlias])) + newEndpoint.Targets = append(newEndpoint.Targets, inst.Attributes[sdInstanceAttrAlias]) // IP-based target - } else if inst.Attributes[sdInstanceAttrIPV4] != nil { + } else if inst.Attributes[sdInstanceAttrIPV4] != "" { newEndpoint.RecordType = endpoint.RecordTypeA - newEndpoint.Targets = append(newEndpoint.Targets, aws.StringValue(inst.Attributes[sdInstanceAttrIPV4])) + newEndpoint.Targets = append(newEndpoint.Targets, inst.Attributes[sdInstanceAttrIPV4]) } else { log.Warnf("Invalid instance \"%v\" found in service \"%v\"", inst, srv.Name) } @@ -199,7 +199,7 @@ func (p *AWSSDProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) changes.Delete = append(changes.Delete, deletes...) changes.Create = append(changes.Create, creates...) - namespaces, err := p.ListNamespaces() + namespaces, err := p.ListNamespaces(ctx) if err != nil { return err } @@ -211,12 +211,12 @@ func (p *AWSSDProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) // creates = [1.2.3.4, 1.2.3.5] // ``` // then when deletes are executed after creates it will miss the `1.2.3.4` instance. - err = p.submitDeletes(namespaces, changes.Delete) + err = p.submitDeletes(ctx, namespaces, changes.Delete) if err != nil { return err } - err = p.submitCreates(namespaces, changes.Create) + err = p.submitCreates(ctx, namespaces, changes.Create) if err != nil { return err } @@ -245,11 +245,11 @@ func (p *AWSSDProvider) updatesToCreates(changes *plan.Changes) (creates []*endp return creates, deletes } -func (p *AWSSDProvider) submitCreates(namespaces []*sd.NamespaceSummary, changes []*endpoint.Endpoint) error { +func (p *AWSSDProvider) submitCreates(ctx context.Context, namespaces []*sdtypes.NamespaceSummary, changes []*endpoint.Endpoint) error { changesByNamespaceID := p.changesByNamespaceID(namespaces, changes) for nsID, changeList := range changesByNamespaceID { - services, err := p.ListServicesByNamespaceID(aws.String(nsID)) + services, err := p.ListServicesByNamespaceID(ctx, aws.String(nsID)) if err != nil { return err } @@ -260,7 +260,7 @@ func (p *AWSSDProvider) submitCreates(namespaces []*sd.NamespaceSummary, changes srv := services[srvName] if srv == nil { // when service is missing create a new one - srv, err = p.CreateService(&nsID, &srvName, ch) + srv, err = p.CreateService(ctx, &nsID, &srvName, ch) if err != nil { return err } @@ -268,13 +268,13 @@ func (p *AWSSDProvider) submitCreates(namespaces []*sd.NamespaceSummary, changes services[*srv.Name] = srv } else if ch.RecordTTL.IsConfigured() && *srv.DnsConfig.DnsRecords[0].TTL != int64(ch.RecordTTL) { // update service when TTL differ - err = p.UpdateService(srv, ch) + err = p.UpdateService(ctx, srv, ch) if err != nil { return err } } - err = p.RegisterInstance(srv, ch) + err = p.RegisterInstance(ctx, srv, ch) if err != nil { return err } @@ -284,11 +284,11 @@ func (p *AWSSDProvider) submitCreates(namespaces []*sd.NamespaceSummary, changes return nil } -func (p *AWSSDProvider) submitDeletes(namespaces []*sd.NamespaceSummary, changes []*endpoint.Endpoint) error { +func (p *AWSSDProvider) submitDeletes(ctx context.Context, namespaces []*sdtypes.NamespaceSummary, changes []*endpoint.Endpoint) error { changesByNamespaceID := p.changesByNamespaceID(namespaces, changes) for nsID, changeList := range changesByNamespaceID { - services, err := p.ListServicesByNamespaceID(aws.String(nsID)) + services, err := p.ListServicesByNamespaceID(ctx, aws.String(nsID)) if err != nil { return err } @@ -302,7 +302,7 @@ func (p *AWSSDProvider) submitDeletes(namespaces []*sd.NamespaceSummary, changes return fmt.Errorf("service \"%s\" is missing when trying to delete \"%v\"", srvName, hostname) } - err := p.DeregisterInstance(srv, ch) + err := p.DeregisterInstance(ctx, srv, ch) if err != nil { return err } @@ -313,53 +313,51 @@ func (p *AWSSDProvider) submitDeletes(namespaces []*sd.NamespaceSummary, changes } // ListNamespaces returns all namespaces matching defined namespace filter -func (p *AWSSDProvider) ListNamespaces() ([]*sd.NamespaceSummary, error) { - namespaces := make([]*sd.NamespaceSummary, 0) +func (p *AWSSDProvider) ListNamespaces(ctx context.Context) ([]*sdtypes.NamespaceSummary, error) { + namespaces := make([]*sdtypes.NamespaceSummary, 0) - f := func(resp *sd.ListNamespacesOutput, lastPage bool) bool { - for _, ns := range resp.Namespaces { - if !p.namespaceFilter.Match(aws.StringValue(ns.Name)) { - continue - } - namespaces = append(namespaces, ns) + paginator := sd.NewListNamespacesPaginator(p.client, &sd.ListNamespacesInput{ + Filters: []sdtypes.NamespaceFilter{p.namespaceTypeFilter}, + }) + for paginator.HasMorePages() { + resp, err := paginator.NextPage(ctx) + if err != nil { + return nil, err } - return true - } - - err := p.client.ListNamespacesPages(&sd.ListNamespacesInput{ - Filters: []*sd.NamespaceFilter{p.namespaceTypeFilter}, - }, f) - if err != nil { - return nil, err + for _, ns := range resp.Namespaces { + if !p.namespaceFilter.Match(*ns.Name) { + continue + } + namespaces = append(namespaces, &ns) + } } return namespaces, nil } -// ListServicesByNamespaceID returns list of services in given namespace. Returns map[srv_name]*sd.Service -func (p *AWSSDProvider) ListServicesByNamespaceID(namespaceID *string) (map[string]*sd.Service, error) { - services := make([]*sd.ServiceSummary, 0) +// ListServicesByNamespaceID returns list of services in given namespace. +func (p *AWSSDProvider) ListServicesByNamespaceID(ctx context.Context, namespaceID *string) (map[string]*sdtypes.Service, error) { + services := make([]sdtypes.ServiceSummary, 0) - f := func(resp *sd.ListServicesOutput, lastPage bool) bool { - services = append(services, resp.Services...) - return true - } - - err := p.client.ListServicesPages(&sd.ListServicesInput{ - Filters: []*sd.ServiceFilter{{ - Name: aws.String(sd.ServiceFilterNameNamespaceId), - Values: []*string{namespaceID}, + paginator := sd.NewListServicesPaginator(p.client, &sd.ListServicesInput{ + Filters: []sdtypes.ServiceFilter{{ + Name: sdtypes.ServiceFilterNameNamespaceId, + Values: []string{*namespaceID}, }}, - MaxResults: aws.Int64(100), - }, f) - if err != nil { - return nil, err + MaxResults: aws.Int32(100), + }) + for paginator.HasMorePages() { + resp, err := paginator.NextPage(ctx) + if err != nil { + return nil, err + } + services = append(services, resp.Services...) } - servicesMap := make(map[string]*sd.Service) + servicesMap := make(map[string]*sdtypes.Service) for _, serviceSummary := range services { - service := &sd.Service{ + service := &sdtypes.Service{ Arn: serviceSummary.Arn, CreateDate: serviceSummary.CreateDate, Description: serviceSummary.Description, @@ -373,13 +371,13 @@ func (p *AWSSDProvider) ListServicesByNamespaceID(namespaceID *string) (map[stri Type: serviceSummary.Type, } - servicesMap[aws.StringValue(service.Name)] = service + servicesMap[*service.Name] = service } return servicesMap, nil } // CreateService creates a new service in AWS API. Returns the created service. -func (p *AWSSDProvider) CreateService(namespaceID *string, srvName *string, ep *endpoint.Endpoint) (*sd.Service, error) { +func (p *AWSSDProvider) CreateService(ctx context.Context, namespaceID *string, srvName *string, ep *endpoint.Endpoint) (*sdtypes.Service, error) { log.Infof("Creating a new service \"%s\" in \"%s\" namespace", *srvName, *namespaceID) srvType := p.serviceTypeFromEndpoint(ep) @@ -391,13 +389,13 @@ func (p *AWSSDProvider) CreateService(namespaceID *string, srvName *string, ep * } if !p.dryRun { - out, err := p.client.CreateService(&sd.CreateServiceInput{ + out, err := p.client.CreateService(ctx, &sd.CreateServiceInput{ Name: srvName, Description: aws.String(ep.Labels[endpoint.AWSSDDescriptionLabel]), - DnsConfig: &sd.DnsConfig{ - RoutingPolicy: aws.String(routingPolicy), - DnsRecords: []*sd.DnsRecord{{ - Type: aws.String(srvType), + DnsConfig: &sdtypes.DnsConfig{ + RoutingPolicy: routingPolicy, + DnsRecords: []sdtypes.DnsRecord{{ + Type: srvType, TTL: aws.Int64(ttl), }}, }, @@ -411,11 +409,11 @@ func (p *AWSSDProvider) CreateService(namespaceID *string, srvName *string, ep * } // return mock service summary in case of dry run - return &sd.Service{Id: aws.String("dry-run-service"), Name: aws.String("dry-run-service")}, nil + return &sdtypes.Service{Id: aws.String("dry-run-service"), Name: aws.String("dry-run-service")}, nil } // UpdateService updates the specified service with information from provided endpoint. -func (p *AWSSDProvider) UpdateService(service *sd.Service, ep *endpoint.Endpoint) error { +func (p *AWSSDProvider) UpdateService(ctx context.Context, service *sdtypes.Service, ep *endpoint.Endpoint) error { log.Infof("Updating service \"%s\"", *service.Name) srvType := p.serviceTypeFromEndpoint(ep) @@ -426,13 +424,13 @@ func (p *AWSSDProvider) UpdateService(service *sd.Service, ep *endpoint.Endpoint } if !p.dryRun { - _, err := p.client.UpdateService(&sd.UpdateServiceInput{ + _, err := p.client.UpdateService(ctx, &sd.UpdateServiceInput{ Id: service.Id, - Service: &sd.ServiceChange{ + Service: &sdtypes.ServiceChange{ Description: aws.String(ep.Labels[endpoint.AWSSDDescriptionLabel]), - DnsConfig: &sd.DnsConfigChange{ - DnsRecords: []*sd.DnsRecord{{ - Type: aws.String(srvType), + DnsConfig: &sdtypes.DnsConfigChange{ + DnsRecords: []sdtypes.DnsRecord{{ + Type: srvType, TTL: aws.Int64(ttl), }}, }, @@ -447,7 +445,7 @@ func (p *AWSSDProvider) UpdateService(service *sd.Service, ep *endpoint.Endpoint } // DeleteService deletes empty Service from AWS API if its owner id match -func (p *AWSSDProvider) DeleteService(service *sd.Service) error { +func (p *AWSSDProvider) DeleteService(ctx context.Context, service *sdtypes.Service) error { log.Debugf("Check if service \"%s\" owner id match and it can be deleted", *service.Name) if !p.dryRun && p.cleanEmptyService { // convert ownerID string to service description format @@ -455,39 +453,39 @@ func (p *AWSSDProvider) DeleteService(service *sd.Service) error { label[endpoint.OwnerLabelKey] = p.ownerID label[endpoint.AWSSDDescriptionLabel] = label.SerializePlain(false) - if strings.HasPrefix(aws.StringValue(service.Description), label[endpoint.AWSSDDescriptionLabel]) { + if strings.HasPrefix(*service.Description, label[endpoint.AWSSDDescriptionLabel]) { log.Infof("Deleting service \"%s\"", *service.Name) - _, err := p.client.DeleteService(&sd.DeleteServiceInput{ + _, err := p.client.DeleteService(ctx, &sd.DeleteServiceInput{ Id: aws.String(*service.Id), }) return err } - log.Debugf("Skipping service removal %s because owner id does not match, found: \"%s\", required: \"%s\"", aws.StringValue(service.Name), aws.StringValue(service.Description), label[endpoint.AWSSDDescriptionLabel]) + log.Debugf("Skipping service removal %s because owner id does not match, found: \"%s\", required: \"%s\"", *service.Name, *service.Description, label[endpoint.AWSSDDescriptionLabel]) } return nil } // RegisterInstance creates a new instance in given service. -func (p *AWSSDProvider) RegisterInstance(service *sd.Service, ep *endpoint.Endpoint) error { +func (p *AWSSDProvider) RegisterInstance(ctx context.Context, service *sdtypes.Service, ep *endpoint.Endpoint) error { for _, target := range ep.Targets { log.Infof("Registering a new instance \"%s\" for service \"%s\" (%s)", target, *service.Name, *service.Id) - attr := make(map[string]*string) + attr := make(map[string]string) if ep.RecordType == endpoint.RecordTypeCNAME { if p.isAWSLoadBalancer(target) { - attr[sdInstanceAttrAlias] = aws.String(target) + attr[sdInstanceAttrAlias] = target } else { - attr[sdInstanceAttrCname] = aws.String(target) + attr[sdInstanceAttrCname] = target } } else if ep.RecordType == endpoint.RecordTypeA { - attr[sdInstanceAttrIPV4] = aws.String(target) + attr[sdInstanceAttrIPV4] = target } else { return fmt.Errorf("invalid endpoint type (%v)", ep) } if !p.dryRun { - _, err := p.client.RegisterInstance(&sd.RegisterInstanceInput{ + _, err := p.client.RegisterInstance(ctx, &sd.RegisterInstanceInput{ ServiceId: service.Id, Attributes: attr, InstanceId: aws.String(p.targetToInstanceID(target)), @@ -502,12 +500,12 @@ func (p *AWSSDProvider) RegisterInstance(service *sd.Service, ep *endpoint.Endpo } // DeregisterInstance removes an instance from given service. -func (p *AWSSDProvider) DeregisterInstance(service *sd.Service, ep *endpoint.Endpoint) error { +func (p *AWSSDProvider) DeregisterInstance(ctx context.Context, service *sdtypes.Service, ep *endpoint.Endpoint) error { for _, target := range ep.Targets { log.Infof("De-registering an instance \"%s\" for service \"%s\" (%s)", target, *service.Name, *service.Id) if !p.dryRun { - _, err := p.client.DeregisterInstance(&sd.DeregisterInstanceInput{ + _, err := p.client.DeregisterInstance(ctx, &sd.DeregisterInstanceInput{ InstanceId: aws.String(p.targetToInstanceID(target)), ServiceId: service.Id, }) @@ -531,43 +529,7 @@ func (p *AWSSDProvider) targetToInstanceID(target string) string { return strings.ToLower(target) } -// nolint: deadcode -// used from unit test -func namespaceToNamespaceSummary(namespace *sd.Namespace) *sd.NamespaceSummary { - if namespace == nil { - return nil - } - - return &sd.NamespaceSummary{ - Id: namespace.Id, - Type: namespace.Type, - Name: namespace.Name, - Arn: namespace.Arn, - } -} - -// nolint: deadcode -// used from unit test -func serviceToServiceSummary(service *sd.Service) *sd.ServiceSummary { - if service == nil { - return nil - } - - return &sd.ServiceSummary{ - Arn: service.Arn, - CreateDate: service.CreateDate, - Description: service.Description, - DnsConfig: service.DnsConfig, - HealthCheckConfig: service.HealthCheckConfig, - HealthCheckCustomConfig: service.HealthCheckCustomConfig, - Id: service.Id, - InstanceCount: service.InstanceCount, - Name: service.Name, - Type: service.Type, - } -} - -func (p *AWSSDProvider) changesByNamespaceID(namespaces []*sd.NamespaceSummary, changes []*endpoint.Endpoint) map[string][]*endpoint.Endpoint { +func (p *AWSSDProvider) changesByNamespaceID(namespaces []*sdtypes.NamespaceSummary, changes []*endpoint.Endpoint) map[string][]*endpoint.Endpoint { changesByNsID := make(map[string][]*endpoint.Endpoint) for _, ns := range namespaces { @@ -600,8 +562,8 @@ func (p *AWSSDProvider) changesByNamespaceID(namespaces []*sd.NamespaceSummary, } // returns list of all namespaces matching given hostname -func matchingNamespaces(hostname string, namespaces []*sd.NamespaceSummary) []*sd.NamespaceSummary { - matchingNamespaces := make([]*sd.NamespaceSummary, 0) +func matchingNamespaces(hostname string, namespaces []*sdtypes.NamespaceSummary) []*sdtypes.NamespaceSummary { + matchingNamespaces := make([]*sdtypes.NamespaceSummary, 0) for _, ns := range namespaces { if *ns.Name == hostname { @@ -621,26 +583,26 @@ func (p *AWSSDProvider) parseHostname(hostname string) (namespace string, servic } // determine service routing policy based on endpoint type -func (p *AWSSDProvider) routingPolicyFromEndpoint(ep *endpoint.Endpoint) string { +func (p *AWSSDProvider) routingPolicyFromEndpoint(ep *endpoint.Endpoint) sdtypes.RoutingPolicy { if ep.RecordType == endpoint.RecordTypeA { - return sd.RoutingPolicyMultivalue + return sdtypes.RoutingPolicyMultivalue } - return sd.RoutingPolicyWeighted + return sdtypes.RoutingPolicyWeighted } // determine service type (A, CNAME) from given endpoint -func (p *AWSSDProvider) serviceTypeFromEndpoint(ep *endpoint.Endpoint) string { +func (p *AWSSDProvider) serviceTypeFromEndpoint(ep *endpoint.Endpoint) sdtypes.RecordType { if ep.RecordType == endpoint.RecordTypeCNAME { // FIXME service type is derived from the first target only. Theoretically this may be problem. // But I don't see a scenario where one endpoint contains targets of different types. if p.isAWSLoadBalancer(ep.Targets[0]) { - // ALIAS target uses DNS record type of A - return sd.RecordTypeA + // ALIAS target uses DNS record of type A + return sdtypes.RecordTypeA } - return sd.RecordTypeCname + return sdtypes.RecordTypeCname } - return sd.RecordTypeA + return sdtypes.RecordTypeA } // determine if a given hostname belongs to an AWS load balancer diff --git a/provider/awssd/aws_sd_test.go b/provider/awssd/aws_sd_test.go index 03198d49c..2cc543143 100644 --- a/provider/awssd/aws_sd_test.go +++ b/provider/awssd/aws_sd_test.go @@ -25,9 +25,9 @@ import ( "testing" "time" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - sd "github.com/aws/aws-sdk-go/service/servicediscovery" + "github.com/aws/aws-sdk-go-v2/aws" + sd "github.com/aws/aws-sdk-go-v2/service/servicediscovery" + sdtypes "github.com/aws/aws-sdk-go-v2/service/servicediscovery/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -45,17 +45,17 @@ var ( type AWSSDClientStub struct { // map[namespace_id]namespace - namespaces map[string]*sd.Namespace + namespaces map[string]*sdtypes.Namespace // map[namespace_id] => map[service_id]instance - services map[string]map[string]*sd.Service + services map[string]map[string]*sdtypes.Service // map[service_id] => map[inst_id]instance - instances map[string]map[string]*sd.Instance + instances map[string]map[string]*sdtypes.Instance } -func (s *AWSSDClientStub) CreateService(input *sd.CreateServiceInput) (*sd.CreateServiceOutput, error) { - srv := &sd.Service{ +func (s *AWSSDClientStub) CreateService(ctx context.Context, input *sd.CreateServiceInput, optFns ...func(*sd.Options)) (*sd.CreateServiceOutput, error) { + srv := &sdtypes.Service{ Id: aws.String(strconv.Itoa(rand.Intn(10000))), DnsConfig: input.DnsConfig, Name: input.Name, @@ -66,7 +66,7 @@ func (s *AWSSDClientStub) CreateService(input *sd.CreateServiceInput) (*sd.Creat nsServices, ok := s.services[*input.NamespaceId] if !ok { - nsServices = make(map[string]*sd.Service) + nsServices = make(map[string]*sdtypes.Service) s.services[*input.NamespaceId] = nsServices } nsServices[*srv.Id] = srv @@ -76,14 +76,14 @@ func (s *AWSSDClientStub) CreateService(input *sd.CreateServiceInput) (*sd.Creat }, nil } -func (s *AWSSDClientStub) DeregisterInstance(input *sd.DeregisterInstanceInput) (*sd.DeregisterInstanceOutput, error) { +func (s *AWSSDClientStub) DeregisterInstance(ctx context.Context, input *sd.DeregisterInstanceInput, optFns ...func(options *sd.Options)) (*sd.DeregisterInstanceOutput, error) { serviceInstances := s.instances[*input.ServiceId] delete(serviceInstances, *input.InstanceId) return &sd.DeregisterInstanceOutput{}, nil } -func (s *AWSSDClientStub) GetService(input *sd.GetServiceInput) (*sd.GetServiceOutput, error) { +func (s *AWSSDClientStub) GetService(ctx context.Context, input *sd.GetServiceInput, optFns ...func(options *sd.Options)) (*sd.GetServiceOutput, error) { for _, entry := range s.services { srv, ok := entry[*input.Id] if ok { @@ -96,18 +96,18 @@ func (s *AWSSDClientStub) GetService(input *sd.GetServiceInput) (*sd.GetServiceO return nil, errors.New("service not found") } -func (s *AWSSDClientStub) DiscoverInstancesWithContext(ctx context.Context, input *sd.DiscoverInstancesInput, opts ...request.Option) (*sd.DiscoverInstancesOutput, error) { - instances := make([]*sd.HttpInstanceSummary, 0) +func (s *AWSSDClientStub) DiscoverInstances(ctx context.Context, input *sd.DiscoverInstancesInput, opts ...func(options *sd.Options)) (*sd.DiscoverInstancesOutput, error) { + instances := make([]sdtypes.HttpInstanceSummary, 0) var foundNs bool for _, ns := range s.namespaces { - if aws.StringValue(ns.Name) == aws.StringValue(input.NamespaceName) { + if *ns.Name == *input.NamespaceName { foundNs = true for _, srv := range s.services[*ns.Id] { - if aws.StringValue(srv.Name) == aws.StringValue(input.ServiceName) { + if *srv.Name == *input.ServiceName { for _, inst := range s.instances[*srv.Id] { - instances = append(instances, instanceToHTTPInstanceSummary(inst)) + instances = append(instances, *instanceToHTTPInstanceSummary(inst)) } } } @@ -123,57 +123,50 @@ func (s *AWSSDClientStub) DiscoverInstancesWithContext(ctx context.Context, inpu }, nil } -func (s *AWSSDClientStub) ListNamespacesPages(input *sd.ListNamespacesInput, fn func(*sd.ListNamespacesOutput, bool) bool) error { - namespaces := make([]*sd.NamespaceSummary, 0) - - filter := input.Filters[0] +func (s *AWSSDClientStub) ListNamespaces(ctx context.Context, input *sd.ListNamespacesInput, optFns ...func(options *sd.Options)) (*sd.ListNamespacesOutput, error) { + namespaces := make([]sdtypes.NamespaceSummary, 0) for _, ns := range s.namespaces { - if filter != nil && *filter.Name == sd.NamespaceFilterNameType { - if *ns.Type != *filter.Values[0] { + if len(input.Filters) > 0 && input.Filters[0].Name == sdtypes.NamespaceFilterNameType { + if ns.Type != sdtypes.NamespaceType(input.Filters[0].Values[0]) { // skip namespaces not matching filter continue } } - namespaces = append(namespaces, namespaceToNamespaceSummary(ns)) + namespaces = append(namespaces, *namespaceToNamespaceSummary(ns)) } - fn(&sd.ListNamespacesOutput{ + return &sd.ListNamespacesOutput{ Namespaces: namespaces, - }, true) - - return nil + }, nil } -func (s *AWSSDClientStub) ListServicesPages(input *sd.ListServicesInput, fn func(*sd.ListServicesOutput, bool) bool) error { - services := make([]*sd.ServiceSummary, 0) +func (s *AWSSDClientStub) ListServices(ctx context.Context, input *sd.ListServicesInput, optFns ...func(options *sd.Options)) (*sd.ListServicesOutput, error) { + services := make([]sdtypes.ServiceSummary, 0) // get namespace filter - filter := input.Filters[0] - if filter == nil || *filter.Name != sd.ServiceFilterNameNamespaceId { - return errors.New("missing namespace filter") + if len(input.Filters) == 0 || input.Filters[0].Name != sdtypes.ServiceFilterNameNamespaceId { + return nil, errors.New("missing namespace filter") } - nsID := filter.Values[0] + nsID := input.Filters[0].Values[0] - for _, srv := range s.services[*nsID] { - services = append(services, serviceToServiceSummary(srv)) + for _, srv := range s.services[nsID] { + services = append(services, *serviceToServiceSummary(srv)) } - fn(&sd.ListServicesOutput{ + return &sd.ListServicesOutput{ Services: services, - }, true) - - return nil + }, nil } -func (s *AWSSDClientStub) RegisterInstance(input *sd.RegisterInstanceInput) (*sd.RegisterInstanceOutput, error) { +func (s *AWSSDClientStub) RegisterInstance(ctx context.Context, input *sd.RegisterInstanceInput, optFns ...func(options *sd.Options)) (*sd.RegisterInstanceOutput, error) { srvInstances, ok := s.instances[*input.ServiceId] if !ok { - srvInstances = make(map[string]*sd.Instance) + srvInstances = make(map[string]*sdtypes.Instance) s.instances[*input.ServiceId] = srvInstances } - srvInstances[*input.InstanceId] = &sd.Instance{ + srvInstances[*input.InstanceId] = &sdtypes.Instance{ Id: input.InstanceId, Attributes: input.Attributes, CreatorRequestId: input.CreatorRequestId, @@ -182,8 +175,8 @@ func (s *AWSSDClientStub) RegisterInstance(input *sd.RegisterInstanceInput) (*sd return &sd.RegisterInstanceOutput{}, nil } -func (s *AWSSDClientStub) UpdateService(input *sd.UpdateServiceInput) (*sd.UpdateServiceOutput, error) { - out, err := s.GetService(&sd.GetServiceInput{Id: input.Id}) +func (s *AWSSDClientStub) UpdateService(ctx context.Context, input *sd.UpdateServiceInput, optFns ...func(options *sd.Options)) (*sd.UpdateServiceOutput, error) { + out, err := s.GetService(ctx, &sd.GetServiceInput{Id: input.Id}) if err != nil { return nil, err } @@ -197,8 +190,8 @@ func (s *AWSSDClientStub) UpdateService(input *sd.UpdateServiceInput) (*sd.Updat return &sd.UpdateServiceOutput{}, nil } -func (s *AWSSDClientStub) DeleteService(input *sd.DeleteServiceInput) (*sd.DeleteServiceOutput, error) { - out, err := s.GetService(&sd.GetServiceInput{Id: input.Id}) +func (s *AWSSDClientStub) DeleteService(ctx context.Context, input *sd.DeleteServiceInput, optFns ...func(options *sd.Options)) (*sd.DeleteServiceOutput, error) { + out, err := s.GetService(ctx, &sd.GetServiceInput{Id: input.Id}) if err != nil { return nil, err } @@ -221,39 +214,69 @@ func newTestAWSSDProvider(api AWSSDClient, domainFilter endpoint.DomainFilter, n } } -// nolint: deadcode -// used for unit test -func instanceToHTTPInstanceSummary(instance *sd.Instance) *sd.HttpInstanceSummary { +func instanceToHTTPInstanceSummary(instance *sdtypes.Instance) *sdtypes.HttpInstanceSummary { if instance == nil { return nil } - return &sd.HttpInstanceSummary{ + return &sdtypes.HttpInstanceSummary{ InstanceId: instance.Id, Attributes: instance.Attributes, } } +func namespaceToNamespaceSummary(namespace *sdtypes.Namespace) *sdtypes.NamespaceSummary { + if namespace == nil { + return nil + } + + return &sdtypes.NamespaceSummary{ + Id: namespace.Id, + Type: namespace.Type, + Name: namespace.Name, + Arn: namespace.Arn, + } +} + +func serviceToServiceSummary(service *sdtypes.Service) *sdtypes.ServiceSummary { + if service == nil { + return nil + } + + return &sdtypes.ServiceSummary{ + Arn: service.Arn, + CreateDate: service.CreateDate, + Description: service.Description, + DnsConfig: service.DnsConfig, + HealthCheckConfig: service.HealthCheckConfig, + HealthCheckCustomConfig: service.HealthCheckCustomConfig, + Id: service.Id, + InstanceCount: service.InstanceCount, + Name: service.Name, + Type: service.Type, + } +} + func TestAWSSDProvider_Records(t *testing.T) { - namespaces := map[string]*sd.Namespace{ + namespaces := map[string]*sdtypes.Namespace{ "private": { Id: aws.String("private"), Name: aws.String("private.com"), - Type: aws.String(sd.NamespaceTypeDnsPrivate), + Type: sdtypes.NamespaceTypeDnsPrivate, }, } - services := map[string]map[string]*sd.Service{ + services := map[string]map[string]*sdtypes.Service{ "private": { "a-srv": { Id: aws.String("a-srv"), Name: aws.String("service1"), + NamespaceId: aws.String("private"), Description: aws.String("owner-id"), - DnsConfig: &sd.DnsConfig{ - NamespaceId: aws.String("private"), - RoutingPolicy: aws.String(sd.RoutingPolicyWeighted), - DnsRecords: []*sd.DnsRecord{{ - Type: aws.String(sd.RecordTypeA), + DnsConfig: &sdtypes.DnsConfig{ + RoutingPolicy: sdtypes.RoutingPolicyWeighted, + DnsRecords: []sdtypes.DnsRecord{{ + Type: sdtypes.RecordTypeA, TTL: aws.Int64(100), }}, }, @@ -261,12 +284,12 @@ func TestAWSSDProvider_Records(t *testing.T) { "alias-srv": { Id: aws.String("alias-srv"), Name: aws.String("service2"), + NamespaceId: aws.String("private"), Description: aws.String("owner-id"), - DnsConfig: &sd.DnsConfig{ - NamespaceId: aws.String("private"), - RoutingPolicy: aws.String(sd.RoutingPolicyWeighted), - DnsRecords: []*sd.DnsRecord{{ - Type: aws.String(sd.RecordTypeA), + DnsConfig: &sdtypes.DnsConfig{ + RoutingPolicy: sdtypes.RoutingPolicyWeighted, + DnsRecords: []sdtypes.DnsRecord{{ + Type: sdtypes.RecordTypeA, TTL: aws.Int64(100), }}, }, @@ -274,12 +297,12 @@ func TestAWSSDProvider_Records(t *testing.T) { "cname-srv": { Id: aws.String("cname-srv"), Name: aws.String("service3"), + NamespaceId: aws.String("private"), Description: aws.String("owner-id"), - DnsConfig: &sd.DnsConfig{ - NamespaceId: aws.String("private"), - RoutingPolicy: aws.String(sd.RoutingPolicyWeighted), - DnsRecords: []*sd.DnsRecord{{ - Type: aws.String(sd.RecordTypeCname), + DnsConfig: &sdtypes.DnsConfig{ + RoutingPolicy: sdtypes.RoutingPolicyWeighted, + DnsRecords: []sdtypes.DnsRecord{{ + Type: sdtypes.RecordTypeCname, TTL: aws.Int64(80), }}, }, @@ -287,34 +310,34 @@ func TestAWSSDProvider_Records(t *testing.T) { }, } - instances := map[string]map[string]*sd.Instance{ + instances := map[string]map[string]*sdtypes.Instance{ "a-srv": { "1.2.3.4": { Id: aws.String("1.2.3.4"), - Attributes: map[string]*string{ - sdInstanceAttrIPV4: aws.String("1.2.3.4"), + Attributes: map[string]string{ + sdInstanceAttrIPV4: "1.2.3.4", }, }, "1.2.3.5": { Id: aws.String("1.2.3.5"), - Attributes: map[string]*string{ - sdInstanceAttrIPV4: aws.String("1.2.3.5"), + Attributes: map[string]string{ + sdInstanceAttrIPV4: "1.2.3.5", }, }, }, "alias-srv": { "load-balancer.us-east-1.elb.amazonaws.com": { Id: aws.String("load-balancer.us-east-1.elb.amazonaws.com"), - Attributes: map[string]*string{ - sdInstanceAttrAlias: aws.String("load-balancer.us-east-1.elb.amazonaws.com"), + Attributes: map[string]string{ + sdInstanceAttrAlias: "load-balancer.us-east-1.elb.amazonaws.com", }, }, }, "cname-srv": { "cname.target.com": { Id: aws.String("cname.target.com"), - Attributes: map[string]*string{ - sdInstanceAttrCname: aws.String("cname.target.com"), + Attributes: map[string]string{ + sdInstanceAttrCname: "cname.target.com", }, }, }, @@ -340,18 +363,18 @@ func TestAWSSDProvider_Records(t *testing.T) { } func TestAWSSDProvider_ApplyChanges(t *testing.T) { - namespaces := map[string]*sd.Namespace{ + namespaces := map[string]*sdtypes.Namespace{ "private": { Id: aws.String("private"), Name: aws.String("private.com"), - Type: aws.String(sd.NamespaceTypeDnsPrivate), + Type: sdtypes.NamespaceTypeDnsPrivate, }, } api := &AWSSDClientStub{ namespaces: namespaces, - services: make(map[string]map[string]*sd.Service), - instances: make(map[string]map[string]*sd.Instance), + services: make(map[string]map[string]*sdtypes.Service), + instances: make(map[string]map[string]*sdtypes.Instance), } expectedEndpoints := []*endpoint.Endpoint{ @@ -371,7 +394,7 @@ func TestAWSSDProvider_ApplyChanges(t *testing.T) { // make sure services were created assert.Len(t, api.services["private"], 3) - existingServices, _ := provider.ListServicesByNamespaceID(namespaces["private"].Id) + existingServices, _ := provider.ListServicesByNamespaceID(context.Background(), namespaces["private"].Id) assert.NotNil(t, existingServices["service1"]) assert.NotNil(t, existingServices["service2"]) assert.NotNil(t, existingServices["service3"]) @@ -392,16 +415,16 @@ func TestAWSSDProvider_ApplyChanges(t *testing.T) { } func TestAWSSDProvider_ListNamespaces(t *testing.T) { - namespaces := map[string]*sd.Namespace{ + namespaces := map[string]*sdtypes.Namespace{ "private": { Id: aws.String("private"), Name: aws.String("private.com"), - Type: aws.String(sd.NamespaceTypeDnsPrivate), + Type: sdtypes.NamespaceTypeDnsPrivate, }, "public": { Id: aws.String("public"), Name: aws.String("public.com"), - Type: aws.String(sd.NamespaceTypeDnsPublic), + Type: sdtypes.NamespaceTypeDnsPublic, }, } @@ -413,20 +436,20 @@ func TestAWSSDProvider_ListNamespaces(t *testing.T) { msg string domainFilter endpoint.DomainFilter namespaceTypeFilter string - expectedNamespaces []*sd.NamespaceSummary + expectedNamespaces []*sdtypes.NamespaceSummary }{ - {"public filter", endpoint.NewDomainFilter([]string{}), "public", []*sd.NamespaceSummary{namespaceToNamespaceSummary(namespaces["public"])}}, - {"private filter", endpoint.NewDomainFilter([]string{}), "private", []*sd.NamespaceSummary{namespaceToNamespaceSummary(namespaces["private"])}}, - {"domain filter", endpoint.NewDomainFilter([]string{"public.com"}), "", []*sd.NamespaceSummary{namespaceToNamespaceSummary(namespaces["public"])}}, - {"non-existing domain", endpoint.NewDomainFilter([]string{"xxx.com"}), "", []*sd.NamespaceSummary{}}, + {"public filter", endpoint.NewDomainFilter([]string{}), "public", []*sdtypes.NamespaceSummary{namespaceToNamespaceSummary(namespaces["public"])}}, + {"private filter", endpoint.NewDomainFilter([]string{}), "private", []*sdtypes.NamespaceSummary{namespaceToNamespaceSummary(namespaces["private"])}}, + {"domain filter", endpoint.NewDomainFilter([]string{"public.com"}), "", []*sdtypes.NamespaceSummary{namespaceToNamespaceSummary(namespaces["public"])}}, + {"non-existing domain", endpoint.NewDomainFilter([]string{"xxx.com"}), "", []*sdtypes.NamespaceSummary{}}, } { provider := newTestAWSSDProvider(api, tc.domainFilter, tc.namespaceTypeFilter, "") - result, err := provider.ListNamespaces() + result, err := provider.ListNamespaces(context.Background()) require.NoError(t, err) - expectedMap := make(map[string]*sd.NamespaceSummary) - resultMap := make(map[string]*sd.NamespaceSummary) + expectedMap := make(map[string]*sdtypes.NamespaceSummary) + resultMap := make(map[string]*sdtypes.NamespaceSummary) for _, ns := range tc.expectedNamespaces { expectedMap[*ns.Id] = ns } @@ -441,20 +464,20 @@ func TestAWSSDProvider_ListNamespaces(t *testing.T) { } func TestAWSSDProvider_ListServicesByNamespace(t *testing.T) { - namespaces := map[string]*sd.Namespace{ + namespaces := map[string]*sdtypes.Namespace{ "private": { Id: aws.String("private"), Name: aws.String("private.com"), - Type: aws.String(sd.NamespaceTypeDnsPrivate), + Type: sdtypes.NamespaceTypeDnsPrivate, }, "public": { Id: aws.String("public"), Name: aws.String("public.com"), - Type: aws.String(sd.NamespaceTypeDnsPublic), + Type: sdtypes.NamespaceTypeDnsPublic, }, } - services := map[string]map[string]*sd.Service{ + services := map[string]map[string]*sdtypes.Service{ "private": { "srv1": { Id: aws.String("srv1"), @@ -482,48 +505,52 @@ func TestAWSSDProvider_ListServicesByNamespace(t *testing.T) { } for _, tc := range []struct { - expectedServices map[string]*sd.Service + expectedServices map[string]*sdtypes.Service }{ - {map[string]*sd.Service{"service1": services["private"]["srv1"], "service2": services["private"]["srv2"]}}, + {map[string]*sdtypes.Service{"service1": services["private"]["srv1"], "service2": services["private"]["srv2"]}}, } { provider := newTestAWSSDProvider(api, endpoint.NewDomainFilter([]string{}), "", "") - result, err := provider.ListServicesByNamespaceID(namespaces["private"].Id) + result, err := provider.ListServicesByNamespaceID(context.Background(), namespaces["private"].Id) require.NoError(t, err) assert.Equal(t, tc.expectedServices, result) } } func TestAWSSDProvider_CreateService(t *testing.T) { - namespaces := map[string]*sd.Namespace{ + namespaces := map[string]*sdtypes.Namespace{ "private": { Id: aws.String("private"), Name: aws.String("private.com"), - Type: aws.String(sd.NamespaceTypeDnsPrivate), + Type: sdtypes.NamespaceTypeDnsPrivate, }, } api := &AWSSDClientStub{ namespaces: namespaces, - services: make(map[string]map[string]*sd.Service), + services: make(map[string]map[string]*sdtypes.Service), } - expectedServices := make(map[string]*sd.Service) + expectedServices := make(map[string]*sdtypes.Service) provider := newTestAWSSDProvider(api, endpoint.NewDomainFilter([]string{}), "", "") // A type - provider.CreateService(aws.String("private"), aws.String("A-srv"), &endpoint.Endpoint{ + provider.CreateService(context.Background(), aws.String("private"), aws.String("A-srv"), &endpoint.Endpoint{ + Labels: map[string]string{ + endpoint.AWSSDDescriptionLabel: "A-srv", + }, RecordType: endpoint.RecordTypeA, RecordTTL: 60, Targets: endpoint.Targets{"1.2.3.4"}, }) - expectedServices["A-srv"] = &sd.Service{ - Name: aws.String("A-srv"), - DnsConfig: &sd.DnsConfig{ - RoutingPolicy: aws.String(sd.RoutingPolicyMultivalue), - DnsRecords: []*sd.DnsRecord{{ - Type: aws.String(sd.RecordTypeA), + expectedServices["A-srv"] = &sdtypes.Service{ + Name: aws.String("A-srv"), + Description: aws.String("A-srv"), + DnsConfig: &sdtypes.DnsConfig{ + RoutingPolicy: sdtypes.RoutingPolicyMultivalue, + DnsRecords: []sdtypes.DnsRecord{{ + Type: sdtypes.RecordTypeA, TTL: aws.Int64(60), }}, }, @@ -531,17 +558,21 @@ func TestAWSSDProvider_CreateService(t *testing.T) { } // CNAME type - provider.CreateService(aws.String("private"), aws.String("CNAME-srv"), &endpoint.Endpoint{ + provider.CreateService(context.Background(), aws.String("private"), aws.String("CNAME-srv"), &endpoint.Endpoint{ + Labels: map[string]string{ + endpoint.AWSSDDescriptionLabel: "CNAME-srv", + }, RecordType: endpoint.RecordTypeCNAME, RecordTTL: 80, Targets: endpoint.Targets{"cname.target.com"}, }) - expectedServices["CNAME-srv"] = &sd.Service{ - Name: aws.String("CNAME-srv"), - DnsConfig: &sd.DnsConfig{ - RoutingPolicy: aws.String(sd.RoutingPolicyWeighted), - DnsRecords: []*sd.DnsRecord{{ - Type: aws.String(sd.RecordTypeCname), + expectedServices["CNAME-srv"] = &sdtypes.Service{ + Name: aws.String("CNAME-srv"), + Description: aws.String("CNAME-srv"), + DnsConfig: &sdtypes.DnsConfig{ + RoutingPolicy: sdtypes.RoutingPolicyWeighted, + DnsRecords: []sdtypes.DnsRecord{{ + Type: sdtypes.RecordTypeCname, TTL: aws.Int64(80), }}, }, @@ -549,17 +580,21 @@ func TestAWSSDProvider_CreateService(t *testing.T) { } // ALIAS type - provider.CreateService(aws.String("private"), aws.String("ALIAS-srv"), &endpoint.Endpoint{ + provider.CreateService(context.Background(), aws.String("private"), aws.String("ALIAS-srv"), &endpoint.Endpoint{ + Labels: map[string]string{ + endpoint.AWSSDDescriptionLabel: "ALIAS-srv", + }, RecordType: endpoint.RecordTypeCNAME, RecordTTL: 100, Targets: endpoint.Targets{"load-balancer.us-east-1.elb.amazonaws.com"}, }) - expectedServices["ALIAS-srv"] = &sd.Service{ - Name: aws.String("ALIAS-srv"), - DnsConfig: &sd.DnsConfig{ - RoutingPolicy: aws.String(sd.RoutingPolicyWeighted), - DnsRecords: []*sd.DnsRecord{{ - Type: aws.String(sd.RecordTypeA), + expectedServices["ALIAS-srv"] = &sdtypes.Service{ + Name: aws.String("ALIAS-srv"), + Description: aws.String("ALIAS-srv"), + DnsConfig: &sdtypes.DnsConfig{ + RoutingPolicy: sdtypes.RoutingPolicyWeighted, + DnsRecords: []sdtypes.DnsRecord{{ + Type: sdtypes.RecordTypeA, TTL: aws.Int64(100), }}, }, @@ -569,7 +604,7 @@ func TestAWSSDProvider_CreateService(t *testing.T) { validateAWSSDServicesMapsEqual(t, expectedServices, api.services["private"]) } -func validateAWSSDServicesMapsEqual(t *testing.T, expected map[string]*sd.Service, services map[string]*sd.Service) { +func validateAWSSDServicesMapsEqual(t *testing.T, expected map[string]*sdtypes.Service, services map[string]*sdtypes.Service) { require.Len(t, services, len(expected)) for _, srv := range services { @@ -577,31 +612,31 @@ func validateAWSSDServicesMapsEqual(t *testing.T, expected map[string]*sd.Servic } } -func validateAWSSDServicesEqual(t *testing.T, expected *sd.Service, srv *sd.Service) { - assert.Equal(t, aws.StringValue(expected.Description), aws.StringValue(srv.Description)) - assert.Equal(t, aws.StringValue(expected.Name), aws.StringValue(srv.Name)) +func validateAWSSDServicesEqual(t *testing.T, expected *sdtypes.Service, srv *sdtypes.Service) { + assert.Equal(t, *expected.Description, *srv.Description) + assert.Equal(t, *expected.Name, *srv.Name) assert.True(t, reflect.DeepEqual(*expected.DnsConfig, *srv.DnsConfig)) } func TestAWSSDProvider_UpdateService(t *testing.T) { - namespaces := map[string]*sd.Namespace{ + namespaces := map[string]*sdtypes.Namespace{ "private": { Id: aws.String("private"), Name: aws.String("private.com"), - Type: aws.String(sd.NamespaceTypeDnsPrivate), + Type: sdtypes.NamespaceTypeDnsPrivate, }, } - services := map[string]map[string]*sd.Service{ + services := map[string]map[string]*sdtypes.Service{ "private": { "srv1": { - Id: aws.String("srv1"), - Name: aws.String("service1"), - DnsConfig: &sd.DnsConfig{ - NamespaceId: aws.String("private"), - RoutingPolicy: aws.String(sd.RoutingPolicyMultivalue), - DnsRecords: []*sd.DnsRecord{{ - Type: aws.String(sd.RecordTypeA), + Id: aws.String("srv1"), + Name: aws.String("service1"), + NamespaceId: aws.String("private"), + DnsConfig: &sdtypes.DnsConfig{ + RoutingPolicy: sdtypes.RoutingPolicyMultivalue, + DnsRecords: []sdtypes.DnsRecord{{ + Type: sdtypes.RecordTypeA, TTL: aws.Int64(60), }}, }, @@ -617,7 +652,7 @@ func TestAWSSDProvider_UpdateService(t *testing.T) { provider := newTestAWSSDProvider(api, endpoint.NewDomainFilter([]string{}), "", "") // update service with different TTL - provider.UpdateService(services["private"]["srv1"], &endpoint.Endpoint{ + provider.UpdateService(context.Background(), services["private"]["srv1"], &endpoint.Endpoint{ RecordType: endpoint.RecordTypeA, RecordTTL: 100, }) @@ -626,15 +661,15 @@ func TestAWSSDProvider_UpdateService(t *testing.T) { } func TestAWSSDProvider_DeleteService(t *testing.T) { - namespaces := map[string]*sd.Namespace{ + namespaces := map[string]*sdtypes.Namespace{ "private": { Id: aws.String("private"), Name: aws.String("private.com"), - Type: aws.String(sd.NamespaceTypeDnsPrivate), + Type: sdtypes.NamespaceTypeDnsPrivate, }, } - services := map[string]map[string]*sd.Service{ + services := map[string]map[string]*sdtypes.Service{ "private": { "srv1": { Id: aws.String("srv1"), @@ -665,16 +700,16 @@ func TestAWSSDProvider_DeleteService(t *testing.T) { provider := newTestAWSSDProvider(api, endpoint.NewDomainFilter([]string{}), "", "owner-id") // delete first service - err := provider.DeleteService(services["private"]["srv1"]) + err := provider.DeleteService(context.Background(), services["private"]["srv1"]) assert.NoError(t, err) assert.Len(t, api.services["private"], 2) // delete third service - err1 := provider.DeleteService(services["private"]["srv3"]) + err1 := provider.DeleteService(context.Background(), services["private"]["srv3"]) assert.NoError(t, err1) assert.Len(t, api.services["private"], 1) - expectedServices := map[string]*sd.Service{ + expectedServices := map[string]*sdtypes.Service{ "srv2": { Id: aws.String("srv2"), Description: aws.String("heritage=external-dns,external-dns/owner=owner-id"), @@ -687,48 +722,48 @@ func TestAWSSDProvider_DeleteService(t *testing.T) { } func TestAWSSDProvider_RegisterInstance(t *testing.T) { - namespaces := map[string]*sd.Namespace{ + namespaces := map[string]*sdtypes.Namespace{ "private": { Id: aws.String("private"), Name: aws.String("private.com"), - Type: aws.String(sd.NamespaceTypeDnsPrivate), + Type: sdtypes.NamespaceTypeDnsPrivate, }, } - services := map[string]map[string]*sd.Service{ + services := map[string]map[string]*sdtypes.Service{ "private": { "a-srv": { - Id: aws.String("a-srv"), - Name: aws.String("service1"), - DnsConfig: &sd.DnsConfig{ - NamespaceId: aws.String("private"), - RoutingPolicy: aws.String(sd.RoutingPolicyWeighted), - DnsRecords: []*sd.DnsRecord{{ - Type: aws.String(sd.RecordTypeA), + Id: aws.String("a-srv"), + Name: aws.String("service1"), + NamespaceId: aws.String("private"), + DnsConfig: &sdtypes.DnsConfig{ + RoutingPolicy: sdtypes.RoutingPolicyWeighted, + DnsRecords: []sdtypes.DnsRecord{{ + Type: sdtypes.RecordTypeA, TTL: aws.Int64(60), }}, }, }, "cname-srv": { - Id: aws.String("cname-srv"), - Name: aws.String("service2"), - DnsConfig: &sd.DnsConfig{ - NamespaceId: aws.String("private"), - RoutingPolicy: aws.String(sd.RoutingPolicyWeighted), - DnsRecords: []*sd.DnsRecord{{ - Type: aws.String(sd.RecordTypeCname), + Id: aws.String("cname-srv"), + Name: aws.String("service2"), + NamespaceId: aws.String("private"), + DnsConfig: &sdtypes.DnsConfig{ + RoutingPolicy: sdtypes.RoutingPolicyWeighted, + DnsRecords: []sdtypes.DnsRecord{{ + Type: sdtypes.RecordTypeCname, TTL: aws.Int64(60), }}, }, }, "alias-srv": { - Id: aws.String("alias-srv"), - Name: aws.String("service3"), - DnsConfig: &sd.DnsConfig{ - NamespaceId: aws.String("private"), - RoutingPolicy: aws.String(sd.RoutingPolicyWeighted), - DnsRecords: []*sd.DnsRecord{{ - Type: aws.String(sd.RecordTypeA), + Id: aws.String("alias-srv"), + Name: aws.String("service3"), + NamespaceId: aws.String("private"), + DnsConfig: &sdtypes.DnsConfig{ + RoutingPolicy: sdtypes.RoutingPolicyWeighted, + DnsRecords: []sdtypes.DnsRecord{{ + Type: sdtypes.RecordTypeA, TTL: aws.Int64(60), }}, }, @@ -739,78 +774,78 @@ func TestAWSSDProvider_RegisterInstance(t *testing.T) { api := &AWSSDClientStub{ namespaces: namespaces, services: services, - instances: make(map[string]map[string]*sd.Instance), + instances: make(map[string]map[string]*sdtypes.Instance), } provider := newTestAWSSDProvider(api, endpoint.NewDomainFilter([]string{}), "", "") - expectedInstances := make(map[string]*sd.Instance) + expectedInstances := make(map[string]*sdtypes.Instance) // IP-based instance - provider.RegisterInstance(services["private"]["a-srv"], &endpoint.Endpoint{ + provider.RegisterInstance(context.Background(), services["private"]["a-srv"], &endpoint.Endpoint{ RecordType: endpoint.RecordTypeA, DNSName: "service1.private.com.", RecordTTL: 300, Targets: endpoint.Targets{"1.2.3.4", "1.2.3.5"}, }) - expectedInstances["1.2.3.4"] = &sd.Instance{ + expectedInstances["1.2.3.4"] = &sdtypes.Instance{ Id: aws.String("1.2.3.4"), - Attributes: map[string]*string{ - sdInstanceAttrIPV4: aws.String("1.2.3.4"), + Attributes: map[string]string{ + sdInstanceAttrIPV4: "1.2.3.4", }, } - expectedInstances["1.2.3.5"] = &sd.Instance{ + expectedInstances["1.2.3.5"] = &sdtypes.Instance{ Id: aws.String("1.2.3.5"), - Attributes: map[string]*string{ - sdInstanceAttrIPV4: aws.String("1.2.3.5"), + Attributes: map[string]string{ + sdInstanceAttrIPV4: "1.2.3.5", }, } // AWS ELB instance (ALIAS) - provider.RegisterInstance(services["private"]["alias-srv"], &endpoint.Endpoint{ + provider.RegisterInstance(context.Background(), services["private"]["alias-srv"], &endpoint.Endpoint{ RecordType: endpoint.RecordTypeCNAME, DNSName: "service1.private.com.", RecordTTL: 300, Targets: endpoint.Targets{"load-balancer.us-east-1.elb.amazonaws.com", "load-balancer.us-west-2.elb.amazonaws.com"}, }) - expectedInstances["load-balancer.us-east-1.elb.amazonaws.com"] = &sd.Instance{ + expectedInstances["load-balancer.us-east-1.elb.amazonaws.com"] = &sdtypes.Instance{ Id: aws.String("load-balancer.us-east-1.elb.amazonaws.com"), - Attributes: map[string]*string{ - sdInstanceAttrAlias: aws.String("load-balancer.us-east-1.elb.amazonaws.com"), + Attributes: map[string]string{ + sdInstanceAttrAlias: "load-balancer.us-east-1.elb.amazonaws.com", }, } - expectedInstances["load-balancer.us-west-2.elb.amazonaws.com"] = &sd.Instance{ + expectedInstances["load-balancer.us-west-2.elb.amazonaws.com"] = &sdtypes.Instance{ Id: aws.String("load-balancer.us-west-2.elb.amazonaws.com"), - Attributes: map[string]*string{ - sdInstanceAttrAlias: aws.String("load-balancer.us-west-2.elb.amazonaws.com"), + Attributes: map[string]string{ + sdInstanceAttrAlias: "load-balancer.us-west-2.elb.amazonaws.com", }, } // AWS NLB instance (ALIAS) - provider.RegisterInstance(services["private"]["alias-srv"], &endpoint.Endpoint{ + provider.RegisterInstance(context.Background(), services["private"]["alias-srv"], &endpoint.Endpoint{ RecordType: endpoint.RecordTypeCNAME, DNSName: "service1.private.com.", RecordTTL: 300, Targets: endpoint.Targets{"load-balancer.elb.us-west-2.amazonaws.com"}, }) - expectedInstances["load-balancer.elb.us-west-2.amazonaws.com"] = &sd.Instance{ + expectedInstances["load-balancer.elb.us-west-2.amazonaws.com"] = &sdtypes.Instance{ Id: aws.String("load-balancer.elb.us-west-2.amazonaws.com"), - Attributes: map[string]*string{ - sdInstanceAttrAlias: aws.String("load-balancer.elb.us-west-2.amazonaws.com"), + Attributes: map[string]string{ + sdInstanceAttrAlias: "load-balancer.elb.us-west-2.amazonaws.com", }, } // CNAME instance - provider.RegisterInstance(services["private"]["cname-srv"], &endpoint.Endpoint{ + provider.RegisterInstance(context.Background(), services["private"]["cname-srv"], &endpoint.Endpoint{ RecordType: endpoint.RecordTypeCNAME, DNSName: "service2.private.com.", RecordTTL: 300, Targets: endpoint.Targets{"cname.target.com"}, }) - expectedInstances["cname.target.com"] = &sd.Instance{ + expectedInstances["cname.target.com"] = &sdtypes.Instance{ Id: aws.String("cname.target.com"), - Attributes: map[string]*string{ - sdInstanceAttrCname: aws.String("cname.target.com"), + Attributes: map[string]string{ + sdInstanceAttrCname: "cname.target.com", }, } @@ -825,15 +860,15 @@ func TestAWSSDProvider_RegisterInstance(t *testing.T) { } func TestAWSSDProvider_DeregisterInstance(t *testing.T) { - namespaces := map[string]*sd.Namespace{ + namespaces := map[string]*sdtypes.Namespace{ "private": { Id: aws.String("private"), Name: aws.String("private.com"), - Type: aws.String(sd.NamespaceTypeDnsPrivate), + Type: sdtypes.NamespaceTypeDnsPrivate, }, } - services := map[string]map[string]*sd.Service{ + services := map[string]map[string]*sdtypes.Service{ "private": { "srv1": { Id: aws.String("srv1"), @@ -842,12 +877,12 @@ func TestAWSSDProvider_DeregisterInstance(t *testing.T) { }, } - instances := map[string]map[string]*sd.Instance{ + instances := map[string]map[string]*sdtypes.Instance{ "srv1": { "1.2.3.4": { Id: aws.String("1.2.3.4"), - Attributes: map[string]*string{ - sdInstanceAttrIPV4: aws.String("1.2.3.4"), + Attributes: map[string]string{ + sdInstanceAttrIPV4: "1.2.3.4", }, }, }, @@ -861,7 +896,7 @@ func TestAWSSDProvider_DeregisterInstance(t *testing.T) { provider := newTestAWSSDProvider(api, endpoint.NewDomainFilter([]string{}), "", "") - provider.DeregisterInstance(services["private"]["srv1"], endpoint.NewEndpoint("srv1.private.com.", endpoint.RecordTypeA, "1.2.3.4")) + provider.DeregisterInstance(context.Background(), services["private"]["srv1"], endpoint.NewEndpoint("srv1.private.com.", endpoint.RecordTypeA, "1.2.3.4")) assert.Len(t, instances["srv1"], 0) } From 5ec37e06990a41a59f4bb808362bf7c2ae480ea2 Mon Sep 17 00:00:00 2001 From: Michael Shen Date: Tue, 30 Jul 2024 00:06:13 -0400 Subject: [PATCH 34/82] Refactor AWS provider to aws-sdk-go-v2 Signed-off-by: Michael Shen --- go.mod | 1 + go.sum | 2 + main.go | 10 +- provider/aws/aws.go | 408 ++++++++-------- provider/aws/aws_test.go | 764 +++++++++++++++--------------- provider/aws/session.go | 24 + provider/zone_type_filter.go | 9 +- provider/zone_type_filter_test.go | 23 +- 8 files changed, 631 insertions(+), 610 deletions(-) diff --git a/go.mod b/go.mod index 57e6856cb..23b9abe67 100644 --- a/go.mod +++ b/go.mod @@ -22,6 +22,7 @@ require ( github.com/aws/aws-sdk-go-v2/credentials v1.17.27 github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.14.10 github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.4 + github.com/aws/aws-sdk-go-v2/service/route53 v1.42.3 github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.3 github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 github.com/bodgit/tsig v1.2.2 diff --git a/go.sum b/go.sum index c500ada73..ea9c32dcc 100644 --- a/go.sum +++ b/go.sum @@ -145,6 +145,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.16 h1:lhAX github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.16/go.mod h1:AblAlCwvi7Q/SFowvckgN+8M3uFPlopSYeLlbNDArhA= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 h1:HGErhhrxZlQ044RiM+WdoZxp0p+EGM62y3L6pwA4olE= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17/go.mod h1:RkZEx4l0EHYDJpWppMJ3nD9wZJAa8/0lq9aVC+r2UII= +github.com/aws/aws-sdk-go-v2/service/route53 v1.42.3 h1:MmLCRqP4U4Cw9gJ4bNrCG0mWqEtBlmAVleyelcHARMU= +github.com/aws/aws-sdk-go-v2/service/route53 v1.42.3/go.mod h1:AMPjK2YnRh0YgOID3PqhJA1BRNfXDfGOnSsKHtAe8yA= github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.3 h1:EthA93BNgTnk36FoI9DCKtv4S0m63WzdGDYlBp/CvHQ= github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.3/go.mod h1:4xh/h0pevPhBkA4b2iYosZaqrThccxFREQxiGuZpJlc= github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 h1:BXx0ZIxvrJdSgSvKTZ+yRBeSqqgPM89VPlulEcl37tM= diff --git a/main.go b/main.go index e75b6795a..985124349 100644 --- a/main.go +++ b/main.go @@ -26,8 +26,8 @@ import ( "time" "github.com/aws/aws-sdk-go-v2/service/dynamodb" + "github.com/aws/aws-sdk-go-v2/service/route53" sd "github.com/aws/aws-sdk-go-v2/service/servicediscovery" - "github.com/aws/aws-sdk-go/service/route53" "github.com/go-logr/logr" "github.com/prometheus/client_golang/prometheus/promhttp" log "github.com/sirupsen/logrus" @@ -205,10 +205,10 @@ func main() { case "alibabacloud": p, err = alibabacloud.NewAlibabaCloudProvider(cfg.AlibabaCloudConfigFile, domainFilter, zoneIDFilter, cfg.AlibabaCloudZoneType, cfg.DryRun) case "aws": - sessions := aws.CreateSessions(cfg) - clients := make(map[string]aws.Route53API, len(sessions)) - for profile, session := range sessions { - clients[profile] = route53.New(session) + configs := aws.CreateV2Configs(cfg) + clients := make(map[string]aws.Route53API, len(configs)) + for profile, config := range configs { + clients[profile] = route53.NewFromConfig(config) } p, err = aws.NewAWSProvider( diff --git a/provider/aws/aws.go b/provider/aws/aws.go index 1955efb16..0e2926bf4 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -25,10 +25,9 @@ import ( "strings" "time" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/route53" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/route53" + route53types "github.com/aws/aws-sdk-go-v2/service/route53/types" log "github.com/sirupsen/logrus" "sigs.k8s.io/external-dns/endpoint" @@ -41,11 +40,11 @@ const ( recordTTL = 300 // From the experiments, it seems that the default MaxItems applied is 100, // and that, on the server side, there is a hard limit of 300 elements per page. - // After a discussion with AWS representants, clients should accept - // when less items are returned, and still paginate accordingly. + // After a discussion with AWS representatives, clients should accept + // when fewer items are returned, and still paginate accordingly. // As we are using the standard AWS client, this should already be compliant. - // Hence, ifever AWS decides to raise this limit, we will automatically reduce the pressure on rate limits - route53PageSize = "300" + // Hence, if AWS ever decides to raise this limit, we will automatically reduce the pressure on rate limits + route53PageSize int32 = 300 // providerSpecificAlias specifies whether a CNAME endpoint maps to an AWS ALIAS record. providerSpecificAlias = "alias" providerSpecificTargetHostedZone = "aws/target-hosted-zone" @@ -199,16 +198,16 @@ var canonicalHostedZones = map[string]string{ // Route53API is the subset of the AWS Route53 API that we actually use. Add methods as required. Signatures must match exactly. // mostly taken from: https://github.com/kubernetes/kubernetes/blob/853167624edb6bc0cfdcdfb88e746e178f5db36c/federation/pkg/dnsprovider/providers/aws/route53/stubs/route53api.go type Route53API interface { - ListResourceRecordSetsPagesWithContext(ctx context.Context, input *route53.ListResourceRecordSetsInput, fn func(resp *route53.ListResourceRecordSetsOutput, lastPage bool) (shouldContinue bool), opts ...request.Option) error - ChangeResourceRecordSetsWithContext(ctx context.Context, input *route53.ChangeResourceRecordSetsInput, opts ...request.Option) (*route53.ChangeResourceRecordSetsOutput, error) - CreateHostedZoneWithContext(ctx context.Context, input *route53.CreateHostedZoneInput, opts ...request.Option) (*route53.CreateHostedZoneOutput, error) - ListHostedZonesPagesWithContext(ctx context.Context, input *route53.ListHostedZonesInput, fn func(resp *route53.ListHostedZonesOutput, lastPage bool) (shouldContinue bool), opts ...request.Option) error - ListTagsForResourceWithContext(ctx context.Context, input *route53.ListTagsForResourceInput, opts ...request.Option) (*route53.ListTagsForResourceOutput, error) + ListResourceRecordSets(ctx context.Context, input *route53.ListResourceRecordSetsInput, optFns ...func(options *route53.Options)) (*route53.ListResourceRecordSetsOutput, error) + ChangeResourceRecordSets(ctx context.Context, input *route53.ChangeResourceRecordSetsInput, optFns ...func(options *route53.Options)) (*route53.ChangeResourceRecordSetsOutput, error) + CreateHostedZone(ctx context.Context, input *route53.CreateHostedZoneInput, optFns ...func(*route53.Options)) (*route53.CreateHostedZoneOutput, error) + ListHostedZones(ctx context.Context, input *route53.ListHostedZonesInput, optFns ...func(options *route53.Options)) (*route53.ListHostedZonesOutput, error) + ListTagsForResource(ctx context.Context, input *route53.ListTagsForResourceInput, optFns ...func(options *route53.Options)) (*route53.ListTagsForResourceOutput, error) } // wrapper to handle ownership relation throughout the provider implementation type Route53Change struct { - route53.Change + route53types.Change OwnedRecord string sizeBytes int sizeValues int @@ -218,13 +217,13 @@ type Route53Changes []*Route53Change type profiledZone struct { profile string - zone *route53.HostedZone + zone *route53types.HostedZone } -func (cs Route53Changes) Route53Changes() []*route53.Change { - ret := []*route53.Change{} +func (cs Route53Changes) Route53Changes() []route53types.Change { + ret := []route53types.Change{} for _, c := range cs { - ret = append(ret, &c.Change) + ret = append(ret, c.Change) } return ret } @@ -253,7 +252,7 @@ type AWSProvider struct { zoneTypeFilter provider.ZoneTypeFilter // filter hosted zones by tags zoneTagFilter provider.ZoneTagFilter - // extend filter for sub-domains in the zone (e.g. first.us-east-1.example.com) + // extend filter for subdomains in the zone (e.g. first.us-east-1.example.com) zoneMatchParent bool preferCNAME bool zonesCache *zonesListCache @@ -302,13 +301,13 @@ func NewAWSProvider(awsConfig AWSConfig, clients map[string]Route53API) (*AWSPro } // Zones returns the list of hosted zones. -func (p *AWSProvider) Zones(ctx context.Context) (map[string]*route53.HostedZone, error) { +func (p *AWSProvider) Zones(ctx context.Context) (map[string]*route53types.HostedZone, error) { zones, err := p.zones(ctx) if err != nil { return nil, err } - result := make(map[string]*route53.HostedZone, len(zones)) + result := make(map[string]*route53types.HostedZone, len(zones)) for id, zone := range zones { result[id] = zone.zone } @@ -324,61 +323,57 @@ func (p *AWSProvider) zones(ctx context.Context) (map[string]*profiledZone, erro log.Debug("Refreshing zones list cache") zones := make(map[string]*profiledZone) - var profile string - var tagErr error - f := func(resp *route53.ListHostedZonesOutput, lastPage bool) (shouldContinue bool) { - for _, zone := range resp.HostedZones { - if !p.zoneIDFilter.Match(aws.StringValue(zone.Id)) { - continue - } - if !p.zoneTypeFilter.Match(zone) { - continue - } + for profile, client := range p.clients { + var tagErr error + paginator := route53.NewListHostedZonesPaginator(client, &route53.ListHostedZonesInput{}) - if !p.domainFilter.Match(aws.StringValue(zone.Name)) { - if !p.zoneMatchParent { - continue - } - if !p.domainFilter.MatchParent(aws.StringValue(zone.Name)) { - continue - } - } - - // Only fetch tags if a tag filter was specified - if !p.zoneTagFilter.IsEmpty() { - tags, err := p.tagsForZone(ctx, *zone.Id, profile) - if err != nil { - tagErr = err - return false - } - if !p.zoneTagFilter.Match(tags) { - continue - } - } - - zones[aws.StringValue(zone.Id)] = &profiledZone{ - profile: profile, - zone: zone, - } - } - - return true - } - - for p, client := range p.clients { - profile = p - err := client.ListHostedZonesPagesWithContext(ctx, &route53.ListHostedZonesInput{}, f) - if err != nil { - var awsErr awserr.Error - if errors.As(err, &awsErr) { - if awsErr.Code() == route53.ErrCodeThrottlingException { - log.Warnf("Skipping AWS profile %q due to provider side throttling: %v", profile, awsErr.Message()) + for paginator.HasMorePages() { + resp, err := paginator.NextPage(ctx) + if err != nil { + var te *route53types.ThrottlingException + if errors.As(err, &te) { + log.Infof("Skipping AWS profile %q due to provider side throttling: %v", profile, te.ErrorMessage()) continue } // nothing to do here. Falling through to general error handling + return nil, provider.NewSoftError(fmt.Errorf("failed to list hosted zones: %w", err)) + } + for _, zone := range resp.HostedZones { + if !p.zoneIDFilter.Match(*zone.Id) { + continue + } + + if !p.zoneTypeFilter.Match(zone) { + continue + } + + if !p.domainFilter.Match(*zone.Name) { + if !p.zoneMatchParent { + continue + } + if !p.domainFilter.MatchParent(*zone.Name) { + continue + } + } + + // Only fetch tags if a tag filter was specified + if !p.zoneTagFilter.IsEmpty() { + tags, err := p.tagsForZone(ctx, *zone.Id, profile) + if err != nil { + tagErr = err + break + } + if !p.zoneTagFilter.Match(tags) { + continue + } + } + + zones[*zone.Id] = &profiledZone{ + profile: profile, + zone: &zone, + } } - return nil, provider.NewSoftError(fmt.Errorf("failed to list hosted zones: %w", err)) } if tagErr != nil { return nil, provider.NewSoftError(fmt.Errorf("failed to list zones tags: %w", tagErr)) @@ -386,7 +381,7 @@ func (p *AWSProvider) zones(ctx context.Context) (map[string]*profiledZone, erro } for _, zone := range zones { - log.Debugf("Considering zone: %s (domain: %s)", aws.StringValue(zone.zone.Id), aws.StringValue(zone.zone.Name)) + log.Debugf("Considering zone: %s (domain: %s)", *zone.zone.Id, *zone.zone.Name) } if p.zonesCache.duration > time.Duration(0) { @@ -415,92 +410,93 @@ func (p *AWSProvider) Records(ctx context.Context) (endpoints []*endpoint.Endpoi func (p *AWSProvider) records(ctx context.Context, zones map[string]*profiledZone) ([]*endpoint.Endpoint, error) { endpoints := make([]*endpoint.Endpoint, 0) - f := func(resp *route53.ListResourceRecordSetsOutput, lastPage bool) (shouldContinue bool) { - for _, r := range resp.ResourceRecordSets { - newEndpoints := make([]*endpoint.Endpoint, 0) - - if !p.SupportedRecordType(aws.StringValue(r.Type)) { - continue - } - - var ttl endpoint.TTL - if r.TTL != nil { - ttl = endpoint.TTL(*r.TTL) - } - - if len(r.ResourceRecords) > 0 { - targets := make([]string, len(r.ResourceRecords)) - for idx, rr := range r.ResourceRecords { - targets[idx] = aws.StringValue(rr.Value) - } - - ep := endpoint.NewEndpointWithTTL(wildcardUnescape(aws.StringValue(r.Name)), aws.StringValue(r.Type), ttl, targets...) - if aws.StringValue(r.Type) == endpoint.RecordTypeCNAME { - ep = ep.WithProviderSpecific(providerSpecificAlias, "false") - } - newEndpoints = append(newEndpoints, ep) - } - - if r.AliasTarget != nil { - // Alias records don't have TTLs so provide the default to match the TXT generation - if ttl == 0 { - ttl = recordTTL - } - ep := endpoint. - NewEndpointWithTTL(wildcardUnescape(aws.StringValue(r.Name)), endpoint.RecordTypeA, ttl, aws.StringValue(r.AliasTarget.DNSName)). - WithProviderSpecific(providerSpecificEvaluateTargetHealth, fmt.Sprintf("%t", aws.BoolValue(r.AliasTarget.EvaluateTargetHealth))). - WithProviderSpecific(providerSpecificAlias, "true") - newEndpoints = append(newEndpoints, ep) - } - - for _, ep := range newEndpoints { - if r.SetIdentifier != nil { - ep.SetIdentifier = aws.StringValue(r.SetIdentifier) - switch { - case r.Weight != nil: - ep.WithProviderSpecific(providerSpecificWeight, fmt.Sprintf("%d", aws.Int64Value(r.Weight))) - case r.Region != nil: - ep.WithProviderSpecific(providerSpecificRegion, aws.StringValue(r.Region)) - case r.Failover != nil: - ep.WithProviderSpecific(providerSpecificFailover, aws.StringValue(r.Failover)) - case r.MultiValueAnswer != nil && aws.BoolValue(r.MultiValueAnswer): - ep.WithProviderSpecific(providerSpecificMultiValueAnswer, "") - case r.GeoLocation != nil: - if r.GeoLocation.ContinentCode != nil { - ep.WithProviderSpecific(providerSpecificGeolocationContinentCode, aws.StringValue(r.GeoLocation.ContinentCode)) - } else { - if r.GeoLocation.CountryCode != nil { - ep.WithProviderSpecific(providerSpecificGeolocationCountryCode, aws.StringValue(r.GeoLocation.CountryCode)) - } - if r.GeoLocation.SubdivisionCode != nil { - ep.WithProviderSpecific(providerSpecificGeolocationSubdivisionCode, aws.StringValue(r.GeoLocation.SubdivisionCode)) - } - } - default: - // one of the above needs to be set, otherwise SetIdentifier doesn't make sense - } - } - - if r.HealthCheckId != nil { - ep.WithProviderSpecific(providerSpecificHealthCheckID, aws.StringValue(r.HealthCheckId)) - } - - endpoints = append(endpoints, ep) - } - } - - return true - } for _, z := range zones { - params := &route53.ListResourceRecordSetsInput{ - HostedZoneId: z.zone.Id, - MaxItems: aws.String(route53PageSize), - } - client := p.clients[z.profile] - if err := client.ListResourceRecordSetsPagesWithContext(ctx, params, f); err != nil { - return nil, fmt.Errorf("failed to list resource records sets for zone %s using aws profile %q: %w", *z.zone.Id, z.profile, err) + + paginator := route53.NewListResourceRecordSetsPaginator(client, &route53.ListResourceRecordSetsInput{ + HostedZoneId: z.zone.Id, + MaxItems: aws.Int32(route53PageSize), + }) + + for paginator.HasMorePages() { + resp, err := paginator.NextPage(ctx) + if err != nil { + return nil, fmt.Errorf("failed to list resource records sets for zone %s using aws profile %q: %w", *z.zone.Id, z.profile, err) + } + + for _, r := range resp.ResourceRecordSets { + newEndpoints := make([]*endpoint.Endpoint, 0) + + if !p.SupportedRecordType(r.Type) { + continue + } + + var ttl endpoint.TTL + if r.TTL != nil { + ttl = endpoint.TTL(*r.TTL) + } + + if len(r.ResourceRecords) > 0 { + targets := make([]string, len(r.ResourceRecords)) + for idx, rr := range r.ResourceRecords { + targets[idx] = *rr.Value + } + + ep := endpoint.NewEndpointWithTTL(wildcardUnescape(*r.Name), string(r.Type), ttl, targets...) + if r.Type == endpoint.RecordTypeCNAME { + ep = ep.WithProviderSpecific(providerSpecificAlias, "false") + } + newEndpoints = append(newEndpoints, ep) + } + + if r.AliasTarget != nil { + // Alias records don't have TTLs so provide the default to match the TXT generation + if ttl == 0 { + ttl = recordTTL + } + ep := endpoint. + NewEndpointWithTTL(wildcardUnescape(*r.Name), endpoint.RecordTypeA, ttl, *r.AliasTarget.DNSName). + WithProviderSpecific(providerSpecificEvaluateTargetHealth, fmt.Sprintf("%t", r.AliasTarget.EvaluateTargetHealth)). + WithProviderSpecific(providerSpecificAlias, "true") + newEndpoints = append(newEndpoints, ep) + } + + for _, ep := range newEndpoints { + if r.SetIdentifier != nil { + ep.SetIdentifier = *r.SetIdentifier + switch { + case r.Weight != nil: + ep.WithProviderSpecific(providerSpecificWeight, fmt.Sprintf("%d", *r.Weight)) + case r.Region != "": + ep.WithProviderSpecific(providerSpecificRegion, string(r.Region)) + case r.Failover != "": + ep.WithProviderSpecific(providerSpecificFailover, string(r.Failover)) + case r.MultiValueAnswer != nil && *r.MultiValueAnswer: + ep.WithProviderSpecific(providerSpecificMultiValueAnswer, "") + case r.GeoLocation != nil: + if r.GeoLocation.ContinentCode != nil { + ep.WithProviderSpecific(providerSpecificGeolocationContinentCode, *r.GeoLocation.ContinentCode) + } else { + if r.GeoLocation.CountryCode != nil { + ep.WithProviderSpecific(providerSpecificGeolocationCountryCode, *r.GeoLocation.CountryCode) + } + if r.GeoLocation.SubdivisionCode != nil { + ep.WithProviderSpecific(providerSpecificGeolocationSubdivisionCode, *r.GeoLocation.SubdivisionCode) + } + } + default: + // one of the above needs to be set, otherwise SetIdentifier doesn't make sense + } + } + + if r.HealthCheckId != nil { + ep.WithProviderSpecific(providerSpecificHealthCheckID, *r.HealthCheckId) + } + + endpoints = append(endpoints, ep) + } + } } } @@ -560,9 +556,9 @@ func (p *AWSProvider) createUpdateChanges(newEndpoints, oldEndpoints []*endpoint } combined := make(Route53Changes, 0, len(deletes)+len(creates)+len(updates)) - combined = append(combined, p.newChanges(route53.ChangeActionCreate, creates)...) - combined = append(combined, p.newChanges(route53.ChangeActionUpsert, updates)...) - combined = append(combined, p.newChanges(route53.ChangeActionDelete, deletes)...) + combined = append(combined, p.newChanges(route53types.ChangeActionCreate, creates)...) + combined = append(combined, p.newChanges(route53types.ChangeActionUpsert, updates)...) + combined = append(combined, p.newChanges(route53types.ChangeActionDelete, deletes)...) return combined } @@ -575,7 +571,7 @@ func (p *AWSProvider) GetDomainFilter() endpoint.DomainFilterInterface { } zoneNames := []string(nil) for _, z := range zones { - zoneNames = append(zoneNames, aws.StringValue(z.Name), "."+aws.StringValue(z.Name)) + zoneNames = append(zoneNames, *z.Name, "."+*z.Name) } log.Infof("Applying provider record filter for domains: %v", zoneNames) return endpoint.NewDomainFilter(zoneNames) @@ -591,8 +587,8 @@ func (p *AWSProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) e updateChanges := p.createUpdateChanges(changes.UpdateNew, changes.UpdateOld) combinedChanges := make(Route53Changes, 0, len(changes.Delete)+len(changes.Create)+len(updateChanges)) - combinedChanges = append(combinedChanges, p.newChanges(route53.ChangeActionCreate, changes.Create)...) - combinedChanges = append(combinedChanges, p.newChanges(route53.ChangeActionDelete, changes.Delete)...) + combinedChanges = append(combinedChanges, p.newChanges(route53types.ChangeActionCreate, changes.Create)...) + combinedChanges = append(combinedChanges, p.newChanges(route53types.ChangeActionDelete, changes.Delete)...) combinedChanges = append(combinedChanges, updateChanges...) return p.submitChanges(ctx, combinedChanges, zones) @@ -615,7 +611,7 @@ func (p *AWSProvider) submitChanges(ctx context.Context, changes Route53Changes, var failedZones []string for z, cs := range changesByZone { log := log.WithFields(log.Fields{ - "zoneName": aws.StringValue(zones[z].zone.Name), + "zoneName": *zones[z].zone.Name, "zoneID": z, "profile": zones[z].profile, }) @@ -634,13 +630,13 @@ func (p *AWSProvider) submitChanges(ctx context.Context, changes Route53Changes, } for _, c := range b { - log.Infof("Desired change: %s %s %s", *c.Action, *c.ResourceRecordSet.Name, *c.ResourceRecordSet.Type) + log.Infof("Desired change: %s %s %s", c.Action, *c.ResourceRecordSet.Name, c.ResourceRecordSet.Type) } if !p.dryRun { params := &route53.ChangeResourceRecordSetsInput{ HostedZoneId: aws.String(z), - ChangeBatch: &route53.ChangeBatch{ + ChangeBatch: &route53types.ChangeBatch{ Changes: b.Route53Changes(), }, } @@ -648,8 +644,8 @@ func (p *AWSProvider) submitChanges(ctx context.Context, changes Route53Changes, successfulChanges := 0 client := p.clients[zones[z].profile] - if _, err := client.ChangeResourceRecordSetsWithContext(ctx, params); err != nil { - log.Errorf("Failure in zone %s when submitting change batch: %v", aws.StringValue(zones[z].zone.Name), err) + if _, err := client.ChangeResourceRecordSets(ctx, params); err != nil { + log.Errorf("Failure in zone %s when submitting change batch: %v", *zones[z].zone.Name, err) changesByOwnership := groupChangesByNameAndOwnershipRelation(b) @@ -658,12 +654,12 @@ func (p *AWSProvider) submitChanges(ctx context.Context, changes Route53Changes, for _, changes := range changesByOwnership { for _, c := range changes { - log.Debugf("Desired change: %s %s %s", *c.Action, *c.ResourceRecordSet.Name, *c.ResourceRecordSet.Type) + log.Debugf("Desired change: %s %s %s", c.Action, *c.ResourceRecordSet.Name, c.ResourceRecordSet.Type) } - params.ChangeBatch = &route53.ChangeBatch{ + params.ChangeBatch = &route53types.ChangeBatch{ Changes: changes.Route53Changes(), } - if _, err := client.ChangeResourceRecordSetsWithContext(ctx, params); err != nil { + if _, err := client.ChangeResourceRecordSets(ctx, params); err != nil { failedUpdate = true log.Errorf("Failed submitting change (error: %v), it will be retried in a separate change batch in the next iteration", err) p.failedChangesQueue[z] = append(p.failedChangesQueue[z], changes...) @@ -702,7 +698,7 @@ func (p *AWSProvider) submitChanges(ctx context.Context, changes Route53Changes, } // newChanges returns a collection of Changes based on the given records and action. -func (p *AWSProvider) newChanges(action string, endpoints []*endpoint.Endpoint) Route53Changes { +func (p *AWSProvider) newChanges(action route53types.ChangeAction, endpoints []*endpoint.Endpoint) Route53Changes { changes := make(Route53Changes, 0, len(endpoints)) for _, endpoint := range endpoints { @@ -711,8 +707,10 @@ func (p *AWSProvider) newChanges(action string, endpoints []*endpoint.Endpoint) if dualstack { // make a copy of change, modify RRS type to AAAA, then add new change rrs := *change.ResourceRecordSet - change2 := &Route53Change{Change: route53.Change{Action: change.Action, ResourceRecordSet: &rrs}} - change2.ResourceRecordSet.Type = aws.String(route53.RRTypeAaaa) + change2 := &Route53Change{ + Change: route53types.Change{Action: change.Action, ResourceRecordSet: &rrs}, + } + change2.ResourceRecordSet.Type = route53types.RRTypeAaaa changes = append(changes, change2) } } @@ -774,11 +772,11 @@ func (p *AWSProvider) AdjustEndpoints(endpoints []*endpoint.Endpoint) ([]*endpoi // returned Change is based on the given record by the given action, e.g. // action=ChangeActionCreate returns a change for creation of the record and // action=ChangeActionDelete returns a change for deletion of the record. -func (p *AWSProvider) newChange(action string, ep *endpoint.Endpoint) (*Route53Change, bool) { +func (p *AWSProvider) newChange(action route53types.ChangeAction, ep *endpoint.Endpoint) (*Route53Change, bool) { change := &Route53Change{ - Change: route53.Change{ - Action: aws.String(action), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: action, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(ep.DNSName), }, }, @@ -793,24 +791,24 @@ func (p *AWSProvider) newChange(action string, ep *endpoint.Endpoint) (*Route53C if val, ok := ep.Labels[endpoint.DualstackLabelKey]; ok { dualstack = val == "true" } - change.ResourceRecordSet.Type = aws.String(route53.RRTypeA) - change.ResourceRecordSet.AliasTarget = &route53.AliasTarget{ + change.ResourceRecordSet.Type = route53types.RRTypeA + change.ResourceRecordSet.AliasTarget = &route53types.AliasTarget{ DNSName: aws.String(ep.Targets[0]), HostedZoneId: aws.String(cleanZoneID(targetHostedZone)), - EvaluateTargetHealth: aws.Bool(evalTargetHealth), + EvaluateTargetHealth: evalTargetHealth, } change.sizeBytes += len([]byte(ep.Targets[0])) change.sizeValues += 1 } else { - change.ResourceRecordSet.Type = aws.String(ep.RecordType) + change.ResourceRecordSet.Type = route53types.RRType(ep.RecordType) if !ep.RecordTTL.IsConfigured() { change.ResourceRecordSet.TTL = aws.Int64(recordTTL) } else { change.ResourceRecordSet.TTL = aws.Int64(int64(ep.RecordTTL)) } - change.ResourceRecordSet.ResourceRecords = make([]*route53.ResourceRecord, len(ep.Targets)) + change.ResourceRecordSet.ResourceRecords = make([]route53types.ResourceRecord, len(ep.Targets)) for idx, val := range ep.Targets { - change.ResourceRecordSet.ResourceRecords[idx] = &route53.ResourceRecord{ + change.ResourceRecordSet.ResourceRecords[idx] = route53types.ResourceRecord{ Value: aws.String(val), } change.sizeBytes += len([]byte(val)) @@ -818,7 +816,7 @@ func (p *AWSProvider) newChange(action string, ep *endpoint.Endpoint) (*Route53C } } - if action == route53.ChangeActionUpsert { + if action == route53types.ChangeActionUpsert { // If the value of the Action element is UPSERT, each ResourceRecord element and each character in a Value // element is counted twice change.sizeBytes *= 2 @@ -837,16 +835,16 @@ func (p *AWSProvider) newChange(action string, ep *endpoint.Endpoint) (*Route53C change.ResourceRecordSet.Weight = aws.Int64(weight) } if prop, ok := ep.GetProviderSpecificProperty(providerSpecificRegion); ok { - change.ResourceRecordSet.Region = aws.String(prop) + change.ResourceRecordSet.Region = route53types.ResourceRecordSetRegion(prop) } if prop, ok := ep.GetProviderSpecificProperty(providerSpecificFailover); ok { - change.ResourceRecordSet.Failover = aws.String(prop) + change.ResourceRecordSet.Failover = route53types.ResourceRecordSetFailover(prop) } if _, ok := ep.GetProviderSpecificProperty(providerSpecificMultiValueAnswer); ok { change.ResourceRecordSet.MultiValueAnswer = aws.Bool(true) } - geolocation := &route53.GeoLocation{} + geolocation := &route53types.GeoLocation{} useGeolocation := false if prop, ok := ep.GetProviderSpecificProperty(providerSpecificGeolocationContinentCode); ok { geolocation.ContinentCode = aws.String(prop) @@ -908,7 +906,7 @@ func groupChangesByNameAndOwnershipRelation(cs Route53Changes) map[string]Route5 for _, v := range cs { key := v.OwnedRecord if key == "" { - key = aws.StringValue(v.ResourceRecordSet.Name) + key = *v.ResourceRecordSet.Name } changesByOwnership[key] = append(changesByOwnership[key], v) } @@ -918,8 +916,8 @@ func groupChangesByNameAndOwnershipRelation(cs Route53Changes) map[string]Route5 func (p *AWSProvider) tagsForZone(ctx context.Context, zoneID string, profile string) (map[string]string, error) { client := p.clients[profile] - response, err := client.ListTagsForResourceWithContext(ctx, &route53.ListTagsForResourceInput{ - ResourceType: aws.String("hostedzone"), + response, err := client.ListTagsForResource(ctx, &route53.ListTagsForResourceInput{ + ResourceType: route53types.TagResourceTypeHostedzone, ResourceId: aws.String(zoneID), }) if err != nil { @@ -1006,10 +1004,10 @@ func batchChangeSet(cs Route53Changes, batchSize int, batchSizeBytes int, batchS func sortChangesByActionNameType(cs Route53Changes) Route53Changes { sort.SliceStable(cs, func(i, j int) bool { - if *cs[i].Action > *cs[j].Action { + if cs[i].Action > cs[j].Action { return true } - if *cs[i].Action < *cs[j].Action { + if cs[i].Action < cs[j].Action { return false } if *cs[i].ResourceRecordSet.Name < *cs[j].ResourceRecordSet.Name { @@ -1018,7 +1016,7 @@ func sortChangesByActionNameType(cs Route53Changes) Route53Changes { if *cs[i].ResourceRecordSet.Name > *cs[j].ResourceRecordSet.Name { return false } - return *cs[i].ResourceRecordSet.Type < *cs[j].ResourceRecordSet.Type + return cs[i].ResourceRecordSet.Type < cs[j].ResourceRecordSet.Type }) return cs @@ -1029,34 +1027,34 @@ func changesByZone(zones map[string]*profiledZone, changeSet Route53Changes) map changes := make(map[string]Route53Changes) for _, z := range zones { - changes[aws.StringValue(z.zone.Id)] = Route53Changes{} + changes[*z.zone.Id] = Route53Changes{} } for _, c := range changeSet { - hostname := provider.EnsureTrailingDot(aws.StringValue(c.ResourceRecordSet.Name)) + hostname := provider.EnsureTrailingDot(*c.ResourceRecordSet.Name) zones := suitableZones(hostname, zones) if len(zones) == 0 { - log.Debugf("Skipping record %s because no hosted zone matching record DNS Name was detected", c.String()) + log.Debugf("Skipping record %s because no hosted zone matching record DNS Name was detected", *c.ResourceRecordSet.Name) continue } for _, z := range zones { - if c.ResourceRecordSet.AliasTarget != nil && aws.StringValue(c.ResourceRecordSet.AliasTarget.HostedZoneId) == sameZoneAlias { + if c.ResourceRecordSet.AliasTarget != nil && *c.ResourceRecordSet.AliasTarget.HostedZoneId == sameZoneAlias { // alias record is to be created; target needs to be in the same zone as endpoint // if it's not, this will fail rrset := *c.ResourceRecordSet aliasTarget := *rrset.AliasTarget - aliasTarget.HostedZoneId = aws.String(cleanZoneID(aws.StringValue(z.zone.Id))) + aliasTarget.HostedZoneId = aws.String(cleanZoneID(*z.zone.Id)) rrset.AliasTarget = &aliasTarget c = &Route53Change{ - Change: route53.Change{ + Change: route53types.Change{ Action: c.Action, ResourceRecordSet: &rrset, }, } } - changes[aws.StringValue(z.zone.Id)] = append(changes[aws.StringValue(z.zone.Id)], c) - log.Debugf("Adding %s to zone %s [Id: %s]", hostname, aws.StringValue(z.zone.Name), aws.StringValue(z.zone.Id)) + changes[*z.zone.Id] = append(changes[*z.zone.Id], c) + log.Debugf("Adding %s to zone %s [Id: %s]", hostname, *z.zone.Name, *z.zone.Id) } } @@ -1078,10 +1076,10 @@ func suitableZones(hostname string, zones map[string]*profiledZone) []*profiledZ var publicZone *profiledZone for _, z := range zones { - if aws.StringValue(z.zone.Name) == hostname || strings.HasSuffix(hostname, "."+aws.StringValue(z.zone.Name)) { - if z.zone.Config == nil || !aws.BoolValue(z.zone.Config.PrivateZone) { + if *z.zone.Name == hostname || strings.HasSuffix(hostname, "."+*z.zone.Name) { + if z.zone.Config == nil || !z.zone.Config.PrivateZone { // Only select the best matching public zone - if publicZone == nil || len(aws.StringValue(z.zone.Name)) > len(aws.StringValue(publicZone.zone.Name)) { + if publicZone == nil || len(*z.zone.Name) > len(*publicZone.zone.Name) { publicZone = z } } else { @@ -1156,11 +1154,11 @@ func cleanZoneID(id string) string { return strings.TrimPrefix(id, "/hostedzone/") } -func (p *AWSProvider) SupportedRecordType(recordType string) bool { +func (p *AWSProvider) SupportedRecordType(recordType route53types.RRType) bool { switch recordType { - case "MX": + case route53types.RRTypeMx: return true default: - return provider.SupportedRecordType(recordType) + return provider.SupportedRecordType(string(recordType)) } } diff --git a/provider/aws/aws_test.go b/provider/aws/aws_test.go index 6968e7c76..806ed1d5c 100644 --- a/provider/aws/aws_test.go +++ b/provider/aws/aws_test.go @@ -26,9 +26,9 @@ import ( "testing" "time" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/route53" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/route53" + route53types "github.com/aws/aws-sdk-go-v2/service/route53/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" @@ -55,9 +55,9 @@ var _ Route53API = &Route53APIStub{} // of all of its methods. // mostly taken from: https://github.com/kubernetes/kubernetes/blob/853167624edb6bc0cfdcdfb88e746e178f5db36c/federation/pkg/dnsprovider/providers/aws/route53/stubs/route53api.go type Route53APIStub struct { - zones map[string]*route53.HostedZone - recordSets map[string]map[string][]*route53.ResourceRecordSet - zoneTags map[string][]*route53.Tag + zones map[string]*route53types.HostedZone + recordSets map[string]map[string][]route53types.ResourceRecordSet + zoneTags map[string][]route53types.Tag m dynamicMock t *testing.T } @@ -73,29 +73,27 @@ func (r *Route53APIStub) MockMethod(method string, args ...interface{}) *mock.Ca // NewRoute53APIStub returns an initialized Route53APIStub func NewRoute53APIStub(t *testing.T) *Route53APIStub { return &Route53APIStub{ - zones: make(map[string]*route53.HostedZone), - recordSets: make(map[string]map[string][]*route53.ResourceRecordSet), - zoneTags: make(map[string][]*route53.Tag), + zones: make(map[string]*route53types.HostedZone), + recordSets: make(map[string]map[string][]route53types.ResourceRecordSet), + zoneTags: make(map[string][]route53types.Tag), t: t, } } -func (r *Route53APIStub) ListResourceRecordSetsPagesWithContext(ctx context.Context, input *route53.ListResourceRecordSetsInput, fn func(p *route53.ListResourceRecordSetsOutput, lastPage bool) (shouldContinue bool), opts ...request.Option) error { - output := route53.ListResourceRecordSetsOutput{} // TODO: Support optional input args. +func (r *Route53APIStub) ListResourceRecordSets(ctx context.Context, input *route53.ListResourceRecordSetsInput, optFns ...func(options *route53.Options)) (*route53.ListResourceRecordSetsOutput, error) { + output := &route53.ListResourceRecordSetsOutput{} // TODO: Support optional input args. require.NotNil(r.t, input.MaxItems) assert.EqualValues(r.t, route53PageSize, *input.MaxItems) if len(r.recordSets) == 0 { - output.ResourceRecordSets = []*route53.ResourceRecordSet{} - } else if _, ok := r.recordSets[aws.StringValue(input.HostedZoneId)]; !ok { - output.ResourceRecordSets = []*route53.ResourceRecordSet{} + output.ResourceRecordSets = []route53types.ResourceRecordSet{} + } else if _, ok := r.recordSets[*input.HostedZoneId]; !ok { + output.ResourceRecordSets = []route53types.ResourceRecordSet{} } else { - for _, rrsets := range r.recordSets[aws.StringValue(input.HostedZoneId)] { + for _, rrsets := range r.recordSets[*input.HostedZoneId] { output.ResourceRecordSets = append(output.ResourceRecordSets, rrsets...) } } - lastPage := true - fn(&output, lastPage) - return nil + return output, nil } type Route53APICounter struct { @@ -110,29 +108,29 @@ func NewRoute53APICounter(w Route53API) *Route53APICounter { } } -func (c *Route53APICounter) ListResourceRecordSetsPagesWithContext(ctx context.Context, input *route53.ListResourceRecordSetsInput, fn func(resp *route53.ListResourceRecordSetsOutput, lastPage bool) (shouldContinue bool), opts ...request.Option) error { +func (c *Route53APICounter) ListResourceRecordSets(ctx context.Context, input *route53.ListResourceRecordSetsInput, optFns ...func(options *route53.Options)) (*route53.ListResourceRecordSetsOutput, error) { c.calls["ListResourceRecordSetsPages"]++ - return c.wrapped.ListResourceRecordSetsPagesWithContext(ctx, input, fn) + return c.wrapped.ListResourceRecordSets(ctx, input, optFns...) } -func (c *Route53APICounter) ChangeResourceRecordSetsWithContext(ctx context.Context, input *route53.ChangeResourceRecordSetsInput, opts ...request.Option) (*route53.ChangeResourceRecordSetsOutput, error) { +func (c *Route53APICounter) ChangeResourceRecordSets(ctx context.Context, input *route53.ChangeResourceRecordSetsInput, optFns ...func(*route53.Options)) (*route53.ChangeResourceRecordSetsOutput, error) { c.calls["ChangeResourceRecordSets"]++ - return c.wrapped.ChangeResourceRecordSetsWithContext(ctx, input) + return c.wrapped.ChangeResourceRecordSets(ctx, input, optFns...) } -func (c *Route53APICounter) CreateHostedZoneWithContext(ctx context.Context, input *route53.CreateHostedZoneInput, opts ...request.Option) (*route53.CreateHostedZoneOutput, error) { +func (c *Route53APICounter) CreateHostedZone(ctx context.Context, input *route53.CreateHostedZoneInput, optFns ...func(*route53.Options)) (*route53.CreateHostedZoneOutput, error) { c.calls["CreateHostedZone"]++ - return c.wrapped.CreateHostedZoneWithContext(ctx, input) + return c.wrapped.CreateHostedZone(ctx, input, optFns...) } -func (c *Route53APICounter) ListHostedZonesPagesWithContext(ctx context.Context, input *route53.ListHostedZonesInput, fn func(resp *route53.ListHostedZonesOutput, lastPage bool) (shouldContinue bool), opts ...request.Option) error { +func (c *Route53APICounter) ListHostedZones(ctx context.Context, input *route53.ListHostedZonesInput, optFns ...func(options *route53.Options)) (*route53.ListHostedZonesOutput, error) { c.calls["ListHostedZonesPages"]++ - return c.wrapped.ListHostedZonesPagesWithContext(ctx, input, fn) + return c.wrapped.ListHostedZones(ctx, input, optFns...) } -func (c *Route53APICounter) ListTagsForResourceWithContext(ctx context.Context, input *route53.ListTagsForResourceInput, opts ...request.Option) (*route53.ListTagsForResourceOutput, error) { +func (c *Route53APICounter) ListTagsForResource(ctx context.Context, input *route53.ListTagsForResourceInput, optFns ...func(options *route53.Options)) (*route53.ListTagsForResourceOutput, error) { c.calls["ListTagsForResource"]++ - return c.wrapped.ListTagsForResourceWithContext(ctx, input) + return c.wrapped.ListTagsForResource(ctx, input, optFns...) } // Route53 stores wildcards escaped: http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html?shortFooter=true#domain-name-format-asterisk @@ -143,11 +141,11 @@ func wildcardEscape(s string) string { return s } -func (r *Route53APIStub) ListTagsForResourceWithContext(ctx context.Context, input *route53.ListTagsForResourceInput, opts ...request.Option) (*route53.ListTagsForResourceOutput, error) { - if aws.StringValue(input.ResourceType) == "hostedzone" { - tags := r.zoneTags[aws.StringValue(input.ResourceId)] +func (r *Route53APIStub) ListTagsForResource(ctx context.Context, input *route53.ListTagsForResourceInput, optFns ...func(options *route53.Options)) (*route53.ListTagsForResourceOutput, error) { + if input.ResourceType == route53types.TagResourceTypeHostedzone { + tags := r.zoneTags[*input.ResourceId] return &route53.ListTagsForResourceOutput{ - ResourceTagSet: &route53.ResourceTagSet{ + ResourceTagSet: &route53types.ResourceTagSet{ ResourceId: input.ResourceId, ResourceType: input.ResourceType, Tags: tags, @@ -157,14 +155,14 @@ func (r *Route53APIStub) ListTagsForResourceWithContext(ctx context.Context, inp return &route53.ListTagsForResourceOutput{}, nil } -func (r *Route53APIStub) ChangeResourceRecordSetsWithContext(ctx context.Context, input *route53.ChangeResourceRecordSetsInput, opts ...request.Option) (*route53.ChangeResourceRecordSetsOutput, error) { +func (r *Route53APIStub) ChangeResourceRecordSets(ctx context.Context, input *route53.ChangeResourceRecordSetsInput, optFns ...func(options *route53.Options)) (*route53.ChangeResourceRecordSetsOutput, error) { if r.m.isMocked("ChangeResourceRecordSets", input) { return r.m.ChangeResourceRecordSets(input) } - _, ok := r.zones[aws.StringValue(input.HostedZoneId)] + _, ok := r.zones[*input.HostedZoneId] if !ok { - return nil, fmt.Errorf("Hosted zone doesn't exist: %s", aws.StringValue(input.HostedZoneId)) + return nil, fmt.Errorf("Hosted zone doesn't exist: %s", *input.HostedZoneId) } if len(input.ChangeBatch.Changes) == 0 { @@ -172,67 +170,65 @@ func (r *Route53APIStub) ChangeResourceRecordSetsWithContext(ctx context.Context } output := &route53.ChangeResourceRecordSetsOutput{} - recordSets, ok := r.recordSets[aws.StringValue(input.HostedZoneId)] + recordSets, ok := r.recordSets[*input.HostedZoneId] if !ok { - recordSets = make(map[string][]*route53.ResourceRecordSet) + recordSets = make(map[string][]route53types.ResourceRecordSet) } for _, change := range input.ChangeBatch.Changes { - if aws.StringValue(change.ResourceRecordSet.Type) == route53.RRTypeA { + if change.ResourceRecordSet.Type == route53types.RRTypeA { for _, rrs := range change.ResourceRecordSet.ResourceRecords { - if net.ParseIP(aws.StringValue(rrs.Value)) == nil { + if net.ParseIP(*rrs.Value) == nil { return nil, fmt.Errorf("A records must point to IPs") } } } - change.ResourceRecordSet.Name = aws.String(wildcardEscape(provider.EnsureTrailingDot(aws.StringValue(change.ResourceRecordSet.Name)))) + change.ResourceRecordSet.Name = aws.String(wildcardEscape(provider.EnsureTrailingDot(*change.ResourceRecordSet.Name))) if change.ResourceRecordSet.AliasTarget != nil { - change.ResourceRecordSet.AliasTarget.DNSName = aws.String(wildcardEscape(provider.EnsureTrailingDot(aws.StringValue(change.ResourceRecordSet.AliasTarget.DNSName)))) + change.ResourceRecordSet.AliasTarget.DNSName = aws.String(wildcardEscape(provider.EnsureTrailingDot(*change.ResourceRecordSet.AliasTarget.DNSName))) } setID := "" if change.ResourceRecordSet.SetIdentifier != nil { - setID = aws.StringValue(change.ResourceRecordSet.SetIdentifier) + setID = *change.ResourceRecordSet.SetIdentifier } - key := aws.StringValue(change.ResourceRecordSet.Name) + "::" + aws.StringValue(change.ResourceRecordSet.Type) + "::" + setID - switch aws.StringValue(change.Action) { - case route53.ChangeActionCreate: + key := *change.ResourceRecordSet.Name + "::" + string(change.ResourceRecordSet.Type) + "::" + setID + switch change.Action { + case route53types.ChangeActionCreate: if _, found := recordSets[key]; found { return nil, fmt.Errorf("Attempt to create duplicate rrset %s", key) // TODO: Return AWS errors with codes etc } - recordSets[key] = append(recordSets[key], change.ResourceRecordSet) - case route53.ChangeActionDelete: + recordSets[key] = append(recordSets[key], *change.ResourceRecordSet) + case route53types.ChangeActionDelete: if _, found := recordSets[key]; !found { return nil, fmt.Errorf("Attempt to delete non-existent rrset %s", key) // TODO: Check other fields too } delete(recordSets, key) - case route53.ChangeActionUpsert: - recordSets[key] = []*route53.ResourceRecordSet{change.ResourceRecordSet} + case route53types.ChangeActionUpsert: + recordSets[key] = []route53types.ResourceRecordSet{*change.ResourceRecordSet} } } - r.recordSets[aws.StringValue(input.HostedZoneId)] = recordSets + r.recordSets[*input.HostedZoneId] = recordSets return output, nil // TODO: We should ideally return status etc, but we don't' use that yet. } -func (r *Route53APIStub) ListHostedZonesPagesWithContext(ctx context.Context, input *route53.ListHostedZonesInput, fn func(p *route53.ListHostedZonesOutput, lastPage bool) (shouldContinue bool), opts ...request.Option) error { +func (r *Route53APIStub) ListHostedZones(ctx context.Context, input *route53.ListHostedZonesInput, optFns ...func(options *route53.Options)) (*route53.ListHostedZonesOutput, error) { output := &route53.ListHostedZonesOutput{} for _, zone := range r.zones { - output.HostedZones = append(output.HostedZones, zone) + output.HostedZones = append(output.HostedZones, *zone) } - lastPage := true - fn(output, lastPage) - return nil + return output, nil } -func (r *Route53APIStub) CreateHostedZoneWithContext(ctx context.Context, input *route53.CreateHostedZoneInput, opts ...request.Option) (*route53.CreateHostedZoneOutput, error) { - name := aws.StringValue(input.Name) +func (r *Route53APIStub) CreateHostedZone(ctx context.Context, input *route53.CreateHostedZoneInput, optFns ...func(options *route53.Options)) (*route53.CreateHostedZoneOutput, error) { + name := *input.Name id := "/hostedzone/" + name if _, ok := r.zones[id]; ok { return nil, fmt.Errorf("Error creating hosted DNS zone: %s already exists", id) } - r.zones[id] = &route53.HostedZone{ + r.zones[id] = &route53types.HostedZone{ Id: aws.String(id), Name: aws.String(name), Config: input.HostedZoneConfig, @@ -265,7 +261,7 @@ func (m *dynamicMock) isMocked(method string, arguments ...interface{}) bool { } func TestAWSZones(t *testing.T) { - publicZones := map[string]*route53.HostedZone{ + publicZones := map[string]*route53types.HostedZone{ "/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do.": { Id: aws.String("/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do."), Name: aws.String("zone-1.ext-dns-test-2.teapot.zalan.do."), @@ -276,14 +272,14 @@ func TestAWSZones(t *testing.T) { }, } - privateZones := map[string]*route53.HostedZone{ + privateZones := map[string]*route53types.HostedZone{ "/hostedzone/zone-3.ext-dns-test-2.teapot.zalan.do.": { Id: aws.String("/hostedzone/zone-3.ext-dns-test-2.teapot.zalan.do."), Name: aws.String("zone-3.ext-dns-test-2.teapot.zalan.do."), }, } - allZones := map[string]*route53.HostedZone{} + allZones := map[string]*route53types.HostedZone{} for k, v := range publicZones { allZones[k] = v } @@ -291,14 +287,14 @@ func TestAWSZones(t *testing.T) { allZones[k] = v } - noZones := map[string]*route53.HostedZone{} + noZones := map[string]*route53types.HostedZone{} for _, ti := range []struct { msg string zoneIDFilter provider.ZoneIDFilter zoneTypeFilter provider.ZoneTypeFilter zoneTagFilter provider.ZoneTagFilter - expectedZones map[string]*route53.HostedZone + expectedZones map[string]*route53types.HostedZone }{ {"no filter", provider.NewZoneIDFilter([]string{}), provider.NewZoneTypeFilter(""), provider.NewZoneTagFilter([]string{}), allZones}, {"public filter", provider.NewZoneIDFilter([]string{}), provider.NewZoneTypeFilter("public"), provider.NewZoneTagFilter([]string{}), publicZones}, @@ -307,12 +303,14 @@ func TestAWSZones(t *testing.T) { {"zone id filter", provider.NewZoneIDFilter([]string{"/hostedzone/zone-3.ext-dns-test-2.teapot.zalan.do."}), provider.NewZoneTypeFilter(""), provider.NewZoneTagFilter([]string{}), privateZones}, {"tag filter", provider.NewZoneIDFilter([]string{}), provider.NewZoneTypeFilter(""), provider.NewZoneTagFilter([]string{"zone=3"}), privateZones}, } { - provider, _ := newAWSProviderWithTagFilter(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.teapot.zalan.do."}), ti.zoneIDFilter, ti.zoneTypeFilter, ti.zoneTagFilter, defaultEvaluateTargetHealth, false, nil) + t.Run(ti.msg, func(t *testing.T) { + provider, _ := newAWSProviderWithTagFilter(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.teapot.zalan.do."}), ti.zoneIDFilter, ti.zoneTypeFilter, ti.zoneTagFilter, defaultEvaluateTargetHealth, false, nil) - zones, err := provider.Zones(context.Background()) - require.NoError(t, err) + zones, err := provider.Zones(context.Background()) + require.NoError(t, err) - validateAWSZones(t, zones, ti.expectedZones) + validateAWSZones(t, zones, ti.expectedZones) + }) } } @@ -340,157 +338,157 @@ func TestAWSRecordsFilter(t *testing.T) { } func TestAWSRecords(t *testing.T) { - provider, _ := newAWSProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.teapot.zalan.do."}), provider.NewZoneIDFilter([]string{}), provider.NewZoneTypeFilter(""), false, false, []*route53.ResourceRecordSet{ + provider, _ := newAWSProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.teapot.zalan.do."}), provider.NewZoneIDFilter([]string{}), provider.NewZoneTypeFilter(""), false, false, []route53types.ResourceRecordSet{ { Name: aws.String("list-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, }, { Name: aws.String("list-test.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { Name: aws.String("*.wildcard-test.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { Name: aws.String("list-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), - AliasTarget: &route53.AliasTarget{ + Type: route53types.RRTypeA, + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("foo.eu-central-1.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(false), + EvaluateTargetHealth: false, HostedZoneId: aws.String("Z215JYRZR1TBD5"), }, }, { Name: aws.String("*.wildcard-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), - AliasTarget: &route53.AliasTarget{ + Type: route53types.RRTypeA, + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("foo.eu-central-1.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(false), + EvaluateTargetHealth: false, HostedZoneId: aws.String("Z215JYRZR1TBD5"), }, }, { Name: aws.String("list-test-alias-evaluate.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), - AliasTarget: &route53.AliasTarget{ + Type: route53types.RRTypeA, + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("foo.eu-central-1.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(true), + EvaluateTargetHealth: true, HostedZoneId: aws.String("Z215JYRZR1TBD5"), }, }, { Name: aws.String("list-test-multiple.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("prefix-*.wildcard.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeTxt), + Type: route53types.RRTypeTxt, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("random")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("random")}}, }, { Name: aws.String("weight-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("test-set-1"), Weight: aws.Int64(10), }, { Name: aws.String("weight-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("4.3.2.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("4.3.2.1")}}, SetIdentifier: aws.String("test-set-2"), Weight: aws.Int64(20), }, { Name: aws.String("latency-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("test-set"), - Region: aws.String("us-east-1"), + Region: route53types.ResourceRecordSetRegionUsEast1, }, { Name: aws.String("failover-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("test-set"), - Failover: aws.String("PRIMARY"), + Failover: route53types.ResourceRecordSetFailoverPrimary, }, { Name: aws.String("multi-value-answer-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("test-set"), MultiValueAnswer: aws.Bool(true), }, { Name: aws.String("geolocation-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("test-set-1"), - GeoLocation: &route53.GeoLocation{ + GeoLocation: &route53types.GeoLocation{ ContinentCode: aws.String("EU"), }, }, { Name: aws.String("geolocation-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("4.3.2.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("4.3.2.1")}}, SetIdentifier: aws.String("test-set-2"), - GeoLocation: &route53.GeoLocation{ + GeoLocation: &route53types.GeoLocation{ CountryCode: aws.String("DE"), }, }, { Name: aws.String("geolocation-subdivision-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("test-set-1"), - GeoLocation: &route53.GeoLocation{ + GeoLocation: &route53types.GeoLocation{ SubdivisionCode: aws.String("NY"), }, }, { Name: aws.String("healthcheck-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("foo.example.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("foo.example.com")}}, SetIdentifier: aws.String("test-set-1"), HealthCheckId: aws.String("foo-bar-healthcheck-id"), Weight: aws.Int64(10), }, { Name: aws.String("healthcheck-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("4.3.2.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("4.3.2.1")}}, SetIdentifier: aws.String("test-set-2"), HealthCheckId: aws.String("abc-def-healthcheck-id"), Weight: aws.Int64(20), }, { Name: aws.String("mail.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeMx), + Type: route53types.RRTypeMx, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("10 mailhost1.example.com")}, {Value: aws.String("20 mailhost2.example.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("10 mailhost1.example.com")}, {Value: aws.String("20 mailhost2.example.com")}}, }, }) @@ -563,131 +561,131 @@ func TestAWSApplyChanges(t *testing.T) { } for _, tt := range tests { - provider, _ := newAWSProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.teapot.zalan.do."}), provider.NewZoneIDFilter([]string{}), provider.NewZoneTypeFilter(""), defaultEvaluateTargetHealth, false, []*route53.ResourceRecordSet{ + provider, _ := newAWSProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.teapot.zalan.do."}), provider.NewZoneIDFilter([]string{}), provider.NewZoneTypeFilter(""), defaultEvaluateTargetHealth, false, []route53types.ResourceRecordSet{ { Name: aws.String("update-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { Name: aws.String("delete-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { Name: aws.String("update-test.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("delete-test.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("update-test-a-to-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.1.1.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.1.1.1")}}, }, { Name: aws.String("update-test-alias-to-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), - AliasTarget: &route53.AliasTarget{ + Type: route53types.RRTypeA, + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("foo.eu-central-1.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(true), + EvaluateTargetHealth: true, HostedZoneId: aws.String("Z215JYRZR1TBD5"), }, }, { Name: aws.String("update-test-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, }, { Name: aws.String("delete-test-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, }, { Name: aws.String("update-test-cname-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, }, { Name: aws.String("delete-test-cname-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, }, { Name: aws.String("update-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("delete-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}, {Value: aws.String("4.3.2.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}, {Value: aws.String("4.3.2.1")}}, }, { Name: aws.String("weighted-to-simple.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("weighted-to-simple"), Weight: aws.Int64(10), }, { Name: aws.String("simple-to-weighted.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, }, { Name: aws.String("policy-change.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("policy-change"), Weight: aws.Int64(10), }, { Name: aws.String("set-identifier-change.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("before"), Weight: aws.Int64(10), }, { Name: aws.String("set-identifier-no-change.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("no-change"), Weight: aws.Int64(10), }, { Name: aws.String("update-test-mx.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeMx), + Type: route53types.RRTypeMx, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("10 mailhost2.bar.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("10 mailhost2.bar.elb.amazonaws.com")}}, }, { Name: aws.String("delete-test-mx.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeMx), + Type: route53types.RRTypeMx, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("30 mailhost1.foo.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("30 mailhost1.foo.elb.amazonaws.com")}}, }, }) @@ -757,217 +755,217 @@ func TestAWSApplyChanges(t *testing.T) { assert.Equal(t, 1, counter.calls["ListHostedZonesPages"], tt.name) assert.Equal(t, tt.listRRSets, counter.calls["ListResourceRecordSetsPages"], tt.name) - validateRecords(t, listAWSRecords(t, provider.clients[defaultAWSProfile], "/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do."), []*route53.ResourceRecordSet{ + validateRecords(t, listAWSRecords(t, provider.clients[defaultAWSProfile], "/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do."), []route53types.ResourceRecordSet{ { Name: aws.String("create-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { Name: aws.String("update-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, }, { Name: aws.String("update-test-a-to-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), - AliasTarget: &route53.AliasTarget{ + Type: route53types.RRTypeA, + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("foo.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(true), + EvaluateTargetHealth: true, HostedZoneId: aws.String("zone-1.ext-dns-test-2.teapot.zalan.do."), }, }, { Name: aws.String("update-test-alias-to-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("my-internal-host.example.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("my-internal-host.example.com")}}, }, { Name: aws.String("create-test-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("foo.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("foo.elb.amazonaws.com")}}, }, { Name: aws.String("update-test-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("baz.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("baz.elb.amazonaws.com")}}, }, { Name: aws.String("create-test-cname-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("foo.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("foo.elb.amazonaws.com")}}, }, { Name: aws.String("update-test-cname-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("baz.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("baz.elb.amazonaws.com")}}, }, { Name: aws.String("weighted-to-simple.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, }, { Name: aws.String("simple-to-weighted.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("simple-to-weighted"), Weight: aws.Int64(10), }, { Name: aws.String("policy-change.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("policy-change"), - Region: aws.String("us-east-1"), + Region: route53types.ResourceRecordSetRegionUsEast1, }, { Name: aws.String("set-identifier-change.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("after"), Weight: aws.Int64(10), }, { Name: aws.String("set-identifier-no-change.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("no-change"), Weight: aws.Int64(20), }, { Name: aws.String("create-test-mx.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeMx), + Type: route53types.RRTypeMx, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("10 mailhost1.foo.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("10 mailhost1.foo.elb.amazonaws.com")}}, }, }) - validateRecords(t, listAWSRecords(t, provider.clients[defaultAWSProfile], "/hostedzone/zone-2.ext-dns-test-2.teapot.zalan.do."), []*route53.ResourceRecordSet{ + validateRecords(t, listAWSRecords(t, provider.clients[defaultAWSProfile], "/hostedzone/zone-2.ext-dns-test-2.teapot.zalan.do."), []route53types.ResourceRecordSet{ { Name: aws.String("create-test.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("update-test.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("4.3.2.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("4.3.2.1")}}, }, { Name: aws.String("create-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("update-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}, {Value: aws.String("4.3.2.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}, {Value: aws.String("4.3.2.1")}}, }, { Name: aws.String("update-test-mx.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeMx), + Type: route53types.RRTypeMx, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("20 mailhost3.foo.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("20 mailhost3.foo.elb.amazonaws.com")}}, }, }) } } func TestAWSApplyChangesDryRun(t *testing.T) { - originalRecords := []*route53.ResourceRecordSet{ + originalRecords := []route53types.ResourceRecordSet{ { Name: aws.String("update-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { Name: aws.String("delete-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { Name: aws.String("update-test.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("delete-test.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("update-test-a-to-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.1.1.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.1.1.1")}}, }, { Name: aws.String("update-test-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, }, { Name: aws.String("delete-test-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, }, { Name: aws.String("update-test-cname-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, }, { Name: aws.String("delete-test-cname-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, }, { Name: aws.String("update-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("delete-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}, {Value: aws.String("4.3.2.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}, {Value: aws.String("4.3.2.1")}}, }, { Name: aws.String("update-test-mx.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeMx), + Type: route53types.RRTypeMx, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("20 mail.foo.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("20 mail.foo.elb.amazonaws.com")}}, }, { Name: aws.String("delete-test-mx.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeMx), + Type: route53types.RRTypeMx, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("10 mail.bar.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("10 mail.bar.elb.amazonaws.com")}}, }, } @@ -1031,33 +1029,33 @@ func TestAWSApplyChangesDryRun(t *testing.T) { func TestAWSChangesByZones(t *testing.T) { changes := Route53Changes{ { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("qux.foo.example.org"), TTL: aws.Int64(1), }, }, }, { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("qux.bar.example.org"), TTL: aws.Int64(2), }, }, }, { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionDelete), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionDelete, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("wambo.foo.example.org"), TTL: aws.Int64(10), }, }, }, { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionDelete), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionDelete, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("wambo.bar.example.org"), TTL: aws.Int64(20), }, }, @@ -1067,29 +1065,29 @@ func TestAWSChangesByZones(t *testing.T) { zones := map[string]*profiledZone{ "foo-example-org": { profile: defaultAWSProfile, - zone: &route53.HostedZone{ + zone: &route53types.HostedZone{ Id: aws.String("foo-example-org"), Name: aws.String("foo.example.org."), }, }, "bar-example-org": { profile: defaultAWSProfile, - zone: &route53.HostedZone{ + zone: &route53types.HostedZone{ Id: aws.String("bar-example-org"), Name: aws.String("bar.example.org."), }, }, "bar-example-org-private": { profile: defaultAWSProfile, - zone: &route53.HostedZone{ + zone: &route53types.HostedZone{ Id: aws.String("bar-example-org-private"), Name: aws.String("bar.example.org."), - Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(true)}, + Config: &route53types.HostedZoneConfig{PrivateZone: true}, }, }, "baz-example-org": { profile: defaultAWSProfile, - zone: &route53.HostedZone{ + zone: &route53types.HostedZone{ Id: aws.String("baz-example-org"), Name: aws.String("baz.example.org."), }, @@ -1101,17 +1099,17 @@ func TestAWSChangesByZones(t *testing.T) { validateAWSChangeRecords(t, changesByZone["foo-example-org"], Route53Changes{ { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("qux.foo.example.org"), TTL: aws.Int64(1), }, }, }, { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionDelete), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionDelete, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("wambo.foo.example.org"), TTL: aws.Int64(10), }, }, @@ -1120,17 +1118,17 @@ func TestAWSChangesByZones(t *testing.T) { validateAWSChangeRecords(t, changesByZone["bar-example-org"], Route53Changes{ { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("qux.bar.example.org"), TTL: aws.Int64(2), }, }, }, { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionDelete), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionDelete, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("wambo.bar.example.org"), TTL: aws.Int64(20), }, }, @@ -1139,17 +1137,17 @@ func TestAWSChangesByZones(t *testing.T) { validateAWSChangeRecords(t, changesByZone["bar-example-org-private"], Route53Changes{ { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("qux.bar.example.org"), TTL: aws.Int64(2), }, }, }, { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionDelete), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionDelete, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("wambo.bar.example.org"), TTL: aws.Int64(20), }, }, @@ -1176,7 +1174,7 @@ func TestAWSsubmitChanges(t *testing.T) { zones, _ := provider.zones(ctx) records, _ := provider.Records(ctx) cs := make(Route53Changes, 0, len(endpoints)) - cs = append(cs, provider.newChanges(route53.ChangeActionCreate, endpoints)...) + cs = append(cs, provider.newChanges(route53types.ChangeActionCreate, endpoints)...) require.NoError(t, provider.submitChanges(ctx, cs, zones)) @@ -1195,7 +1193,7 @@ func TestAWSsubmitChangesError(t *testing.T) { require.NoError(t, err) ep := endpoint.NewEndpointWithTTL("fail.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "1.0.0.1") - cs := provider.newChanges(route53.ChangeActionCreate, []*endpoint.Endpoint{ep}) + cs := provider.newChanges(route53types.ChangeActionCreate, []*endpoint.Endpoint{ep}) require.Error(t, provider.submitChanges(ctx, cs, zones)) } @@ -1217,20 +1215,20 @@ func TestAWSsubmitChangesRetryOnError(t *testing.T) { } // "success" and "fail" are created in the first step, both are submitted in the same batch; this should fail - cs1 := provider.newChanges(route53.ChangeActionCreate, []*endpoint.Endpoint{ep2, ep2txt, ep1}) + cs1 := provider.newChanges(route53types.ChangeActionCreate, []*endpoint.Endpoint{ep2, ep2txt, ep1}) input1 := &route53.ChangeResourceRecordSetsInput{ HostedZoneId: aws.String("/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do."), - ChangeBatch: &route53.ChangeBatch{ + ChangeBatch: &route53types.ChangeBatch{ Changes: cs1.Route53Changes(), }, } clientStub.MockMethod("ChangeResourceRecordSets", input1).Return(nil, fmt.Errorf("Mock route53 failure")) // because of the failure, changes will be retried one by one; make "fail" submitted in its own batch fail as well - cs2 := provider.newChanges(route53.ChangeActionCreate, []*endpoint.Endpoint{ep2, ep2txt}) + cs2 := provider.newChanges(route53types.ChangeActionCreate, []*endpoint.Endpoint{ep2, ep2txt}) input2 := &route53.ChangeResourceRecordSetsInput{ HostedZoneId: aws.String("/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do."), - ChangeBatch: &route53.ChangeBatch{ + ChangeBatch: &route53types.ChangeBatch{ Changes: cs2.Route53Changes(), }, } @@ -1247,7 +1245,7 @@ func TestAWSsubmitChangesRetryOnError(t *testing.T) { require.False(t, containsRecordWithDNSName(records, "fail__edns_housekeeping.zone-1.ext-dns-test-2.teapot.zalan.do")) // next batch should contain "fail" and "success2", should succeed this time - cs3 := provider.newChanges(route53.ChangeActionCreate, []*endpoint.Endpoint{ep2, ep2txt, ep3}) + cs3 := provider.newChanges(route53types.ChangeActionCreate, []*endpoint.Endpoint{ep2, ep2txt, ep3}) require.NoError(t, provider.submitChanges(ctx, cs3, zones)) // verify all records are there @@ -1264,20 +1262,20 @@ func TestAWSBatchChangeSet(t *testing.T) { for i := 1; i <= defaultBatchChangeSize; i += 2 { cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("A"), + Type: route53types.RRTypeA, }, }, }) cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("TXT"), + Type: route53types.RRTypeTxt, }, }, }) @@ -1301,20 +1299,20 @@ func TestAWSBatchChangeSetExceeding(t *testing.T) { for i := 1; i <= testCount; i += 2 { cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("A"), + Type: route53types.RRTypeA, }, }, }, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("TXT"), + Type: route53types.RRTypeTxt, }, }, }, @@ -1339,20 +1337,20 @@ func TestAWSBatchChangeSetExceedingNameChange(t *testing.T) { for i := 1; i <= testCount; i += 2 { cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("A"), + Type: route53types.RRTypeA, }, }, }, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("TXT"), + Type: route53types.RRTypeTxt, }, }, }, @@ -1384,12 +1382,12 @@ func TestAWSBatchChangeSetExceedingBytesLimit(t *testing.T) { for i := 1; i <= testCount; i += groupSize { cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("A"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeA, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("1.2.3.4"), }, @@ -1400,12 +1398,12 @@ func TestAWSBatchChangeSetExceedingBytesLimit(t *testing.T) { sizeValues: 1, }, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("TXT"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeTxt, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("txt-record"), }, @@ -1443,12 +1441,12 @@ func TestAWSBatchChangeSetExceedingBytesLimitUpsert(t *testing.T) { for i := 1; i <= testCount; i += groupSize { cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionUpsert), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionUpsert, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("A"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeA, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("1.2.3.4"), }, @@ -1459,12 +1457,12 @@ func TestAWSBatchChangeSetExceedingBytesLimitUpsert(t *testing.T) { sizeValues: 1, }, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionUpsert), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionUpsert, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("TXT"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeTxt, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("txt-record"), }, @@ -1502,12 +1500,12 @@ func TestAWSBatchChangeSetExceedingValuesLimit(t *testing.T) { for i := 1; i <= testCount; i += groupSize { cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("A"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeA, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("1.2.3.4"), }, @@ -1518,12 +1516,12 @@ func TestAWSBatchChangeSetExceedingValuesLimit(t *testing.T) { sizeValues: 1, }, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("TXT"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeTxt, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("txt-record"), }, @@ -1561,12 +1559,12 @@ func TestAWSBatchChangeSetExceedingValuesLimitUpsert(t *testing.T) { for i := 1; i <= testCount; i += groupSize { cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionUpsert), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionUpsert, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("A"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeA, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("1.2.3.4"), }, @@ -1577,12 +1575,12 @@ func TestAWSBatchChangeSetExceedingValuesLimitUpsert(t *testing.T) { sizeValues: 1, }, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionUpsert), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionUpsert, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("TXT"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeTxt, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("txt-record"), }, @@ -1608,7 +1606,7 @@ func validateEndpoints(t *testing.T, provider *AWSProvider, endpoints []*endpoin assert.True(t, testutils.SameEndpoints(normalized, expected), "actual and normalized endpoints don't match. %+v:%+v", endpoints, normalized) } -func validateAWSZones(t *testing.T, zones map[string]*route53.HostedZone, expected map[string]*route53.HostedZone) { +func validateAWSZones(t *testing.T, zones map[string]*route53types.HostedZone, expected map[string]*route53types.HostedZone) { require.Len(t, zones, len(expected)) for i, zone := range zones { @@ -1616,9 +1614,9 @@ func validateAWSZones(t *testing.T, zones map[string]*route53.HostedZone, expect } } -func validateAWSZone(t *testing.T, zone *route53.HostedZone, expected *route53.HostedZone) { - assert.Equal(t, aws.StringValue(expected.Id), aws.StringValue(zone.Id)) - assert.Equal(t, aws.StringValue(expected.Name), aws.StringValue(zone.Name)) +func validateAWSZone(t *testing.T, zone *route53types.HostedZone, expected *route53types.HostedZone) { + assert.Equal(t, *expected.Id, *zone.Id) + assert.Equal(t, *expected.Name, *zone.Name) } func validateAWSChangeRecords(t *testing.T, records Route53Changes, expected Route53Changes) { @@ -1630,9 +1628,9 @@ func validateAWSChangeRecords(t *testing.T, records Route53Changes, expected Rou } func validateAWSChangeRecord(t *testing.T, record *Route53Change, expected *Route53Change) { - assert.Equal(t, aws.StringValue(expected.Action), aws.StringValue(record.Action)) - assert.Equal(t, aws.StringValue(expected.ResourceRecordSet.Name), aws.StringValue(record.ResourceRecordSet.Name)) - assert.Equal(t, aws.StringValue(expected.ResourceRecordSet.Type), aws.StringValue(record.ResourceRecordSet.Type)) + assert.Equal(t, expected.Action, record.Action) + assert.Equal(t, *expected.ResourceRecordSet.Name, *record.ResourceRecordSet.Name) + assert.Equal(t, expected.ResourceRecordSet.Type, record.ResourceRecordSet.Type) } func TestAWSCreateRecordsWithCNAME(t *testing.T) { @@ -1650,12 +1648,12 @@ func TestAWSCreateRecordsWithCNAME(t *testing.T) { recordSets := listAWSRecords(t, provider.clients[defaultAWSProfile], "/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do.") - validateRecords(t, recordSets, []*route53.ResourceRecordSet{ + validateRecords(t, recordSets, []route53types.ResourceRecordSet{ { Name: aws.String("create-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(endpoint.RecordTypeCNAME), + Type: route53types.RRTypeCname, TTL: aws.Int64(300), - ResourceRecords: []*route53.ResourceRecord{ + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("foo.example.org"), }, @@ -1714,33 +1712,33 @@ func TestAWSCreateRecordsWithALIAS(t *testing.T) { recordSets := listAWSRecords(t, provider.clients[defaultAWSProfile], "/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do.") - validateRecords(t, recordSets, []*route53.ResourceRecordSet{ + validateRecords(t, recordSets, []route53types.ResourceRecordSet{ { - AliasTarget: &route53.AliasTarget{ + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("foo.eu-central-1.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(evaluateTargetHealth), + EvaluateTargetHealth: evaluateTargetHealth, HostedZoneId: aws.String("Z215JYRZR1TBD5"), }, Name: aws.String("create-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, }, { - AliasTarget: &route53.AliasTarget{ + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("bar.eu-central-1.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(evaluateTargetHealth), + EvaluateTargetHealth: evaluateTargetHealth, HostedZoneId: aws.String("Z215JYRZR1TBD5"), }, Name: aws.String("create-test-dualstack.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, }, { - AliasTarget: &route53.AliasTarget{ + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("bar.eu-central-1.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(evaluateTargetHealth), + EvaluateTargetHealth: evaluateTargetHealth, HostedZoneId: aws.String("Z215JYRZR1TBD5"), }, Name: aws.String("create-test-dualstack.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeAaaa), + Type: route53types.RRTypeAaaa, }, }) } @@ -1803,15 +1801,15 @@ func TestAWSCanonicalHostedZone(t *testing.T) { func TestAWSSuitableZones(t *testing.T) { zones := map[string]*profiledZone{ // Public domain - "example-org": {profile: defaultAWSProfile, zone: &route53.HostedZone{Id: aws.String("example-org"), Name: aws.String("example.org.")}}, + "example-org": {profile: defaultAWSProfile, zone: &route53types.HostedZone{Id: aws.String("example-org"), Name: aws.String("example.org.")}}, // Public subdomain - "bar-example-org": {profile: defaultAWSProfile, zone: &route53.HostedZone{Id: aws.String("bar-example-org"), Name: aws.String("bar.example.org."), Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(false)}}}, + "bar-example-org": {profile: defaultAWSProfile, zone: &route53types.HostedZone{Id: aws.String("bar-example-org"), Name: aws.String("bar.example.org."), Config: &route53types.HostedZoneConfig{PrivateZone: false}}}, // Public subdomain - "longfoo-bar-example-org": {profile: defaultAWSProfile, zone: &route53.HostedZone{Id: aws.String("longfoo-bar-example-org"), Name: aws.String("longfoo.bar.example.org.")}}, + "longfoo-bar-example-org": {profile: defaultAWSProfile, zone: &route53types.HostedZone{Id: aws.String("longfoo-bar-example-org"), Name: aws.String("longfoo.bar.example.org.")}}, // Private domain - "example-org-private": {profile: defaultAWSProfile, zone: &route53.HostedZone{Id: aws.String("example-org-private"), Name: aws.String("example.org."), Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(true)}}}, + "example-org-private": {profile: defaultAWSProfile, zone: &route53types.HostedZone{Id: aws.String("example-org-private"), Name: aws.String("example.org."), Config: &route53types.HostedZoneConfig{PrivateZone: true}}}, // Private subdomain - "bar-example-org-private": {profile: defaultAWSProfile, zone: &route53.HostedZone{Id: aws.String("bar-example-org-private"), Name: aws.String("bar.example.org."), Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(true)}}}, + "bar-example-org-private": {profile: defaultAWSProfile, zone: &route53types.HostedZone{Id: aws.String("bar-example-org-private"), Name: aws.String("bar.example.org."), Config: &route53types.HostedZoneConfig{PrivateZone: true}}}, } for _, tc := range []struct { @@ -1840,19 +1838,20 @@ func TestAWSSuitableZones(t *testing.T) { } } -func createAWSZone(t *testing.T, provider *AWSProvider, zone *route53.HostedZone) { +func createAWSZone(t *testing.T, provider *AWSProvider, zone *route53types.HostedZone) { params := &route53.CreateHostedZoneInput{ CallerReference: aws.String("external-dns.alpha.kubernetes.io/test-zone"), Name: zone.Name, HostedZoneConfig: zone.Config, } - if _, err := provider.clients[defaultAWSProfile].CreateHostedZoneWithContext(context.Background(), params); err != nil { - require.EqualError(t, err, route53.ErrCodeHostedZoneAlreadyExists) + if _, err := provider.clients[defaultAWSProfile].CreateHostedZone(context.Background(), params); err != nil { + var hzExists *route53types.HostedZoneAlreadyExists + require.ErrorAs(t, err, &hzExists) } } -func setAWSRecords(t *testing.T, provider *AWSProvider, records []*route53.ResourceRecordSet) { +func setAWSRecords(t *testing.T, provider *AWSProvider, records []route53types.ResourceRecordSet) { dryRun := provider.dryRun provider.dryRun = false defer func() { @@ -1868,9 +1867,9 @@ func setAWSRecords(t *testing.T, provider *AWSProvider, records []*route53.Resou var changes Route53Changes for _, record := range records { changes = append(changes, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: record, + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &record, }, }) } @@ -1884,24 +1883,21 @@ func setAWSRecords(t *testing.T, provider *AWSProvider, records []*route53.Resou require.NoError(t, err) } -func listAWSRecords(t *testing.T, client Route53API, zone string) []*route53.ResourceRecordSet { - recordSets := []*route53.ResourceRecordSet{} - require.NoError(t, client.ListResourceRecordSetsPagesWithContext(context.Background(), &route53.ListResourceRecordSetsInput{ +func listAWSRecords(t *testing.T, client Route53API, zone string) []route53types.ResourceRecordSet { + resp, err := client.ListResourceRecordSets(context.Background(), &route53.ListResourceRecordSetsInput{ HostedZoneId: aws.String(zone), - MaxItems: aws.String(route53PageSize), - }, func(resp *route53.ListResourceRecordSetsOutput, _ bool) bool { - recordSets = append(recordSets, resp.ResourceRecordSets...) - return true - })) + MaxItems: aws.Int32(route53PageSize), + }) + require.NoError(t, err) - return recordSets + return resp.ResourceRecordSets } -func newAWSProvider(t *testing.T, domainFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, zoneTypeFilter provider.ZoneTypeFilter, evaluateTargetHealth, dryRun bool, records []*route53.ResourceRecordSet) (*AWSProvider, *Route53APIStub) { +func newAWSProvider(t *testing.T, domainFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, zoneTypeFilter provider.ZoneTypeFilter, evaluateTargetHealth, dryRun bool, records []route53types.ResourceRecordSet) (*AWSProvider, *Route53APIStub) { return newAWSProviderWithTagFilter(t, domainFilter, zoneIDFilter, zoneTypeFilter, provider.NewZoneTagFilter([]string{}), evaluateTargetHealth, dryRun, records) } -func newAWSProviderWithTagFilter(t *testing.T, domainFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, zoneTypeFilter provider.ZoneTypeFilter, zoneTagFilter provider.ZoneTagFilter, evaluateTargetHealth, dryRun bool, records []*route53.ResourceRecordSet) (*AWSProvider, *Route53APIStub) { +func newAWSProviderWithTagFilter(t *testing.T, domainFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, zoneTypeFilter provider.ZoneTypeFilter, zoneTagFilter provider.ZoneTagFilter, evaluateTargetHealth, dryRun bool, records []route53types.ResourceRecordSet) (*AWSProvider, *Route53APIStub) { client := NewRoute53APIStub(t) provider := &AWSProvider{ @@ -1920,29 +1916,29 @@ func newAWSProviderWithTagFilter(t *testing.T, domainFilter endpoint.DomainFilte failedChangesQueue: make(map[string]Route53Changes), } - createAWSZone(t, provider, &route53.HostedZone{ + createAWSZone(t, provider, &route53types.HostedZone{ Id: aws.String("/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do."), Name: aws.String("zone-1.ext-dns-test-2.teapot.zalan.do."), - Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(false)}, + Config: &route53types.HostedZoneConfig{PrivateZone: false}, }) - createAWSZone(t, provider, &route53.HostedZone{ + createAWSZone(t, provider, &route53types.HostedZone{ Id: aws.String("/hostedzone/zone-2.ext-dns-test-2.teapot.zalan.do."), Name: aws.String("zone-2.ext-dns-test-2.teapot.zalan.do."), - Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(false)}, + Config: &route53types.HostedZoneConfig{PrivateZone: false}, }) - createAWSZone(t, provider, &route53.HostedZone{ + createAWSZone(t, provider, &route53types.HostedZone{ Id: aws.String("/hostedzone/zone-3.ext-dns-test-2.teapot.zalan.do."), Name: aws.String("zone-3.ext-dns-test-2.teapot.zalan.do."), - Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(true)}, + Config: &route53types.HostedZoneConfig{PrivateZone: true}, }) // filtered out by domain filter - createAWSZone(t, provider, &route53.HostedZone{ + createAWSZone(t, provider, &route53types.HostedZone{ Id: aws.String("/hostedzone/zone-4.ext-dns-test-3.teapot.zalan.do."), Name: aws.String("zone-4.ext-dns-test-3.teapot.zalan.do."), - Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(false)}, + Config: &route53types.HostedZoneConfig{PrivateZone: false}, }) setupZoneTags(provider.clients[defaultAWSProfile].(*Route53APIStub)) @@ -1977,10 +1973,10 @@ func setupZoneTags(client *Route53APIStub) { }) } -func addZoneTags(tagMap map[string][]*route53.Tag, zoneID string, tags map[string]string) { - tagList := make([]*route53.Tag, 0, len(tags)) +func addZoneTags(tagMap map[string][]route53types.Tag, zoneID string, tags map[string]string) { + tagList := make([]route53types.Tag, 0, len(tags)) for k, v := range tags { - tagList = append(tagList, &route53.Tag{ + tagList = append(tagList, route53types.Tag{ Key: aws.String(k), Value: aws.String(v), }) @@ -1988,7 +1984,7 @@ func addZoneTags(tagMap map[string][]*route53.Tag, zoneID string, tags map[strin tagMap[zoneID] = tagList } -func validateRecords(t *testing.T, records []*route53.ResourceRecordSet, expected []*route53.ResourceRecordSet) { +func validateRecords(t *testing.T, records []route53types.ResourceRecordSet, expected []route53types.ResourceRecordSet) { assert.ElementsMatch(t, expected, records) } diff --git a/provider/aws/session.go b/provider/aws/session.go index 8de5d0f40..038963bb5 100644 --- a/provider/aws/session.go +++ b/provider/aws/session.go @@ -59,6 +59,30 @@ func CreateDefaultV2Config(cfg *externaldns.Config) awsv2.Config { return result } +func CreateV2Configs(cfg *externaldns.Config) map[string]awsv2.Config { + result := make(map[string]awsv2.Config) + if len(cfg.AWSProfiles) == 0 || (len(cfg.AWSProfiles) == 1 && cfg.AWSProfiles[0] == "") { + cfg := CreateDefaultV2Config(cfg) + result[defaultAWSProfile] = cfg + } else { + for _, profile := range cfg.AWSProfiles { + cfg, err := newV2Config( + AWSSessionConfig{ + AssumeRole: cfg.AWSAssumeRole, + AssumeRoleExternalID: cfg.AWSAssumeRoleExternalID, + APIRetries: cfg.AWSAPIRetries, + Profile: profile, + }, + ) + if err != nil { + logrus.Fatal(err) + } + result[profile] = cfg + } + } + return result +} + func CreateDefaultSession(cfg *externaldns.Config) *session.Session { result, err := newSession( AWSSessionConfig{ diff --git a/provider/zone_type_filter.go b/provider/zone_type_filter.go index 14ceac0e8..c595a4a9c 100644 --- a/provider/zone_type_filter.go +++ b/provider/zone_type_filter.go @@ -17,8 +17,7 @@ limitations under the License. package provider import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/route53" + route53types "github.com/aws/aws-sdk-go-v2/service/route53/types" ) const ( @@ -52,7 +51,7 @@ func (f ZoneTypeFilter) Match(rawZoneType interface{}) bool { case zoneTypePrivate: return zoneType == zoneTypePrivate } - case *route53.HostedZone: + case route53types.HostedZone: // If the zone has no config we assume it's a public zone since the config's field // `PrivateZone` is false by default in go. if zoneType.Config == nil { @@ -61,9 +60,9 @@ func (f ZoneTypeFilter) Match(rawZoneType interface{}) bool { switch f.zoneType { case zoneTypePublic: - return !aws.BoolValue(zoneType.Config.PrivateZone) + return !zoneType.Config.PrivateZone case zoneTypePrivate: - return aws.BoolValue(zoneType.Config.PrivateZone) + return zoneType.Config.PrivateZone } } diff --git a/provider/zone_type_filter_test.go b/provider/zone_type_filter_test.go index 8677e6fb0..903d8e876 100644 --- a/provider/zone_type_filter_test.go +++ b/provider/zone_type_filter_test.go @@ -19,8 +19,7 @@ package provider import ( "testing" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/route53" + route53types "github.com/aws/aws-sdk-go-v2/service/route53/types" "github.com/stretchr/testify/assert" ) @@ -28,8 +27,8 @@ import ( func TestZoneTypeFilterMatch(t *testing.T) { publicZoneStr := "public" privateZoneStr := "private" - publicZoneAWS := &route53.HostedZone{Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(false)}} - privateZoneAWS := &route53.HostedZone{Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(true)}} + publicZoneAWS := route53types.HostedZone{Config: &route53types.HostedZoneConfig{PrivateZone: false}} + privateZoneAWS := route53types.HostedZone{Config: &route53types.HostedZoneConfig{PrivateZone: true}} for _, tc := range []struct { zoneTypeFilter string @@ -37,10 +36,10 @@ func TestZoneTypeFilterMatch(t *testing.T) { zones []interface{} }{ { - "", true, []interface{}{publicZoneStr, privateZoneStr, &route53.HostedZone{}}, + "", true, []interface{}{publicZoneStr, privateZoneStr, route53types.HostedZone{}}, }, { - "public", true, []interface{}{publicZoneStr, publicZoneAWS, &route53.HostedZone{}}, + "public", true, []interface{}{publicZoneStr, publicZoneAWS, route53types.HostedZone{}}, }, { "public", false, []interface{}{privateZoneStr, privateZoneAWS}, @@ -49,15 +48,17 @@ func TestZoneTypeFilterMatch(t *testing.T) { "private", true, []interface{}{privateZoneStr, privateZoneAWS}, }, { - "private", false, []interface{}{publicZoneStr, publicZoneAWS, &route53.HostedZone{}}, + "private", false, []interface{}{publicZoneStr, publicZoneAWS, route53types.HostedZone{}}, }, { "unknown", false, []interface{}{publicZoneStr}, }, } { - zoneTypeFilter := NewZoneTypeFilter(tc.zoneTypeFilter) - for _, zone := range tc.zones { - assert.Equal(t, tc.matches, zoneTypeFilter.Match(zone)) - } + t.Run(tc.zoneTypeFilter, func(t *testing.T) { + zoneTypeFilter := NewZoneTypeFilter(tc.zoneTypeFilter) + for _, zone := range tc.zones { + assert.Equal(t, tc.matches, zoneTypeFilter.Match(zone)) + } + }) } } From 0de6f8adcc780db9a1d5f98dc17ed308ad02f49d Mon Sep 17 00:00:00 2001 From: Michael Shen Date: Tue, 30 Jul 2024 00:09:28 -0400 Subject: [PATCH 35/82] Remove unused session logic after move to aws-sdk-go-v2 Signed-off-by: Michael Shen --- go.mod | 1 - go.sum | 2 - provider/aws/{session.go => config.go} | 90 ------------------- .../aws/{session_test.go => config_test.go} | 39 -------- 4 files changed, 132 deletions(-) rename provider/aws/{session.go => config.go} (57%) rename provider/aws/{session_test.go => config_test.go} (66%) diff --git a/go.mod b/go.mod index 23b9abe67..a4350b89c 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,6 @@ require ( github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2 github.com/alecthomas/kingpin/v2 v2.4.0 github.com/aliyun/alibaba-cloud-sdk-go v1.63.0 - github.com/aws/aws-sdk-go v1.55.5 github.com/aws/aws-sdk-go-v2 v1.30.3 github.com/aws/aws-sdk-go-v2/config v1.27.27 github.com/aws/aws-sdk-go-v2/credentials v1.17.27 diff --git a/go.sum b/go.sum index ea9c32dcc..70d598d21 100644 --- a/go.sum +++ b/go.sum @@ -116,8 +116,6 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:W github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= -github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP8dY= github.com/aws/aws-sdk-go-v2 v1.30.3/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc= diff --git a/provider/aws/session.go b/provider/aws/config.go similarity index 57% rename from provider/aws/session.go rename to provider/aws/config.go index 038963bb5..bbfca9e97 100644 --- a/provider/aws/session.go +++ b/provider/aws/config.go @@ -27,10 +27,6 @@ import ( "github.com/aws/aws-sdk-go-v2/config" stscredsv2 "github.com/aws/aws-sdk-go-v2/credentials/stscreds" "github.com/aws/aws-sdk-go-v2/service/sts" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials/stscreds" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" "github.com/linki/instrumented_http" "github.com/sirupsen/logrus" @@ -83,92 +79,6 @@ func CreateV2Configs(cfg *externaldns.Config) map[string]awsv2.Config { return result } -func CreateDefaultSession(cfg *externaldns.Config) *session.Session { - result, err := newSession( - AWSSessionConfig{ - AssumeRole: cfg.AWSAssumeRole, - AssumeRoleExternalID: cfg.AWSAssumeRoleExternalID, - APIRetries: cfg.AWSAPIRetries, - }, - ) - if err != nil { - logrus.Fatal(err) - } - return result -} - -func CreateSessions(cfg *externaldns.Config) map[string]*session.Session { - result := make(map[string]*session.Session) - - if len(cfg.AWSProfiles) == 0 || (len(cfg.AWSProfiles) == 1 && cfg.AWSProfiles[0] == "") { - session, err := newSession( - AWSSessionConfig{ - AssumeRole: cfg.AWSAssumeRole, - AssumeRoleExternalID: cfg.AWSAssumeRoleExternalID, - APIRetries: cfg.AWSAPIRetries, - }, - ) - if err != nil { - logrus.Fatal(err) - } - result[defaultAWSProfile] = session - } else { - for _, profile := range cfg.AWSProfiles { - session, err := newSession( - AWSSessionConfig{ - AssumeRole: cfg.AWSAssumeRole, - AssumeRoleExternalID: cfg.AWSAssumeRoleExternalID, - APIRetries: cfg.AWSAPIRetries, - Profile: profile, - }, - ) - if err != nil { - logrus.Fatal(err) - } - result[profile] = session - } - } - return result -} - -func newSession(awsConfig AWSSessionConfig) (*session.Session, error) { - config := aws.NewConfig().WithMaxRetries(awsConfig.APIRetries) - - config.WithHTTPClient( - instrumented_http.NewClient(config.HTTPClient, &instrumented_http.Callbacks{ - PathProcessor: func(path string) string { - parts := strings.Split(path, "/") - return parts[len(parts)-1] - }, - }), - ) - - session, err := session.NewSessionWithOptions(session.Options{ - Config: *config, - SharedConfigState: session.SharedConfigEnable, - Profile: awsConfig.Profile, - }) - if err != nil { - return nil, fmt.Errorf("instantiating AWS session: %w", err) - } - - if awsConfig.AssumeRole != "" { - if awsConfig.AssumeRoleExternalID != "" { - logrus.Infof("Assuming role: %s with external id %s", awsConfig.AssumeRole, awsConfig.AssumeRoleExternalID) - session.Config.WithCredentials(stscreds.NewCredentials(session, awsConfig.AssumeRole, func(p *stscreds.AssumeRoleProvider) { - p.ExternalID = &awsConfig.AssumeRoleExternalID - })) - } else { - logrus.Infof("Assuming role: %s", awsConfig.AssumeRole) - session.Config.WithCredentials(stscreds.NewCredentials(session, awsConfig.AssumeRole)) - } - } - - session.Handlers.Build.PushBack(request.MakeAddToUserAgentHandler("ExternalDNS", externaldns.Version)) - - return session, nil -} - func newV2Config(awsConfig AWSSessionConfig) (awsv2.Config, error) { defaultOpts := []func(*config.LoadOptions) error{ config.WithRetryer(func() awsv2.Retryer { diff --git a/provider/aws/session_test.go b/provider/aws/config_test.go similarity index 66% rename from provider/aws/session_test.go rename to provider/aws/config_test.go index b73485c03..00b3b46aa 100644 --- a/provider/aws/session_test.go +++ b/provider/aws/config_test.go @@ -25,45 +25,6 @@ import ( "github.com/stretchr/testify/require" ) -func Test_newSession(t *testing.T) { - t.Run("should use profile from credentials file", func(t *testing.T) { - // setup - credsFile, err := prepareCredentialsFile(t) - defer os.Remove(credsFile.Name()) - require.NoError(t, err) - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", credsFile.Name()) - defer os.Unsetenv("AWS_SHARED_CREDENTIALS_FILE") - - // when - s, err := newSession(AWSSessionConfig{Profile: "profile2"}) - require.NoError(t, err) - creds, err := s.Config.Credentials.Get() - - // then - assert.NoError(t, err) - assert.Equal(t, "AKID2345", creds.AccessKeyID) - assert.Equal(t, "SECRET2", creds.SecretAccessKey) - }) - - t.Run("should respect env variables without profile", func(t *testing.T) { - // setup - os.Setenv("AWS_ACCESS_KEY_ID", "AKIAIOSFODNN7EXAMPLE") - os.Setenv("AWS_SECRET_ACCESS_KEY", "topsecret") - defer os.Unsetenv("AWS_ACCESS_KEY_ID") - defer os.Unsetenv("AWS_SECRET_ACCESS_KEY") - - // when - s, err := newSession(AWSSessionConfig{}) - require.NoError(t, err) - creds, err := s.Config.Credentials.Get() - - // then - assert.NoError(t, err) - assert.Equal(t, "AKIAIOSFODNN7EXAMPLE", creds.AccessKeyID) - assert.Equal(t, "topsecret", creds.SecretAccessKey) - }) -} - func Test_newV2Config(t *testing.T) { t.Run("should use profile from credentials file", func(t *testing.T) { // setup From 90c15d73e8fd5156327c12c71c4851e3b78c3617 Mon Sep 17 00:00:00 2001 From: Iulian Mandache <25257851+iul1an@users.noreply.github.com> Date: Sun, 8 Sep 2024 02:02:43 +0300 Subject: [PATCH 36/82] Do not expose the AWS role external id in the logs --- pkg/apis/externaldns/types.go | 2 +- provider/aws/config.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/apis/externaldns/types.go b/pkg/apis/externaldns/types.go index 02b59a422..021bed14f 100644 --- a/pkg/apis/externaldns/types.go +++ b/pkg/apis/externaldns/types.go @@ -86,7 +86,7 @@ type Config struct { AWSZoneTagFilter []string AWSAssumeRole string AWSProfiles []string - AWSAssumeRoleExternalID string + AWSAssumeRoleExternalID string `secure:"yes"` AWSBatchChangeSize int AWSBatchChangeSizeBytes int AWSBatchChangeSizeValues int diff --git a/provider/aws/config.go b/provider/aws/config.go index bbfca9e97..5908150e7 100644 --- a/provider/aws/config.go +++ b/provider/aws/config.go @@ -102,7 +102,8 @@ func newV2Config(awsConfig AWSSessionConfig) (awsv2.Config, error) { stsSvc := sts.NewFromConfig(cfg) var assumeRoleOpts []func(*stscredsv2.AssumeRoleOptions) if awsConfig.AssumeRoleExternalID != "" { - logrus.Infof("Assuming role: %s with external id %s", awsConfig.AssumeRole, awsConfig.AssumeRoleExternalID) + logrus.Infof("Assuming role %s with external id", awsConfig.AssumeRole) + logrus.Debugf("External id: %s", awsConfig.AssumeRoleExternalID) assumeRoleOpts = []func(*stscredsv2.AssumeRoleOptions){ func(opts *stscredsv2.AssumeRoleOptions) { opts.ExternalID = &awsConfig.AssumeRoleExternalID From ae02543c836b5e2b835d50a44d19047992faaa8f Mon Sep 17 00:00:00 2001 From: Kim Sondrup Date: Fri, 16 Aug 2024 14:08:36 +0200 Subject: [PATCH 37/82] fix(chart): Don't use unauthenticated webhook port for health probe --- charts/external-dns/CHANGELOG.md | 1 + charts/external-dns/README.md | 2 +- charts/external-dns/templates/deployment.yaml | 3 --- charts/external-dns/templates/service.yaml | 6 +++--- charts/external-dns/templates/servicemonitor.yaml | 2 +- charts/external-dns/values.yaml | 4 ++-- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/charts/external-dns/CHANGELOG.md b/charts/external-dns/CHANGELOG.md index d477a55d0..a7c530843 100644 --- a/charts/external-dns/CHANGELOG.md +++ b/charts/external-dns/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed `provider.webhook.resources` behavior to correctly leverage resource limits ([#4560](https://github.com/kubernetes-sigs/external-dns/pull/4560)) - Fixed `provider.webhook.imagePullPolicy` behavior to correctly leverage pull policy ([#4643](https://github.com/kubernetes-sigs/external-dns/pull/4643)) _@kimsondrup_ - Add correct webhook metric port to `Service` and `ServiceMonitor` ([#4643](https://github.com/kubernetes-sigs/external-dns/pull/4643)) _@kimsondrup_ +- No longer require the unauthenticated webhook provider port to be exposed for health probes ([#4691](https://github.com/kubernetes-sigs/external-dns/pull/4691)) _@kimsondrup_ _@hatrx_ ## [v1.14.5] - 2023-06-10 diff --git a/charts/external-dns/README.md b/charts/external-dns/README.md index 6af6463ad..38065fd1a 100644 --- a/charts/external-dns/README.md +++ b/charts/external-dns/README.md @@ -134,7 +134,7 @@ If `namespaced` is set to `true`, please ensure that `sources` my only contains | provider.webhook.readinessProbe | object | See _values.yaml_ | [Readiness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) configuration for the `webhook` container. | | provider.webhook.resources | object | `{}` | [Resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the `webhook` container. | | provider.webhook.securityContext | object | See _values.yaml_ | [Pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) for the `webhook` container. | -| provider.webhook.service.metricsPort | int | `8080` | Webhook metrics port for the service. | +| provider.webhook.service.port | int | `8080` | Webhook exposed HTTP port for the service. | | provider.webhook.serviceMonitor | object | See _values.yaml_ | Optional [Service Monitor](https://prometheus-operator.dev/docs/operator/design/#servicemonitor) configuration for the `webhook` container. | | rbac.additionalPermissions | list | `[]` | Additional rules to add to the `ClusterRole`. | | rbac.create | bool | `true` | If `true`, create a `ClusterRole` & `ClusterRoleBinding` with access to the Kubernetes API. | diff --git a/charts/external-dns/templates/deployment.yaml b/charts/external-dns/templates/deployment.yaml index d127d8d37..02e9b397a 100644 --- a/charts/external-dns/templates/deployment.yaml +++ b/charts/external-dns/templates/deployment.yaml @@ -158,9 +158,6 @@ spec: {{- end }} ports: - name: http-webhook - protocol: TCP - containerPort: 8888 - - name: http-wh-metrics protocol: TCP containerPort: 8080 livenessProbe: diff --git a/charts/external-dns/templates/service.yaml b/charts/external-dns/templates/service.yaml index dada90bfd..e55e2a368 100644 --- a/charts/external-dns/templates/service.yaml +++ b/charts/external-dns/templates/service.yaml @@ -28,9 +28,9 @@ spec: protocol: TCP {{- if eq $providerName "webhook" }} {{- with .Values.provider.webhook.service }} - - name: http-wh-metrics - port: {{ .metricsPort }} - targetPort: http-wh-metrics + - name: http-webhook + port: {{ .port }} + targetPort: http-webhook protocol: TCP {{- end }} {{- end }} diff --git a/charts/external-dns/templates/servicemonitor.yaml b/charts/external-dns/templates/servicemonitor.yaml index 98fbcc008..004756c7b 100644 --- a/charts/external-dns/templates/servicemonitor.yaml +++ b/charts/external-dns/templates/servicemonitor.yaml @@ -51,7 +51,7 @@ spec: {{- end }} {{- if eq $providerName "webhook" }} {{- with .Values.provider.webhook.serviceMonitor }} - - port: http-wh-metrics + - port: http-webhook path: /metrics {{- with .interval }} interval: {{ . }} diff --git a/charts/external-dns/values.yaml b/charts/external-dns/values.yaml index a2f0d0785..9d7dea1bb 100644 --- a/charts/external-dns/values.yaml +++ b/charts/external-dns/values.yaml @@ -270,8 +270,8 @@ provider: failureThreshold: 6 successThreshold: 1 service: - # -- Webhook metrics port for the service. - metricsPort: 8080 + # -- Webhook exposed HTTP port for the service. + port: 8080 # -- Optional [Service Monitor](https://prometheus-operator.dev/docs/operator/design/#servicemonitor) configuration for the `webhook` container. # @default -- See _values.yaml_ serviceMonitor: From 920e6820beb16c512a58a0c84d334f1169c86268 Mon Sep 17 00:00:00 2001 From: EWK20 Date: Tue, 10 Sep 2024 13:43:41 +0100 Subject: [PATCH 38/82] adds soft error test cases --- provider/google/google_test.go | 108 +++++++++++++++++++++------------ 1 file changed, 68 insertions(+), 40 deletions(-) diff --git a/provider/google/google_test.go b/provider/google/google_test.go index ea1428392..89a51b08b 100644 --- a/provider/google/google_test.go +++ b/provider/google/google_test.go @@ -59,7 +59,8 @@ func (m *mockManagedZonesCreateCall) Do(opts ...googleapi.CallOption) (*dns.Mana } type mockManagedZonesListCall struct { - project string + project string + zonesListSoftErr error } func (m *mockManagedZonesListCall) Pages(ctx context.Context, f func(*dns.ManagedZonesListResponse) error) error { @@ -71,22 +72,29 @@ func (m *mockManagedZonesListCall) Pages(ctx context.Context, f func(*dns.Manage } } + if m.zonesListSoftErr != nil { + return m.zonesListSoftErr + } + return f(&dns.ManagedZonesListResponse{ManagedZones: zones}) } -type mockManagedZonesClient struct{} +type mockManagedZonesClient struct { + zonesErr error +} func (m *mockManagedZonesClient) Create(project string, managedZone *dns.ManagedZone) managedZonesCreateCallInterface { return &mockManagedZonesCreateCall{project: project, managedZone: managedZone} } func (m *mockManagedZonesClient) List(project string) managedZonesListCallInterface { - return &mockManagedZonesListCall{project: project} + return &mockManagedZonesListCall{project: project, zonesListSoftErr: m.zonesErr} } type mockResourceRecordSetsListCall struct { - project string - managedZone string + project string + managedZone string + recordsListSoftErr error } func (m *mockResourceRecordSetsListCall) Pages(ctx context.Context, f func(*dns.ResourceRecordSetsListResponse) error) error { @@ -102,13 +110,19 @@ func (m *mockResourceRecordSetsListCall) Pages(ctx context.Context, f func(*dns. resp = append(resp, v) } + if m.recordsListSoftErr != nil { + return m.recordsListSoftErr + } + return f(&dns.ResourceRecordSetsListResponse{Rrsets: resp}) } -type mockResourceRecordSetsClient struct{} +type mockResourceRecordSetsClient struct { + recordsErr error +} func (m *mockResourceRecordSetsClient) List(project string, managedZone string) resourceRecordSetsListCallInterface { - return &mockResourceRecordSetsListCall{project: project, managedZone: managedZone} + return &mockResourceRecordSetsListCall{project: project, managedZone: managedZone, recordsListSoftErr: m.recordsErr} } type mockChangesCreateCall struct { @@ -248,19 +262,6 @@ func TestGoogleZonesVisibilityFilterPrivatePeering(t *testing.T) { }) } -func TestGoogleZones(t *testing.T) { - provider := newGoogleProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.gcp.zalan.do."}), provider.NewZoneIDFilter([]string{""}), false, []*endpoint.Endpoint{}) - - zones, err := provider.Zones(context.Background()) - require.NoError(t, err) - - validateZones(t, zones, map[string]*dns.ManagedZone{ - "zone-1-ext-dns-test-2-gcp-zalan-do": {Name: "zone-1-ext-dns-test-2-gcp-zalan-do", DnsName: "zone-1.ext-dns-test-2.gcp.zalan.do."}, - "zone-2-ext-dns-test-2-gcp-zalan-do": {Name: "zone-2-ext-dns-test-2-gcp-zalan-do", DnsName: "zone-2.ext-dns-test-2.gcp.zalan.do."}, - "zone-3-ext-dns-test-2-gcp-zalan-do": {Name: "zone-3-ext-dns-test-2-gcp-zalan-do", DnsName: "zone-3.ext-dns-test-2.gcp.zalan.do."}, - }) -} - func TestGoogleRecords(t *testing.T) { originalEndpoints := []*endpoint.Endpoint{ endpoint.NewEndpointWithTTL("list-test.zone-1.ext-dns-test-2.gcp.zalan.do", endpoint.RecordTypeA, endpoint.TTL(1), "1.2.3.4"), @@ -268,7 +269,7 @@ func TestGoogleRecords(t *testing.T) { endpoint.NewEndpointWithTTL("list-test-alias.zone-1.ext-dns-test-2.gcp.zalan.do", endpoint.RecordTypeCNAME, endpoint.TTL(3), "foo.elb.amazonaws.com"), } - provider := newGoogleProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.gcp.zalan.do."}), provider.NewZoneIDFilter([]string{""}), false, originalEndpoints) + provider := newGoogleProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.gcp.zalan.do."}), provider.NewZoneIDFilter([]string{""}), false, originalEndpoints, nil, nil) records, err := provider.Records(context.Background()) require.NoError(t, err) @@ -299,6 +300,8 @@ func TestGoogleRecordsFilter(t *testing.T) { provider.NewZoneIDFilter([]string{""}), false, originalEndpoints, + nil, + nil, ) // these records should be filtered out since they don't match a hosted zone or domain filter. @@ -343,6 +346,8 @@ func TestGoogleApplyChanges(t *testing.T) { endpoint.NewEndpointWithTTL("update-test-cname.zone-1.ext-dns-test-2.gcp.zalan.do", endpoint.RecordTypeCNAME, googleRecordTTL, "bar.elb.amazonaws.com"), endpoint.NewEndpointWithTTL("delete-test-cname.zone-1.ext-dns-test-2.gcp.zalan.do", endpoint.RecordTypeCNAME, googleRecordTTL, "qux.elb.amazonaws.com"), }, + nil, + nil, ) createRecords := []*endpoint.Endpoint{ @@ -407,7 +412,7 @@ func TestGoogleApplyChangesDryRun(t *testing.T) { endpoint.NewEndpointWithTTL("delete-test-cname.zone-1.ext-dns-test-2.gcp.zalan.do", endpoint.RecordTypeCNAME, googleRecordTTL, "qux.elb.amazonaws.com"), } - provider := newGoogleProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.gcp.zalan.do."}), provider.NewZoneIDFilter([]string{""}), true, originalEndpoints) + provider := newGoogleProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.gcp.zalan.do."}), provider.NewZoneIDFilter([]string{""}), true, originalEndpoints, nil, nil) createRecords := []*endpoint.Endpoint{ endpoint.NewEndpoint("create-test.zone-1.ext-dns-test-2.gcp.zalan.do", endpoint.RecordTypeA, "8.8.8.8"), @@ -449,12 +454,12 @@ func TestGoogleApplyChangesDryRun(t *testing.T) { } func TestGoogleApplyChangesEmpty(t *testing.T) { - provider := newGoogleProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.gcp.zalan.do."}), provider.NewZoneIDFilter([]string{""}), false, []*endpoint.Endpoint{}) + provider := newGoogleProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.gcp.zalan.do."}), provider.NewZoneIDFilter([]string{""}), false, []*endpoint.Endpoint{}, nil, nil) assert.NoError(t, provider.ApplyChanges(context.Background(), &plan.Changes{})) } func TestNewFilteredRecords(t *testing.T) { - provider := newGoogleProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.gcp.zalan.do."}), provider.NewZoneIDFilter([]string{""}), false, []*endpoint.Endpoint{}) + provider := newGoogleProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.gcp.zalan.do."}), provider.NewZoneIDFilter([]string{""}), false, []*endpoint.Endpoint{}, nil, nil) records := provider.newFilteredRecords([]*endpoint.Endpoint{ endpoint.NewEndpointWithTTL("update-test.zone-2.ext-dns-test-2.gcp.zalan.do", endpoint.RecordTypeA, 1, "8.8.4.4"), @@ -603,6 +608,26 @@ func TestGoogleBatchChangeSetExceedingNameChange(t *testing.T) { require.Equal(t, 0, len(batchCs)) } +func TestSoftErrListZonesConflict(t *testing.T) { + p := newGoogleProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.gcp.zalan.do."}), provider.NewZoneIDFilter([]string{}), false, []*endpoint.Endpoint{}, provider.NewSoftError(fmt.Errorf("failed to list zones")), nil) + + zones, err := p.Zones(context.Background()) + require.Error(t, err) + require.ErrorIs(t, err, provider.SoftError) + + require.Empty(t, zones) +} + +func TestSoftErrListRecordsConflict(t *testing.T) { + p := newGoogleProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.gcp.zalan.do."}), provider.NewZoneIDFilter([]string{}), false, []*endpoint.Endpoint{}, nil, provider.NewSoftError(fmt.Errorf("failed to list records in zone"))) + + records, err := p.Records(context.Background()) + require.Error(t, err) + require.ErrorIs(t, err, provider.SoftError) + + require.Empty(t, records) +} + func sortChangesByName(cs *dns.Change) { sort.SliceStable(cs.Additions, func(i, j int) bool { return cs.Additions[i].Name < cs.Additions[j].Name @@ -714,15 +739,19 @@ func newGoogleProviderZoneOverlap(t *testing.T, domainFilter endpoint.DomainFilt return provider } -func newGoogleProvider(t *testing.T, domainFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, dryRun bool, records []*endpoint.Endpoint) *GoogleProvider { +func newGoogleProvider(t *testing.T, domainFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, dryRun bool, records []*endpoint.Endpoint, zonesErr, recordsErr error) *GoogleProvider { provider := &GoogleProvider{ - project: "zalando-external-dns-test", - dryRun: false, - domainFilter: domainFilter, - zoneIDFilter: zoneIDFilter, - resourceRecordSetsClient: &mockResourceRecordSetsClient{}, - managedZonesClient: &mockManagedZonesClient{}, - changesClient: &mockChangesClient{}, + project: "zalando-external-dns-test", + dryRun: false, + domainFilter: domainFilter, + zoneIDFilter: zoneIDFilter, + resourceRecordSetsClient: &mockResourceRecordSetsClient{ + recordsErr: recordsErr, + }, + managedZonesClient: &mockManagedZonesClient{ + zonesErr: zonesErr, + }, + changesClient: &mockChangesClient{}, } createZone(t, provider, &dns.ManagedZone{ @@ -753,10 +782,10 @@ func newGoogleProvider(t *testing.T, domainFilter endpoint.DomainFilter, zoneIDF return provider } -func createZone(t *testing.T, provider *GoogleProvider, zone *dns.ManagedZone) { +func createZone(t *testing.T, p *GoogleProvider, zone *dns.ManagedZone) { zone.Description = "Testing zone for kubernetes.io/external-dns" - if _, err := provider.managedZonesClient.Create("zalando-external-dns-test", zone).Do(); err != nil { + if _, err := p.managedZonesClient.Create("zalando-external-dns-test", zone).Do(); err != nil { if err, ok := err.(*googleapi.Error); !ok || err.Code != http.StatusConflict { require.NoError(t, err) } @@ -769,8 +798,7 @@ func setupGoogleRecords(t *testing.T, provider *GoogleProvider, endpoints []*end clearGoogleRecords(t, provider, "zone-3-ext-dns-test-2-gcp-zalan-do") ctx := context.Background() - records, err := provider.Records(ctx) - require.NoError(t, err) + records, _ := provider.Records(ctx) validateEndpoints(t, records, []*endpoint.Endpoint{}) @@ -778,15 +806,15 @@ func setupGoogleRecords(t *testing.T, provider *GoogleProvider, endpoints []*end Create: endpoints, })) - records, err = provider.Records(ctx) - require.NoError(t, err) + records, _ = provider.Records(ctx) validateEndpoints(t, records, endpoints) } func clearGoogleRecords(t *testing.T, provider *GoogleProvider, zone string) { recordSets := []*dns.ResourceRecordSet{} - require.NoError(t, provider.resourceRecordSetsClient.List(provider.project, zone).Pages(context.Background(), func(resp *dns.ResourceRecordSetsListResponse) error { + + provider.resourceRecordSetsClient.List(provider.project, zone).Pages(context.Background(), func(resp *dns.ResourceRecordSetsListResponse) error { for _, r := range resp.Rrsets { switch r.Type { case endpoint.RecordTypeA, endpoint.RecordTypeCNAME: @@ -794,7 +822,7 @@ func clearGoogleRecords(t *testing.T, provider *GoogleProvider, zone string) { } } return nil - })) + }) if len(recordSets) != 0 { _, err := provider.changesClient.Create(provider.project, zone, &dns.Change{ From a9fc7d248f813a5595d206dc6e7c44675ff430a9 Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Tue, 10 Sep 2024 21:49:30 +0100 Subject: [PATCH 39/82] feat(chart): Updated image to v0.15.0 Signed-off-by: Steve Hipwell --- charts/external-dns/CHANGELOG.md | 15 +++++++++++---- charts/external-dns/Chart.yaml | 22 ++++++++++------------ charts/external-dns/README.md | 4 ++-- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/charts/external-dns/CHANGELOG.md b/charts/external-dns/CHANGELOG.md index a7c530843..02b467e1d 100644 --- a/charts/external-dns/CHANGELOG.md +++ b/charts/external-dns/CHANGELOG.md @@ -18,12 +18,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [UNRELEASED] +## [v1.15.0] - 2023-09-10 + +### Changed + +- Updated _ExternalDNS_ OCI image version to [v0.15.0](https://github.com/kubernetes-sigs/external-dns/releases/tag/v0.15.0). ([#xxxx](https://github.com/kubernetes-sigs/external-dns/pull/xxxx)) _@stevehipwell_ + ### Fixed -- Fixed `provider.webhook.resources` behavior to correctly leverage resource limits ([#4560](https://github.com/kubernetes-sigs/external-dns/pull/4560)) -- Fixed `provider.webhook.imagePullPolicy` behavior to correctly leverage pull policy ([#4643](https://github.com/kubernetes-sigs/external-dns/pull/4643)) _@kimsondrup_ -- Add correct webhook metric port to `Service` and `ServiceMonitor` ([#4643](https://github.com/kubernetes-sigs/external-dns/pull/4643)) _@kimsondrup_ -- No longer require the unauthenticated webhook provider port to be exposed for health probes ([#4691](https://github.com/kubernetes-sigs/external-dns/pull/4691)) _@kimsondrup_ _@hatrx_ +- Fixed `provider.webhook.resources` behavior to correctly leverage resource limits. ([#4560](https://github.com/kubernetes-sigs/external-dns/pull/4560)) _@crutonjohn_ +- Fixed `provider.webhook.imagePullPolicy` behavior to correctly leverage pull policy. ([#4643](https://github.com/kubernetes-sigs/external-dns/pull/4643)) _@kimsondrup_ +- Fixed to add correct webhook metric port to `Service` and `ServiceMonitor`. ([#4643](https://github.com/kubernetes-sigs/external-dns/pull/4643)) _@kimsondrup_ +- Fixed to no longer require the unauthenticated webhook provider port to be exposed for health probes. ([#4691](https://github.com/kubernetes-sigs/external-dns/pull/4691)) _@kimsondrup_ & _@hatrx_ ## [v1.14.5] - 2023-06-10 @@ -194,6 +200,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 RELEASE LINKS --> [UNRELEASED]: https://github.com/kubernetes-sigs/external-dns/tree/master/charts/external-dns +[v1.15.0]: https://github.com/kubernetes-sigs/external-dns/releases/tag/external-dns-helm-chart-1.15.0 [v1.14.5]: https://github.com/kubernetes-sigs/external-dns/releases/tag/external-dns-helm-chart-1.14.5 [v1.14.4]: https://github.com/kubernetes-sigs/external-dns/releases/tag/external-dns-helm-chart-1.14.4 [v1.14.3]: https://github.com/kubernetes-sigs/external-dns/releases/tag/external-dns-helm-chart-1.14.3 diff --git a/charts/external-dns/Chart.yaml b/charts/external-dns/Chart.yaml index 51f284c8e..ebde66ee3 100644 --- a/charts/external-dns/Chart.yaml +++ b/charts/external-dns/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: external-dns description: ExternalDNS synchronizes exposed Kubernetes Services and Ingresses with DNS providers. type: application -version: 1.14.5 -appVersion: 0.14.2 +version: 1.15.0 +appVersion: 0.15.0 keywords: - kubernetes - externaldns @@ -20,15 +20,13 @@ maintainers: email: steve.hipwell@gmail.com annotations: artifacthub.io/changes: | - - kind: added - description: "Added support for `extraContainers` argument." - - kind: added - description: "Added support for setting `excludeDomains` argument." - kind: changed - description: "Updated _ExternalDNS_ OCI image version to [v0.14.2](https://github.com/kubernetes-sigs/external-dns/releases/tag/v0.14.2)." - - kind: changed - description: "Updated `DNSEndpoint` CRD." - - kind: changed - description: "Changed the implementation for `revisionHistoryLimit` to be more generic." + description: "Updated _ExternalDNS_ OCI image version to [v0.15.0](https://github.com/kubernetes-sigs/external-dns/releases/tag/v0.15.0)." - kind: fixed - description: "Fixed the `ServiceMonitor` job name to correctly use the instance label." + description: "Fixed `provider.webhook.resources` behavior to correctly leverage resource limits." + - kind: fixed + description: "Fixed `provider.webhook.imagePullPolicy` behavior to correctly leverage pull policy." + - kind: fixed + description: "Fixed to add correct webhook metric port to `Service` and `ServiceMonitor`." + - kind: fixed + description: "Fixed to no longer require the unauthenticated webhook provider port to be exposed for health probes." diff --git a/charts/external-dns/README.md b/charts/external-dns/README.md index 01791c4a1..9b21ecdec 100644 --- a/charts/external-dns/README.md +++ b/charts/external-dns/README.md @@ -1,6 +1,6 @@ # external-dns -![Version: 1.14.5](https://img.shields.io/badge/Version-1.14.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.14.2](https://img.shields.io/badge/AppVersion-0.14.2-informational?style=flat-square) +![Version: 1.15.0](https://img.shields.io/badge/Version-1.15.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.15.0](https://img.shields.io/badge/AppVersion-0.15.0-informational?style=flat-square) ExternalDNS synchronizes exposed Kubernetes Services and Ingresses with DNS providers. @@ -27,7 +27,7 @@ helm repo add external-dns https://kubernetes-sigs.github.io/external-dns/ After you've installed the repo you can install the chart. ```shell -helm upgrade --install external-dns external-dns/external-dns --version 1.14.5 +helm upgrade --install external-dns external-dns/external-dns --version 1.15.0 ``` ## Providers From cd55194b0cb16c726180fd062aa61168fb651abb Mon Sep 17 00:00:00 2001 From: Kim Sondrup Date: Thu, 12 Sep 2024 13:32:50 +0200 Subject: [PATCH 40/82] docs: add reference to Netic's TidyDNS webhook provider --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2aea7367a..bba0c9480 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ Known providers using webhooks: | IONOS | https://github.com/ionos-cloud/external-dns-ionos-webhook | | Infoblox | https://github.com/AbsaOSS/external-dns-infoblox-webhook | | Netcup | https://github.com/mrueg/external-dns-netcup-webhook | +| Netic | https://github.com/neticdk/external-dns-tidydns-webhook | | RouterOS | https://github.com/benfiola/external-dns-routeros-provider | | STACKIT | https://github.com/stackitcloud/external-dns-stackit-webhook | | Unifi | https://github.com/kashalls/external-dns-unifi-webhook | From 08c9329430bf21472fc9e8acba7b81df863c4e54 Mon Sep 17 00:00:00 2001 From: PeterVanek <77848828+PeterVanek@users.noreply.github.com> Date: Fri, 13 Sep 2024 12:09:21 +0200 Subject: [PATCH 41/82] Update README.md with Efficient IP Provider Added doc for Efficient IP external-dns webhook plugin --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2aea7367a..9260fa433 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ Known providers using webhooks: | Adguard Home Provider | https://github.com/muhlba91/external-dns-provider-adguard | | Anexia | https://github.com/ProbstenHias/external-dns-anexia-webhook | | Bizfly Cloud | https://github.com/bizflycloud/external-dns-bizflycloud-webhook | +| Efficient IP | https://github.com/EfficientIP-Labs/external-dns-efficientip-webhook | | Gcore | https://github.com/G-Core/external-dns-gcore-webhook | | GleSYS | https://github.com/glesys/external-dns-glesys | | Hetzner | https://github.com/mconfalonieri/external-dns-hetzner-webhook | From 3830fb29c60f7f0b3db3caf1774843727a0641e7 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sat, 14 Sep 2024 10:03:49 +0100 Subject: [PATCH 42/82] wip Signed-off-by: ivan katliarchuk --- provider/aws/aws.go | 434 ++++++++++---------- provider/aws/aws_test.go | 857 +++++++++++++++++---------------------- 2 files changed, 587 insertions(+), 704 deletions(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index b2effb867..fd06c65ec 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -20,16 +20,14 @@ import ( "context" "errors" "fmt" - "regexp" "sort" "strconv" "strings" "time" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/route53" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/route53" + route53types "github.com/aws/aws-sdk-go-v2/service/route53/types" log "github.com/sirupsen/logrus" "sigs.k8s.io/external-dns/endpoint" @@ -42,11 +40,11 @@ const ( recordTTL = 300 // From the experiments, it seems that the default MaxItems applied is 100, // and that, on the server side, there is a hard limit of 300 elements per page. - // After a discussion with AWS representants, clients should accept - // when less items are returned, and still paginate accordingly. + // After a discussion with AWS representatives, clients should accept + // when fewer items are returned, and still paginate accordingly. // As we are using the standard AWS client, this should already be compliant. - // Hence, ifever AWS decides to raise this limit, we will automatically reduce the pressure on rate limits - route53PageSize = "300" + // Hence, if AWS ever decides to raise this limit, we will automatically reduce the pressure on rate limits + route53PageSize int32 = 300 // providerSpecificAlias specifies whether a CNAME endpoint maps to an AWS ALIAS record. providerSpecificAlias = "alias" providerSpecificTargetHostedZone = "aws/target-hosted-zone" @@ -200,16 +198,16 @@ var canonicalHostedZones = map[string]string{ // Route53API is the subset of the AWS Route53 API that we actually use. Add methods as required. Signatures must match exactly. // mostly taken from: https://github.com/kubernetes/kubernetes/blob/853167624edb6bc0cfdcdfb88e746e178f5db36c/federation/pkg/dnsprovider/providers/aws/route53/stubs/route53api.go type Route53API interface { - ListResourceRecordSetsPagesWithContext(ctx context.Context, input *route53.ListResourceRecordSetsInput, fn func(resp *route53.ListResourceRecordSetsOutput, lastPage bool) (shouldContinue bool), opts ...request.Option) error - ChangeResourceRecordSetsWithContext(ctx context.Context, input *route53.ChangeResourceRecordSetsInput, opts ...request.Option) (*route53.ChangeResourceRecordSetsOutput, error) - CreateHostedZoneWithContext(ctx context.Context, input *route53.CreateHostedZoneInput, opts ...request.Option) (*route53.CreateHostedZoneOutput, error) - ListHostedZonesPagesWithContext(ctx context.Context, input *route53.ListHostedZonesInput, fn func(resp *route53.ListHostedZonesOutput, lastPage bool) (shouldContinue bool), opts ...request.Option) error - ListTagsForResourceWithContext(ctx context.Context, input *route53.ListTagsForResourceInput, opts ...request.Option) (*route53.ListTagsForResourceOutput, error) + ListResourceRecordSets(ctx context.Context, input *route53.ListResourceRecordSetsInput, optFns ...func(options *route53.Options)) (*route53.ListResourceRecordSetsOutput, error) + ChangeResourceRecordSets(ctx context.Context, input *route53.ChangeResourceRecordSetsInput, optFns ...func(options *route53.Options)) (*route53.ChangeResourceRecordSetsOutput, error) + CreateHostedZone(ctx context.Context, input *route53.CreateHostedZoneInput, optFns ...func(*route53.Options)) (*route53.CreateHostedZoneOutput, error) + ListHostedZones(ctx context.Context, input *route53.ListHostedZonesInput, optFns ...func(options *route53.Options)) (*route53.ListHostedZonesOutput, error) + ListTagsForResource(ctx context.Context, input *route53.ListTagsForResourceInput, optFns ...func(options *route53.Options)) (*route53.ListTagsForResourceOutput, error) } // wrapper to handle ownership relation throughout the provider implementation type Route53Change struct { - route53.Change + route53types.Change OwnedRecord string sizeBytes int sizeValues int @@ -219,13 +217,13 @@ type Route53Changes []*Route53Change type profiledZone struct { profile string - zone *route53.HostedZone + zone *route53types.HostedZone } -func (cs Route53Changes) Route53Changes() []*route53.Change { - ret := []*route53.Change{} +func (cs Route53Changes) Route53Changes() []route53types.Change { + ret := []route53types.Change{} for _, c := range cs { - ret = append(ret, &c.Change) + ret = append(ret, c.Change) } return ret } @@ -254,7 +252,7 @@ type AWSProvider struct { zoneTypeFilter provider.ZoneTypeFilter // filter hosted zones by tags zoneTagFilter provider.ZoneTagFilter - // extend filter for sub-domains in the zone (e.g. first.us-east-1.example.com) + // extend filter for subdomains in the zone (e.g. first.us-east-1.example.com) zoneMatchParent bool preferCNAME bool zonesCache *zonesListCache @@ -303,13 +301,13 @@ func NewAWSProvider(awsConfig AWSConfig, clients map[string]Route53API) (*AWSPro } // Zones returns the list of hosted zones. -func (p *AWSProvider) Zones(ctx context.Context) (map[string]*route53.HostedZone, error) { +func (p *AWSProvider) Zones(ctx context.Context) (map[string]*route53types.HostedZone, error) { zones, err := p.zones(ctx) if err != nil { return nil, err } - result := make(map[string]*route53.HostedZone, len(zones)) + result := make(map[string]*route53types.HostedZone, len(zones)) for id, zone := range zones { result[id] = zone.zone } @@ -325,61 +323,57 @@ func (p *AWSProvider) zones(ctx context.Context) (map[string]*profiledZone, erro log.Debug("Refreshing zones list cache") zones := make(map[string]*profiledZone) - var profile string - var tagErr error - f := func(resp *route53.ListHostedZonesOutput, lastPage bool) (shouldContinue bool) { - for _, zone := range resp.HostedZones { - if !p.zoneIDFilter.Match(aws.StringValue(zone.Id)) { - continue - } - if !p.zoneTypeFilter.Match(zone) { - continue - } + for profile, client := range p.clients { + var tagErr error + paginator := route53.NewListHostedZonesPaginator(client, &route53.ListHostedZonesInput{}) - if !p.domainFilter.Match(aws.StringValue(zone.Name)) { - if !p.zoneMatchParent { - continue - } - if !p.domainFilter.MatchParent(aws.StringValue(zone.Name)) { - continue - } - } - - // Only fetch tags if a tag filter was specified - if !p.zoneTagFilter.IsEmpty() { - tags, err := p.tagsForZone(ctx, *zone.Id, profile) - if err != nil { - tagErr = err - return false - } - if !p.zoneTagFilter.Match(tags) { - continue - } - } - - zones[aws.StringValue(zone.Id)] = &profiledZone{ - profile: profile, - zone: zone, - } - } - - return true - } - - for p, client := range p.clients { - profile = p - err := client.ListHostedZonesPagesWithContext(ctx, &route53.ListHostedZonesInput{}, f) - if err != nil { - var awsErr awserr.Error - if errors.As(err, &awsErr) { - if awsErr.Code() == route53.ErrCodeThrottlingException { - log.Warnf("Skipping AWS profile %q due to provider side throttling: %v", profile, awsErr.Message()) + for paginator.HasMorePages() { + resp, err := paginator.NextPage(ctx) + if err != nil { + var te *route53types.ThrottlingException + if errors.As(err, &te) { + log.Infof("Skipping AWS profile %q due to provider side throttling: %v", profile, te.ErrorMessage()) continue } // nothing to do here. Falling through to general error handling + return nil, provider.NewSoftError(fmt.Errorf("failed to list hosted zones: %w", err)) + } + for _, zone := range resp.HostedZones { + if !p.zoneIDFilter.Match(*zone.Id) { + continue + } + + if !p.zoneTypeFilter.Match(zone) { + continue + } + + if !p.domainFilter.Match(*zone.Name) { + if !p.zoneMatchParent { + continue + } + if !p.domainFilter.MatchParent(*zone.Name) { + continue + } + } + + // Only fetch tags if a tag filter was specified + if !p.zoneTagFilter.IsEmpty() { + tags, err := p.tagsForZone(ctx, *zone.Id, profile) + if err != nil { + tagErr = err + break + } + if !p.zoneTagFilter.Match(tags) { + continue + } + } + + zones[*zone.Id] = &profiledZone{ + profile: profile, + zone: &zone, + } } - return nil, provider.NewSoftError(fmt.Errorf("failed to list hosted zones: %w", err)) } if tagErr != nil { return nil, provider.NewSoftError(fmt.Errorf("failed to list zones tags: %w", tagErr)) @@ -387,7 +381,7 @@ func (p *AWSProvider) zones(ctx context.Context) (map[string]*profiledZone, erro } for _, zone := range zones { - log.Debugf("Considering zone: %s (domain: %s)", aws.StringValue(zone.zone.Id), aws.StringValue(zone.zone.Name)) + log.Debugf("Considering zone: %s (domain: %s)", *zone.zone.Id, *zone.zone.Name) } if p.zonesCache.duration > time.Duration(0) { @@ -404,28 +398,6 @@ func wildcardUnescape(s string) string { return strings.Replace(s, "\\052", "*", 1) } -// See https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html -// convertOctalToAscii decodes inputs that contain octal escape sequences into their original ASCII characters. -// The function returns converted string where any octal escape sequences have been replaced with their corresponding ASCII characters. -func convertOctalToAscii(input string) string { - if !containsOctalSequence(input) { - return input - } - result, err := strconv.Unquote("\"" + input + "\"") - if err != nil { - return input - } - return result -} - -// validateDomainName checks if the domain name contains valid octal escape sequences. -func containsOctalSequence(domain string) bool { - // Pattern to match valid octal escape sequences - octalEscapePattern := `\\[0-3][0-7]{2}` - octalEscapeRegex := regexp.MustCompile(octalEscapePattern) - return octalEscapeRegex.MatchString(domain) -} - // Records returns the list of records in a given hosted zone. func (p *AWSProvider) Records(ctx context.Context) (endpoints []*endpoint.Endpoint, _ error) { zones, err := p.zones(ctx) @@ -438,93 +410,93 @@ func (p *AWSProvider) Records(ctx context.Context) (endpoints []*endpoint.Endpoi func (p *AWSProvider) records(ctx context.Context, zones map[string]*profiledZone) ([]*endpoint.Endpoint, error) { endpoints := make([]*endpoint.Endpoint, 0) - f := func(resp *route53.ListResourceRecordSetsOutput, lastPage bool) (shouldContinue bool) { - for _, r := range resp.ResourceRecordSets { - newEndpoints := make([]*endpoint.Endpoint, 0) - - if !p.SupportedRecordType(aws.StringValue(r.Type)) { - continue - } - - name := convertOctalToAscii(wildcardUnescape(aws.StringValue(r.Name))) - - var ttl endpoint.TTL - if r.TTL != nil { - ttl = endpoint.TTL(*r.TTL) - } - - if len(r.ResourceRecords) > 0 { - targets := make([]string, len(r.ResourceRecords)) - for idx, rr := range r.ResourceRecords { - targets[idx] = aws.StringValue(rr.Value) - } - ep := endpoint.NewEndpointWithTTL(name, aws.StringValue(r.Type), ttl, targets...) - if aws.StringValue(r.Type) == endpoint.RecordTypeCNAME { - ep = ep.WithProviderSpecific(providerSpecificAlias, "false") - } - newEndpoints = append(newEndpoints, ep) - } - - if r.AliasTarget != nil { - // Alias records don't have TTLs so provide the default to match the TXT generation - if ttl == 0 { - ttl = recordTTL - } - ep := endpoint. - NewEndpointWithTTL(name, endpoint.RecordTypeA, ttl, aws.StringValue(r.AliasTarget.DNSName)). - WithProviderSpecific(providerSpecificEvaluateTargetHealth, fmt.Sprintf("%t", aws.BoolValue(r.AliasTarget.EvaluateTargetHealth))). - WithProviderSpecific(providerSpecificAlias, "true") - newEndpoints = append(newEndpoints, ep) - } - - for _, ep := range newEndpoints { - if r.SetIdentifier != nil { - ep.SetIdentifier = aws.StringValue(r.SetIdentifier) - switch { - case r.Weight != nil: - ep.WithProviderSpecific(providerSpecificWeight, fmt.Sprintf("%d", aws.Int64Value(r.Weight))) - case r.Region != nil: - ep.WithProviderSpecific(providerSpecificRegion, aws.StringValue(r.Region)) - case r.Failover != nil: - ep.WithProviderSpecific(providerSpecificFailover, aws.StringValue(r.Failover)) - case r.MultiValueAnswer != nil && aws.BoolValue(r.MultiValueAnswer): - ep.WithProviderSpecific(providerSpecificMultiValueAnswer, "") - case r.GeoLocation != nil: - if r.GeoLocation.ContinentCode != nil { - ep.WithProviderSpecific(providerSpecificGeolocationContinentCode, aws.StringValue(r.GeoLocation.ContinentCode)) - } else { - if r.GeoLocation.CountryCode != nil { - ep.WithProviderSpecific(providerSpecificGeolocationCountryCode, aws.StringValue(r.GeoLocation.CountryCode)) - } - if r.GeoLocation.SubdivisionCode != nil { - ep.WithProviderSpecific(providerSpecificGeolocationSubdivisionCode, aws.StringValue(r.GeoLocation.SubdivisionCode)) - } - } - default: - // one of the above needs to be set, otherwise SetIdentifier doesn't make sense - } - } - - if r.HealthCheckId != nil { - ep.WithProviderSpecific(providerSpecificHealthCheckID, aws.StringValue(r.HealthCheckId)) - } - - endpoints = append(endpoints, ep) - } - } - - return true - } for _, z := range zones { - params := &route53.ListResourceRecordSetsInput{ - HostedZoneId: z.zone.Id, - MaxItems: aws.String(route53PageSize), - } - client := p.clients[z.profile] - if err := client.ListResourceRecordSetsPagesWithContext(ctx, params, f); err != nil { - return nil, fmt.Errorf("failed to list resource records sets for zone %s using aws profile %q: %w", *z.zone.Id, z.profile, err) + + paginator := route53.NewListResourceRecordSetsPaginator(client, &route53.ListResourceRecordSetsInput{ + HostedZoneId: z.zone.Id, + MaxItems: aws.Int32(route53PageSize), + }) + + for paginator.HasMorePages() { + resp, err := paginator.NextPage(ctx) + if err != nil { + return nil, fmt.Errorf("failed to list resource records sets for zone %s using aws profile %q: %w", *z.zone.Id, z.profile, err) + } + + for _, r := range resp.ResourceRecordSets { + newEndpoints := make([]*endpoint.Endpoint, 0) + + if !p.SupportedRecordType(r.Type) { + continue + } + + var ttl endpoint.TTL + if r.TTL != nil { + ttl = endpoint.TTL(*r.TTL) + } + + if len(r.ResourceRecords) > 0 { + targets := make([]string, len(r.ResourceRecords)) + for idx, rr := range r.ResourceRecords { + targets[idx] = *rr.Value + } + + ep := endpoint.NewEndpointWithTTL(wildcardUnescape(*r.Name), string(r.Type), ttl, targets...) + if r.Type == endpoint.RecordTypeCNAME { + ep = ep.WithProviderSpecific(providerSpecificAlias, "false") + } + newEndpoints = append(newEndpoints, ep) + } + + if r.AliasTarget != nil { + // Alias records don't have TTLs so provide the default to match the TXT generation + if ttl == 0 { + ttl = recordTTL + } + ep := endpoint. + NewEndpointWithTTL(wildcardUnescape(*r.Name), endpoint.RecordTypeA, ttl, *r.AliasTarget.DNSName). + WithProviderSpecific(providerSpecificEvaluateTargetHealth, fmt.Sprintf("%t", r.AliasTarget.EvaluateTargetHealth)). + WithProviderSpecific(providerSpecificAlias, "true") + newEndpoints = append(newEndpoints, ep) + } + + for _, ep := range newEndpoints { + if r.SetIdentifier != nil { + ep.SetIdentifier = *r.SetIdentifier + switch { + case r.Weight != nil: + ep.WithProviderSpecific(providerSpecificWeight, fmt.Sprintf("%d", *r.Weight)) + case r.Region != "": + ep.WithProviderSpecific(providerSpecificRegion, string(r.Region)) + case r.Failover != "": + ep.WithProviderSpecific(providerSpecificFailover, string(r.Failover)) + case r.MultiValueAnswer != nil && *r.MultiValueAnswer: + ep.WithProviderSpecific(providerSpecificMultiValueAnswer, "") + case r.GeoLocation != nil: + if r.GeoLocation.ContinentCode != nil { + ep.WithProviderSpecific(providerSpecificGeolocationContinentCode, *r.GeoLocation.ContinentCode) + } else { + if r.GeoLocation.CountryCode != nil { + ep.WithProviderSpecific(providerSpecificGeolocationCountryCode, *r.GeoLocation.CountryCode) + } + if r.GeoLocation.SubdivisionCode != nil { + ep.WithProviderSpecific(providerSpecificGeolocationSubdivisionCode, *r.GeoLocation.SubdivisionCode) + } + } + default: + // one of the above needs to be set, otherwise SetIdentifier doesn't make sense + } + } + + if r.HealthCheckId != nil { + ep.WithProviderSpecific(providerSpecificHealthCheckID, *r.HealthCheckId) + } + + endpoints = append(endpoints, ep) + } + } } } @@ -584,14 +556,14 @@ func (p *AWSProvider) createUpdateChanges(newEndpoints, oldEndpoints []*endpoint } combined := make(Route53Changes, 0, len(deletes)+len(creates)+len(updates)) - combined = append(combined, p.newChanges(route53.ChangeActionCreate, creates)...) - combined = append(combined, p.newChanges(route53.ChangeActionUpsert, updates)...) - combined = append(combined, p.newChanges(route53.ChangeActionDelete, deletes)...) + combined = append(combined, p.newChanges(route53types.ChangeActionCreate, creates)...) + combined = append(combined, p.newChanges(route53types.ChangeActionUpsert, updates)...) + combined = append(combined, p.newChanges(route53types.ChangeActionDelete, deletes)...) return combined } // GetDomainFilter generates a filter to exclude any domain that is not controlled by the provider -func (p *AWSProvider) GetDomainFilter() endpoint.DomainFilter { +func (p *AWSProvider) GetDomainFilter() endpoint.DomainFilterInterface { zones, err := p.Zones(context.Background()) if err != nil { log.Errorf("failed to list zones: %v", err) @@ -599,7 +571,7 @@ func (p *AWSProvider) GetDomainFilter() endpoint.DomainFilter { } zoneNames := []string(nil) for _, z := range zones { - zoneNames = append(zoneNames, aws.StringValue(z.Name), "."+aws.StringValue(z.Name)) + zoneNames = append(zoneNames, *z.Name, "."+*z.Name) } log.Infof("Applying provider record filter for domains: %v", zoneNames) return endpoint.NewDomainFilter(zoneNames) @@ -615,8 +587,8 @@ func (p *AWSProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) e updateChanges := p.createUpdateChanges(changes.UpdateNew, changes.UpdateOld) combinedChanges := make(Route53Changes, 0, len(changes.Delete)+len(changes.Create)+len(updateChanges)) - combinedChanges = append(combinedChanges, p.newChanges(route53.ChangeActionCreate, changes.Create)...) - combinedChanges = append(combinedChanges, p.newChanges(route53.ChangeActionDelete, changes.Delete)...) + combinedChanges = append(combinedChanges, p.newChanges(route53types.ChangeActionCreate, changes.Create)...) + combinedChanges = append(combinedChanges, p.newChanges(route53types.ChangeActionDelete, changes.Delete)...) combinedChanges = append(combinedChanges, updateChanges...) return p.submitChanges(ctx, combinedChanges, zones) @@ -639,7 +611,7 @@ func (p *AWSProvider) submitChanges(ctx context.Context, changes Route53Changes, var failedZones []string for z, cs := range changesByZone { log := log.WithFields(log.Fields{ - "zoneName": aws.StringValue(zones[z].zone.Name), + "zoneName": *zones[z].zone.Name, "zoneID": z, "profile": zones[z].profile, }) @@ -658,13 +630,13 @@ func (p *AWSProvider) submitChanges(ctx context.Context, changes Route53Changes, } for _, c := range b { - log.Infof("Desired change: %s %s %s", *c.Action, *c.ResourceRecordSet.Name, *c.ResourceRecordSet.Type) + log.Infof("Desired change: %s %s %s", c.Action, *c.ResourceRecordSet.Name, c.ResourceRecordSet.Type) } if !p.dryRun { params := &route53.ChangeResourceRecordSetsInput{ HostedZoneId: aws.String(z), - ChangeBatch: &route53.ChangeBatch{ + ChangeBatch: &route53types.ChangeBatch{ Changes: b.Route53Changes(), }, } @@ -672,8 +644,8 @@ func (p *AWSProvider) submitChanges(ctx context.Context, changes Route53Changes, successfulChanges := 0 client := p.clients[zones[z].profile] - if _, err := client.ChangeResourceRecordSetsWithContext(ctx, params); err != nil { - log.Errorf("Failure in zone %s when submitting change batch: %v", aws.StringValue(zones[z].zone.Name), err) + if _, err := client.ChangeResourceRecordSets(ctx, params); err != nil { + log.Errorf("Failure in zone %s when submitting change batch: %v", *zones[z].zone.Name, err) changesByOwnership := groupChangesByNameAndOwnershipRelation(b) @@ -682,12 +654,12 @@ func (p *AWSProvider) submitChanges(ctx context.Context, changes Route53Changes, for _, changes := range changesByOwnership { for _, c := range changes { - log.Debugf("Desired change: %s %s %s", *c.Action, *c.ResourceRecordSet.Name, *c.ResourceRecordSet.Type) + log.Debugf("Desired change: %s %s %s", c.Action, *c.ResourceRecordSet.Name, c.ResourceRecordSet.Type) } - params.ChangeBatch = &route53.ChangeBatch{ + params.ChangeBatch = &route53types.ChangeBatch{ Changes: changes.Route53Changes(), } - if _, err := client.ChangeResourceRecordSetsWithContext(ctx, params); err != nil { + if _, err := client.ChangeResourceRecordSets(ctx, params); err != nil { failedUpdate = true log.Errorf("Failed submitting change (error: %v), it will be retried in a separate change batch in the next iteration", err) p.failedChangesQueue[z] = append(p.failedChangesQueue[z], changes...) @@ -726,7 +698,7 @@ func (p *AWSProvider) submitChanges(ctx context.Context, changes Route53Changes, } // newChanges returns a collection of Changes based on the given records and action. -func (p *AWSProvider) newChanges(action string, endpoints []*endpoint.Endpoint) Route53Changes { +func (p *AWSProvider) newChanges(action route53types.ChangeAction, endpoints []*endpoint.Endpoint) Route53Changes { changes := make(Route53Changes, 0, len(endpoints)) for _, endpoint := range endpoints { @@ -735,8 +707,10 @@ func (p *AWSProvider) newChanges(action string, endpoints []*endpoint.Endpoint) if dualstack { // make a copy of change, modify RRS type to AAAA, then add new change rrs := *change.ResourceRecordSet - change2 := &Route53Change{Change: route53.Change{Action: change.Action, ResourceRecordSet: &rrs}} - change2.ResourceRecordSet.Type = aws.String(route53.RRTypeAaaa) + change2 := &Route53Change{ + Change: route53types.Change{Action: change.Action, ResourceRecordSet: &rrs}, + } + change2.ResourceRecordSet.Type = route53types.RRTypeAaaa changes = append(changes, change2) } } @@ -798,11 +772,11 @@ func (p *AWSProvider) AdjustEndpoints(endpoints []*endpoint.Endpoint) ([]*endpoi // returned Change is based on the given record by the given action, e.g. // action=ChangeActionCreate returns a change for creation of the record and // action=ChangeActionDelete returns a change for deletion of the record. -func (p *AWSProvider) newChange(action string, ep *endpoint.Endpoint) (*Route53Change, bool) { +func (p *AWSProvider) newChange(action route53types.ChangeAction, ep *endpoint.Endpoint) (*Route53Change, bool) { change := &Route53Change{ - Change: route53.Change{ - Action: aws.String(action), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: action, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(ep.DNSName), }, }, @@ -817,24 +791,24 @@ func (p *AWSProvider) newChange(action string, ep *endpoint.Endpoint) (*Route53C if val, ok := ep.Labels[endpoint.DualstackLabelKey]; ok { dualstack = val == "true" } - change.ResourceRecordSet.Type = aws.String(route53.RRTypeA) - change.ResourceRecordSet.AliasTarget = &route53.AliasTarget{ + change.ResourceRecordSet.Type = route53types.RRTypeA + change.ResourceRecordSet.AliasTarget = &route53types.AliasTarget{ DNSName: aws.String(ep.Targets[0]), HostedZoneId: aws.String(cleanZoneID(targetHostedZone)), - EvaluateTargetHealth: aws.Bool(evalTargetHealth), + EvaluateTargetHealth: evalTargetHealth, } change.sizeBytes += len([]byte(ep.Targets[0])) change.sizeValues += 1 } else { - change.ResourceRecordSet.Type = aws.String(ep.RecordType) + change.ResourceRecordSet.Type = route53types.RRType(ep.RecordType) if !ep.RecordTTL.IsConfigured() { change.ResourceRecordSet.TTL = aws.Int64(recordTTL) } else { change.ResourceRecordSet.TTL = aws.Int64(int64(ep.RecordTTL)) } - change.ResourceRecordSet.ResourceRecords = make([]*route53.ResourceRecord, len(ep.Targets)) + change.ResourceRecordSet.ResourceRecords = make([]route53types.ResourceRecord, len(ep.Targets)) for idx, val := range ep.Targets { - change.ResourceRecordSet.ResourceRecords[idx] = &route53.ResourceRecord{ + change.ResourceRecordSet.ResourceRecords[idx] = route53types.ResourceRecord{ Value: aws.String(val), } change.sizeBytes += len([]byte(val)) @@ -842,7 +816,7 @@ func (p *AWSProvider) newChange(action string, ep *endpoint.Endpoint) (*Route53C } } - if action == route53.ChangeActionUpsert { + if action == route53types.ChangeActionUpsert { // If the value of the Action element is UPSERT, each ResourceRecord element and each character in a Value // element is counted twice change.sizeBytes *= 2 @@ -861,16 +835,16 @@ func (p *AWSProvider) newChange(action string, ep *endpoint.Endpoint) (*Route53C change.ResourceRecordSet.Weight = aws.Int64(weight) } if prop, ok := ep.GetProviderSpecificProperty(providerSpecificRegion); ok { - change.ResourceRecordSet.Region = aws.String(prop) + change.ResourceRecordSet.Region = route53types.ResourceRecordSetRegion(prop) } if prop, ok := ep.GetProviderSpecificProperty(providerSpecificFailover); ok { - change.ResourceRecordSet.Failover = aws.String(prop) + change.ResourceRecordSet.Failover = route53types.ResourceRecordSetFailover(prop) } if _, ok := ep.GetProviderSpecificProperty(providerSpecificMultiValueAnswer); ok { change.ResourceRecordSet.MultiValueAnswer = aws.Bool(true) } - geolocation := &route53.GeoLocation{} + geolocation := &route53types.GeoLocation{} useGeolocation := false if prop, ok := ep.GetProviderSpecificProperty(providerSpecificGeolocationContinentCode); ok { geolocation.ContinentCode = aws.String(prop) @@ -932,7 +906,7 @@ func groupChangesByNameAndOwnershipRelation(cs Route53Changes) map[string]Route5 for _, v := range cs { key := v.OwnedRecord if key == "" { - key = aws.StringValue(v.ResourceRecordSet.Name) + key = *v.ResourceRecordSet.Name } changesByOwnership[key] = append(changesByOwnership[key], v) } @@ -942,8 +916,8 @@ func groupChangesByNameAndOwnershipRelation(cs Route53Changes) map[string]Route5 func (p *AWSProvider) tagsForZone(ctx context.Context, zoneID string, profile string) (map[string]string, error) { client := p.clients[profile] - response, err := client.ListTagsForResourceWithContext(ctx, &route53.ListTagsForResourceInput{ - ResourceType: aws.String("hostedzone"), + response, err := client.ListTagsForResource(ctx, &route53.ListTagsForResourceInput{ + ResourceType: route53types.TagResourceTypeHostedzone, ResourceId: aws.String(zoneID), }) if err != nil { @@ -1030,10 +1004,10 @@ func batchChangeSet(cs Route53Changes, batchSize int, batchSizeBytes int, batchS func sortChangesByActionNameType(cs Route53Changes) Route53Changes { sort.SliceStable(cs, func(i, j int) bool { - if *cs[i].Action > *cs[j].Action { + if cs[i].Action > cs[j].Action { return true } - if *cs[i].Action < *cs[j].Action { + if cs[i].Action < cs[j].Action { return false } if *cs[i].ResourceRecordSet.Name < *cs[j].ResourceRecordSet.Name { @@ -1042,7 +1016,7 @@ func sortChangesByActionNameType(cs Route53Changes) Route53Changes { if *cs[i].ResourceRecordSet.Name > *cs[j].ResourceRecordSet.Name { return false } - return *cs[i].ResourceRecordSet.Type < *cs[j].ResourceRecordSet.Type + return cs[i].ResourceRecordSet.Type < cs[j].ResourceRecordSet.Type }) return cs @@ -1053,34 +1027,34 @@ func changesByZone(zones map[string]*profiledZone, changeSet Route53Changes) map changes := make(map[string]Route53Changes) for _, z := range zones { - changes[aws.StringValue(z.zone.Id)] = Route53Changes{} + changes[*z.zone.Id] = Route53Changes{} } for _, c := range changeSet { - hostname := provider.EnsureTrailingDot(aws.StringValue(c.ResourceRecordSet.Name)) + hostname := provider.EnsureTrailingDot(*c.ResourceRecordSet.Name) zones := suitableZones(hostname, zones) if len(zones) == 0 { - log.Debugf("Skipping record %s because no hosted zone matching record DNS Name was detected", c.String()) + log.Debugf("Skipping record %s because no hosted zone matching record DNS Name was detected", *c.ResourceRecordSet.Name) continue } for _, z := range zones { - if c.ResourceRecordSet.AliasTarget != nil && aws.StringValue(c.ResourceRecordSet.AliasTarget.HostedZoneId) == sameZoneAlias { + if c.ResourceRecordSet.AliasTarget != nil && *c.ResourceRecordSet.AliasTarget.HostedZoneId == sameZoneAlias { // alias record is to be created; target needs to be in the same zone as endpoint // if it's not, this will fail rrset := *c.ResourceRecordSet aliasTarget := *rrset.AliasTarget - aliasTarget.HostedZoneId = aws.String(cleanZoneID(aws.StringValue(z.zone.Id))) + aliasTarget.HostedZoneId = aws.String(cleanZoneID(*z.zone.Id)) rrset.AliasTarget = &aliasTarget c = &Route53Change{ - Change: route53.Change{ + Change: route53types.Change{ Action: c.Action, ResourceRecordSet: &rrset, }, } } - changes[aws.StringValue(z.zone.Id)] = append(changes[aws.StringValue(z.zone.Id)], c) - log.Debugf("Adding %s to zone %s [Id: %s]", hostname, aws.StringValue(z.zone.Name), aws.StringValue(z.zone.Id)) + changes[*z.zone.Id] = append(changes[*z.zone.Id], c) + log.Debugf("Adding %s to zone %s [Id: %s]", hostname, *z.zone.Name, *z.zone.Id) } } @@ -1102,10 +1076,10 @@ func suitableZones(hostname string, zones map[string]*profiledZone) []*profiledZ var publicZone *profiledZone for _, z := range zones { - if aws.StringValue(z.zone.Name) == hostname || strings.HasSuffix(hostname, "."+aws.StringValue(z.zone.Name)) { - if z.zone.Config == nil || !aws.BoolValue(z.zone.Config.PrivateZone) { + if *z.zone.Name == hostname || strings.HasSuffix(hostname, "."+*z.zone.Name) { + if z.zone.Config == nil || !z.zone.Config.PrivateZone { // Only select the best matching public zone - if publicZone == nil || len(aws.StringValue(z.zone.Name)) > len(aws.StringValue(publicZone.zone.Name)) { + if publicZone == nil || len(*z.zone.Name) > len(*publicZone.zone.Name) { publicZone = z } } else { @@ -1180,11 +1154,11 @@ func cleanZoneID(id string) string { return strings.TrimPrefix(id, "/hostedzone/") } -func (p *AWSProvider) SupportedRecordType(recordType string) bool { +func (p *AWSProvider) SupportedRecordType(recordType route53types.RRType) bool { switch recordType { - case "MX": + case route53types.RRTypeMx: return true default: - return provider.SupportedRecordType(recordType) + return provider.SupportedRecordType(string(recordType)) } } diff --git a/provider/aws/aws_test.go b/provider/aws/aws_test.go index 4badf7421..806ed1d5c 100644 --- a/provider/aws/aws_test.go +++ b/provider/aws/aws_test.go @@ -26,9 +26,9 @@ import ( "testing" "time" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/route53" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/route53" + route53types "github.com/aws/aws-sdk-go-v2/service/route53/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" @@ -55,9 +55,9 @@ var _ Route53API = &Route53APIStub{} // of all of its methods. // mostly taken from: https://github.com/kubernetes/kubernetes/blob/853167624edb6bc0cfdcdfb88e746e178f5db36c/federation/pkg/dnsprovider/providers/aws/route53/stubs/route53api.go type Route53APIStub struct { - zones map[string]*route53.HostedZone - recordSets map[string]map[string][]*route53.ResourceRecordSet - zoneTags map[string][]*route53.Tag + zones map[string]*route53types.HostedZone + recordSets map[string]map[string][]route53types.ResourceRecordSet + zoneTags map[string][]route53types.Tag m dynamicMock t *testing.T } @@ -73,29 +73,27 @@ func (r *Route53APIStub) MockMethod(method string, args ...interface{}) *mock.Ca // NewRoute53APIStub returns an initialized Route53APIStub func NewRoute53APIStub(t *testing.T) *Route53APIStub { return &Route53APIStub{ - zones: make(map[string]*route53.HostedZone), - recordSets: make(map[string]map[string][]*route53.ResourceRecordSet), - zoneTags: make(map[string][]*route53.Tag), + zones: make(map[string]*route53types.HostedZone), + recordSets: make(map[string]map[string][]route53types.ResourceRecordSet), + zoneTags: make(map[string][]route53types.Tag), t: t, } } -func (r *Route53APIStub) ListResourceRecordSetsPagesWithContext(ctx context.Context, input *route53.ListResourceRecordSetsInput, fn func(p *route53.ListResourceRecordSetsOutput, lastPage bool) (shouldContinue bool), opts ...request.Option) error { - output := route53.ListResourceRecordSetsOutput{} // TODO: Support optional input args. +func (r *Route53APIStub) ListResourceRecordSets(ctx context.Context, input *route53.ListResourceRecordSetsInput, optFns ...func(options *route53.Options)) (*route53.ListResourceRecordSetsOutput, error) { + output := &route53.ListResourceRecordSetsOutput{} // TODO: Support optional input args. require.NotNil(r.t, input.MaxItems) assert.EqualValues(r.t, route53PageSize, *input.MaxItems) if len(r.recordSets) == 0 { - output.ResourceRecordSets = []*route53.ResourceRecordSet{} - } else if _, ok := r.recordSets[aws.StringValue(input.HostedZoneId)]; !ok { - output.ResourceRecordSets = []*route53.ResourceRecordSet{} + output.ResourceRecordSets = []route53types.ResourceRecordSet{} + } else if _, ok := r.recordSets[*input.HostedZoneId]; !ok { + output.ResourceRecordSets = []route53types.ResourceRecordSet{} } else { - for _, rrsets := range r.recordSets[aws.StringValue(input.HostedZoneId)] { + for _, rrsets := range r.recordSets[*input.HostedZoneId] { output.ResourceRecordSets = append(output.ResourceRecordSets, rrsets...) } } - lastPage := true - fn(&output, lastPage) - return nil + return output, nil } type Route53APICounter struct { @@ -110,29 +108,29 @@ func NewRoute53APICounter(w Route53API) *Route53APICounter { } } -func (c *Route53APICounter) ListResourceRecordSetsPagesWithContext(ctx context.Context, input *route53.ListResourceRecordSetsInput, fn func(resp *route53.ListResourceRecordSetsOutput, lastPage bool) (shouldContinue bool), opts ...request.Option) error { +func (c *Route53APICounter) ListResourceRecordSets(ctx context.Context, input *route53.ListResourceRecordSetsInput, optFns ...func(options *route53.Options)) (*route53.ListResourceRecordSetsOutput, error) { c.calls["ListResourceRecordSetsPages"]++ - return c.wrapped.ListResourceRecordSetsPagesWithContext(ctx, input, fn) + return c.wrapped.ListResourceRecordSets(ctx, input, optFns...) } -func (c *Route53APICounter) ChangeResourceRecordSetsWithContext(ctx context.Context, input *route53.ChangeResourceRecordSetsInput, opts ...request.Option) (*route53.ChangeResourceRecordSetsOutput, error) { +func (c *Route53APICounter) ChangeResourceRecordSets(ctx context.Context, input *route53.ChangeResourceRecordSetsInput, optFns ...func(*route53.Options)) (*route53.ChangeResourceRecordSetsOutput, error) { c.calls["ChangeResourceRecordSets"]++ - return c.wrapped.ChangeResourceRecordSetsWithContext(ctx, input) + return c.wrapped.ChangeResourceRecordSets(ctx, input, optFns...) } -func (c *Route53APICounter) CreateHostedZoneWithContext(ctx context.Context, input *route53.CreateHostedZoneInput, opts ...request.Option) (*route53.CreateHostedZoneOutput, error) { +func (c *Route53APICounter) CreateHostedZone(ctx context.Context, input *route53.CreateHostedZoneInput, optFns ...func(*route53.Options)) (*route53.CreateHostedZoneOutput, error) { c.calls["CreateHostedZone"]++ - return c.wrapped.CreateHostedZoneWithContext(ctx, input) + return c.wrapped.CreateHostedZone(ctx, input, optFns...) } -func (c *Route53APICounter) ListHostedZonesPagesWithContext(ctx context.Context, input *route53.ListHostedZonesInput, fn func(resp *route53.ListHostedZonesOutput, lastPage bool) (shouldContinue bool), opts ...request.Option) error { +func (c *Route53APICounter) ListHostedZones(ctx context.Context, input *route53.ListHostedZonesInput, optFns ...func(options *route53.Options)) (*route53.ListHostedZonesOutput, error) { c.calls["ListHostedZonesPages"]++ - return c.wrapped.ListHostedZonesPagesWithContext(ctx, input, fn) + return c.wrapped.ListHostedZones(ctx, input, optFns...) } -func (c *Route53APICounter) ListTagsForResourceWithContext(ctx context.Context, input *route53.ListTagsForResourceInput, opts ...request.Option) (*route53.ListTagsForResourceOutput, error) { +func (c *Route53APICounter) ListTagsForResource(ctx context.Context, input *route53.ListTagsForResourceInput, optFns ...func(options *route53.Options)) (*route53.ListTagsForResourceOutput, error) { c.calls["ListTagsForResource"]++ - return c.wrapped.ListTagsForResourceWithContext(ctx, input) + return c.wrapped.ListTagsForResource(ctx, input, optFns...) } // Route53 stores wildcards escaped: http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html?shortFooter=true#domain-name-format-asterisk @@ -143,25 +141,11 @@ func wildcardEscape(s string) string { return s } -// Route53 octal escapes https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html -func specialCharactersEscape(s string) string { - var result strings.Builder - for _, char := range s { - if (char >= 'a' && char <= 'z') || (char >= '0' && char <= '9') || char == '-' || char == '.' { - result.WriteRune(char) - } else { - octalCode := fmt.Sprintf("\\%03o", char) - result.WriteString(octalCode) - } - } - return result.String() -} - -func (r *Route53APIStub) ListTagsForResourceWithContext(ctx context.Context, input *route53.ListTagsForResourceInput, opts ...request.Option) (*route53.ListTagsForResourceOutput, error) { - if aws.StringValue(input.ResourceType) == "hostedzone" { - tags := r.zoneTags[aws.StringValue(input.ResourceId)] +func (r *Route53APIStub) ListTagsForResource(ctx context.Context, input *route53.ListTagsForResourceInput, optFns ...func(options *route53.Options)) (*route53.ListTagsForResourceOutput, error) { + if input.ResourceType == route53types.TagResourceTypeHostedzone { + tags := r.zoneTags[*input.ResourceId] return &route53.ListTagsForResourceOutput{ - ResourceTagSet: &route53.ResourceTagSet{ + ResourceTagSet: &route53types.ResourceTagSet{ ResourceId: input.ResourceId, ResourceType: input.ResourceType, Tags: tags, @@ -171,14 +155,14 @@ func (r *Route53APIStub) ListTagsForResourceWithContext(ctx context.Context, inp return &route53.ListTagsForResourceOutput{}, nil } -func (r *Route53APIStub) ChangeResourceRecordSetsWithContext(ctx context.Context, input *route53.ChangeResourceRecordSetsInput, opts ...request.Option) (*route53.ChangeResourceRecordSetsOutput, error) { +func (r *Route53APIStub) ChangeResourceRecordSets(ctx context.Context, input *route53.ChangeResourceRecordSetsInput, optFns ...func(options *route53.Options)) (*route53.ChangeResourceRecordSetsOutput, error) { if r.m.isMocked("ChangeResourceRecordSets", input) { return r.m.ChangeResourceRecordSets(input) } - _, ok := r.zones[aws.StringValue(input.HostedZoneId)] + _, ok := r.zones[*input.HostedZoneId] if !ok { - return nil, fmt.Errorf("Hosted zone doesn't exist: %s", aws.StringValue(input.HostedZoneId)) + return nil, fmt.Errorf("Hosted zone doesn't exist: %s", *input.HostedZoneId) } if len(input.ChangeBatch.Changes) == 0 { @@ -186,67 +170,65 @@ func (r *Route53APIStub) ChangeResourceRecordSetsWithContext(ctx context.Context } output := &route53.ChangeResourceRecordSetsOutput{} - recordSets, ok := r.recordSets[aws.StringValue(input.HostedZoneId)] + recordSets, ok := r.recordSets[*input.HostedZoneId] if !ok { - recordSets = make(map[string][]*route53.ResourceRecordSet) + recordSets = make(map[string][]route53types.ResourceRecordSet) } for _, change := range input.ChangeBatch.Changes { - if aws.StringValue(change.ResourceRecordSet.Type) == route53.RRTypeA { + if change.ResourceRecordSet.Type == route53types.RRTypeA { for _, rrs := range change.ResourceRecordSet.ResourceRecords { - if net.ParseIP(aws.StringValue(rrs.Value)) == nil { + if net.ParseIP(*rrs.Value) == nil { return nil, fmt.Errorf("A records must point to IPs") } } } - change.ResourceRecordSet.Name = aws.String(wildcardEscape(provider.EnsureTrailingDot(aws.StringValue(change.ResourceRecordSet.Name)))) + change.ResourceRecordSet.Name = aws.String(wildcardEscape(provider.EnsureTrailingDot(*change.ResourceRecordSet.Name))) if change.ResourceRecordSet.AliasTarget != nil { - change.ResourceRecordSet.AliasTarget.DNSName = aws.String(wildcardEscape(provider.EnsureTrailingDot(aws.StringValue(change.ResourceRecordSet.AliasTarget.DNSName)))) + change.ResourceRecordSet.AliasTarget.DNSName = aws.String(wildcardEscape(provider.EnsureTrailingDot(*change.ResourceRecordSet.AliasTarget.DNSName))) } setID := "" if change.ResourceRecordSet.SetIdentifier != nil { - setID = aws.StringValue(change.ResourceRecordSet.SetIdentifier) + setID = *change.ResourceRecordSet.SetIdentifier } - key := aws.StringValue(change.ResourceRecordSet.Name) + "::" + aws.StringValue(change.ResourceRecordSet.Type) + "::" + setID - switch aws.StringValue(change.Action) { - case route53.ChangeActionCreate: + key := *change.ResourceRecordSet.Name + "::" + string(change.ResourceRecordSet.Type) + "::" + setID + switch change.Action { + case route53types.ChangeActionCreate: if _, found := recordSets[key]; found { return nil, fmt.Errorf("Attempt to create duplicate rrset %s", key) // TODO: Return AWS errors with codes etc } - recordSets[key] = append(recordSets[key], change.ResourceRecordSet) - case route53.ChangeActionDelete: + recordSets[key] = append(recordSets[key], *change.ResourceRecordSet) + case route53types.ChangeActionDelete: if _, found := recordSets[key]; !found { return nil, fmt.Errorf("Attempt to delete non-existent rrset %s", key) // TODO: Check other fields too } delete(recordSets, key) - case route53.ChangeActionUpsert: - recordSets[key] = []*route53.ResourceRecordSet{change.ResourceRecordSet} + case route53types.ChangeActionUpsert: + recordSets[key] = []route53types.ResourceRecordSet{*change.ResourceRecordSet} } } - r.recordSets[aws.StringValue(input.HostedZoneId)] = recordSets + r.recordSets[*input.HostedZoneId] = recordSets return output, nil // TODO: We should ideally return status etc, but we don't' use that yet. } -func (r *Route53APIStub) ListHostedZonesPagesWithContext(ctx context.Context, input *route53.ListHostedZonesInput, fn func(p *route53.ListHostedZonesOutput, lastPage bool) (shouldContinue bool), opts ...request.Option) error { +func (r *Route53APIStub) ListHostedZones(ctx context.Context, input *route53.ListHostedZonesInput, optFns ...func(options *route53.Options)) (*route53.ListHostedZonesOutput, error) { output := &route53.ListHostedZonesOutput{} for _, zone := range r.zones { - output.HostedZones = append(output.HostedZones, zone) + output.HostedZones = append(output.HostedZones, *zone) } - lastPage := true - fn(output, lastPage) - return nil + return output, nil } -func (r *Route53APIStub) CreateHostedZoneWithContext(ctx context.Context, input *route53.CreateHostedZoneInput, opts ...request.Option) (*route53.CreateHostedZoneOutput, error) { - name := aws.StringValue(input.Name) +func (r *Route53APIStub) CreateHostedZone(ctx context.Context, input *route53.CreateHostedZoneInput, optFns ...func(options *route53.Options)) (*route53.CreateHostedZoneOutput, error) { + name := *input.Name id := "/hostedzone/" + name if _, ok := r.zones[id]; ok { return nil, fmt.Errorf("Error creating hosted DNS zone: %s already exists", id) } - r.zones[id] = &route53.HostedZone{ + r.zones[id] = &route53types.HostedZone{ Id: aws.String(id), Name: aws.String(name), Config: input.HostedZoneConfig, @@ -279,7 +261,7 @@ func (m *dynamicMock) isMocked(method string, arguments ...interface{}) bool { } func TestAWSZones(t *testing.T) { - publicZones := map[string]*route53.HostedZone{ + publicZones := map[string]*route53types.HostedZone{ "/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do.": { Id: aws.String("/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do."), Name: aws.String("zone-1.ext-dns-test-2.teapot.zalan.do."), @@ -290,14 +272,14 @@ func TestAWSZones(t *testing.T) { }, } - privateZones := map[string]*route53.HostedZone{ + privateZones := map[string]*route53types.HostedZone{ "/hostedzone/zone-3.ext-dns-test-2.teapot.zalan.do.": { Id: aws.String("/hostedzone/zone-3.ext-dns-test-2.teapot.zalan.do."), Name: aws.String("zone-3.ext-dns-test-2.teapot.zalan.do."), }, } - allZones := map[string]*route53.HostedZone{} + allZones := map[string]*route53types.HostedZone{} for k, v := range publicZones { allZones[k] = v } @@ -305,14 +287,14 @@ func TestAWSZones(t *testing.T) { allZones[k] = v } - noZones := map[string]*route53.HostedZone{} + noZones := map[string]*route53types.HostedZone{} for _, ti := range []struct { msg string zoneIDFilter provider.ZoneIDFilter zoneTypeFilter provider.ZoneTypeFilter zoneTagFilter provider.ZoneTagFilter - expectedZones map[string]*route53.HostedZone + expectedZones map[string]*route53types.HostedZone }{ {"no filter", provider.NewZoneIDFilter([]string{}), provider.NewZoneTypeFilter(""), provider.NewZoneTagFilter([]string{}), allZones}, {"public filter", provider.NewZoneIDFilter([]string{}), provider.NewZoneTypeFilter("public"), provider.NewZoneTagFilter([]string{}), publicZones}, @@ -321,22 +303,24 @@ func TestAWSZones(t *testing.T) { {"zone id filter", provider.NewZoneIDFilter([]string{"/hostedzone/zone-3.ext-dns-test-2.teapot.zalan.do."}), provider.NewZoneTypeFilter(""), provider.NewZoneTagFilter([]string{}), privateZones}, {"tag filter", provider.NewZoneIDFilter([]string{}), provider.NewZoneTypeFilter(""), provider.NewZoneTagFilter([]string{"zone=3"}), privateZones}, } { - provider, _ := newAWSProviderWithTagFilter(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.teapot.zalan.do."}), ti.zoneIDFilter, ti.zoneTypeFilter, ti.zoneTagFilter, defaultEvaluateTargetHealth, false, nil) + t.Run(ti.msg, func(t *testing.T) { + provider, _ := newAWSProviderWithTagFilter(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.teapot.zalan.do."}), ti.zoneIDFilter, ti.zoneTypeFilter, ti.zoneTagFilter, defaultEvaluateTargetHealth, false, nil) - zones, err := provider.Zones(context.Background()) - require.NoError(t, err) + zones, err := provider.Zones(context.Background()) + require.NoError(t, err) - validateAWSZones(t, zones, ti.expectedZones) + validateAWSZones(t, zones, ti.expectedZones) + }) } } func TestAWSRecordsFilter(t *testing.T) { provider, _ := newAWSProvider(t, endpoint.DomainFilter{}, provider.ZoneIDFilter{}, provider.ZoneTypeFilter{}, false, false, nil) domainFilter := provider.GetDomainFilter() - assert.NotNil(t, domainFilter) + require.NotNil(t, domainFilter) require.IsType(t, endpoint.DomainFilter{}, domainFilter) count := 0 - filters := domainFilter.Filters + filters := domainFilter.(endpoint.DomainFilter).Filters for _, tld := range []string{ "zone-4.ext-dns-test-3.teapot.zalan.do", ".zone-4.ext-dns-test-3.teapot.zalan.do", @@ -354,179 +338,157 @@ func TestAWSRecordsFilter(t *testing.T) { } func TestAWSRecords(t *testing.T) { - provider, _ := newAWSProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.teapot.zalan.do."}), provider.NewZoneIDFilter([]string{}), provider.NewZoneTypeFilter(""), false, false, []*route53.ResourceRecordSet{ + provider, _ := newAWSProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.teapot.zalan.do."}), provider.NewZoneIDFilter([]string{}), provider.NewZoneTypeFilter(""), false, false, []route53types.ResourceRecordSet{ { Name: aws.String("list-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, }, { Name: aws.String("list-test.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { - Name: aws.String(wildcardEscape("*.wildcard-test.zone-2.ext-dns-test-2.teapot.zalan.do.")), - Type: aws.String(route53.RRTypeA), + Name: aws.String("*.wildcard-test.zone-2.ext-dns-test-2.teapot.zalan.do."), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, - }, - { - Name: aws.String(specialCharactersEscape("escape-%!s()-codes.zone-2.ext-dns-test-2.teapot.zalan.do.")), - Type: aws.String(route53.RRTypeCname), - TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("example")}}, - }, - { - Name: aws.String(specialCharactersEscape("escape-%!s()-codes-a.zone-2.ext-dns-test-2.teapot.zalan.do.")), - Type: aws.String(route53.RRTypeA), - TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, - }, - { - Name: aws.String(specialCharactersEscape("escape-%!s()-codes-alias.zone-2.ext-dns-test-2.teapot.zalan.do.")), - Type: aws.String(route53.RRTypeA), - TTL: aws.Int64(recordTTL), - AliasTarget: &route53.AliasTarget{ - DNSName: aws.String("escape-codes.eu-central-1.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(false), - HostedZoneId: aws.String("Z215JYRZR1TBD5"), - }, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { Name: aws.String("list-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), - AliasTarget: &route53.AliasTarget{ + Type: route53types.RRTypeA, + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("foo.eu-central-1.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(false), + EvaluateTargetHealth: false, HostedZoneId: aws.String("Z215JYRZR1TBD5"), }, }, { Name: aws.String("*.wildcard-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), - AliasTarget: &route53.AliasTarget{ + Type: route53types.RRTypeA, + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("foo.eu-central-1.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(false), + EvaluateTargetHealth: false, HostedZoneId: aws.String("Z215JYRZR1TBD5"), }, }, { Name: aws.String("list-test-alias-evaluate.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), - AliasTarget: &route53.AliasTarget{ + Type: route53types.RRTypeA, + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("foo.eu-central-1.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(true), + EvaluateTargetHealth: true, HostedZoneId: aws.String("Z215JYRZR1TBD5"), }, }, { Name: aws.String("list-test-multiple.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("prefix-*.wildcard.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeTxt), + Type: route53types.RRTypeTxt, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("random")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("random")}}, }, { Name: aws.String("weight-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("test-set-1"), Weight: aws.Int64(10), }, { Name: aws.String("weight-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("4.3.2.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("4.3.2.1")}}, SetIdentifier: aws.String("test-set-2"), Weight: aws.Int64(20), }, { Name: aws.String("latency-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("test-set"), - Region: aws.String("us-east-1"), + Region: route53types.ResourceRecordSetRegionUsEast1, }, { Name: aws.String("failover-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("test-set"), - Failover: aws.String("PRIMARY"), + Failover: route53types.ResourceRecordSetFailoverPrimary, }, { Name: aws.String("multi-value-answer-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("test-set"), MultiValueAnswer: aws.Bool(true), }, { Name: aws.String("geolocation-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("test-set-1"), - GeoLocation: &route53.GeoLocation{ + GeoLocation: &route53types.GeoLocation{ ContinentCode: aws.String("EU"), }, }, { Name: aws.String("geolocation-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("4.3.2.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("4.3.2.1")}}, SetIdentifier: aws.String("test-set-2"), - GeoLocation: &route53.GeoLocation{ + GeoLocation: &route53types.GeoLocation{ CountryCode: aws.String("DE"), }, }, { Name: aws.String("geolocation-subdivision-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("test-set-1"), - GeoLocation: &route53.GeoLocation{ + GeoLocation: &route53types.GeoLocation{ SubdivisionCode: aws.String("NY"), }, }, { Name: aws.String("healthcheck-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("foo.example.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("foo.example.com")}}, SetIdentifier: aws.String("test-set-1"), HealthCheckId: aws.String("foo-bar-healthcheck-id"), Weight: aws.Int64(10), }, { Name: aws.String("healthcheck-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("4.3.2.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("4.3.2.1")}}, SetIdentifier: aws.String("test-set-2"), HealthCheckId: aws.String("abc-def-healthcheck-id"), Weight: aws.Int64(20), }, { Name: aws.String("mail.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeMx), + Type: route53types.RRTypeMx, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("10 mailhost1.example.com")}, {Value: aws.String("20 mailhost2.example.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("10 mailhost1.example.com")}, {Value: aws.String("20 mailhost2.example.com")}}, }, }) @@ -537,9 +499,6 @@ func TestAWSRecords(t *testing.T) { endpoint.NewEndpointWithTTL("list-test.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "1.2.3.4"), endpoint.NewEndpointWithTTL("list-test.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "8.8.8.8"), endpoint.NewEndpointWithTTL("*.wildcard-test.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "8.8.8.8"), - endpoint.NewEndpointWithTTL("escape-%!s()-codes.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeCNAME, endpoint.TTL(recordTTL), "example").WithProviderSpecific(providerSpecificAlias, "false"), - endpoint.NewEndpointWithTTL("escape-%!s()-codes-a.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "1.2.3.4"), - endpoint.NewEndpointWithTTL("escape-%!s()-codes-alias.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "escape-codes.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "false").WithProviderSpecific(providerSpecificAlias, "true"), endpoint.NewEndpointWithTTL("list-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "foo.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "false").WithProviderSpecific(providerSpecificAlias, "true"), endpoint.NewEndpointWithTTL("*.wildcard-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "foo.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "false").WithProviderSpecific(providerSpecificAlias, "true"), endpoint.NewEndpointWithTTL("list-test-alias-evaluate.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "foo.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "true").WithProviderSpecific(providerSpecificAlias, "true"), @@ -602,139 +561,131 @@ func TestAWSApplyChanges(t *testing.T) { } for _, tt := range tests { - provider, _ := newAWSProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.teapot.zalan.do."}), provider.NewZoneIDFilter([]string{}), provider.NewZoneTypeFilter(""), defaultEvaluateTargetHealth, false, []*route53.ResourceRecordSet{ + provider, _ := newAWSProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.teapot.zalan.do."}), provider.NewZoneIDFilter([]string{}), provider.NewZoneTypeFilter(""), defaultEvaluateTargetHealth, false, []route53types.ResourceRecordSet{ { Name: aws.String("update-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { Name: aws.String("delete-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { Name: aws.String("update-test.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("delete-test.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("update-test-a-to-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.1.1.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.1.1.1")}}, }, { Name: aws.String("update-test-alias-to-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), - AliasTarget: &route53.AliasTarget{ + Type: route53types.RRTypeA, + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("foo.eu-central-1.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(true), + EvaluateTargetHealth: true, HostedZoneId: aws.String("Z215JYRZR1TBD5"), }, }, { Name: aws.String("update-test-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, }, { Name: aws.String("delete-test-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, }, { Name: aws.String("update-test-cname-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, }, { Name: aws.String("delete-test-cname-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, }, { Name: aws.String("update-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("delete-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}, {Value: aws.String("4.3.2.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}, {Value: aws.String("4.3.2.1")}}, }, { Name: aws.String("weighted-to-simple.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("weighted-to-simple"), Weight: aws.Int64(10), }, { Name: aws.String("simple-to-weighted.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, }, { Name: aws.String("policy-change.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("policy-change"), Weight: aws.Int64(10), }, { Name: aws.String("set-identifier-change.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("before"), Weight: aws.Int64(10), }, { Name: aws.String("set-identifier-no-change.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("no-change"), Weight: aws.Int64(10), }, { Name: aws.String("update-test-mx.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeMx), + Type: route53types.RRTypeMx, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("10 mailhost2.bar.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("10 mailhost2.bar.elb.amazonaws.com")}}, }, { Name: aws.String("delete-test-mx.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeMx), + Type: route53types.RRTypeMx, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("30 mailhost1.foo.elb.amazonaws.com")}}, - }, - { - Name: aws.String(specialCharactersEscape("escape-%!s()-codes.zone-2.ext-dns-test-2.teapot.zalan.do.")), - Type: aws.String(route53.RRTypeA), - TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, - SetIdentifier: aws.String("no-change"), - Weight: aws.Int64(10), + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("30 mailhost1.foo.elb.amazonaws.com")}}, }, }) @@ -761,7 +712,6 @@ func TestAWSApplyChanges(t *testing.T) { endpoint.NewEndpoint("set-identifier-change.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4").WithSetIdentifier("before").WithProviderSpecific(providerSpecificWeight, "10"), endpoint.NewEndpoint("set-identifier-no-change.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4").WithSetIdentifier("no-change").WithProviderSpecific(providerSpecificWeight, "10"), endpoint.NewEndpoint("update-test-mx.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeMX, "10 mailhost2.bar.elb.amazonaws.com"), - endpoint.NewEndpoint("escape-%!s()-codes.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4").WithSetIdentifier("policy-change").WithSetIdentifier("no-change").WithProviderSpecific(providerSpecificWeight, "10"), } updatedRecords := []*endpoint.Endpoint{ endpoint.NewEndpoint("update-test.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4"), @@ -805,225 +755,217 @@ func TestAWSApplyChanges(t *testing.T) { assert.Equal(t, 1, counter.calls["ListHostedZonesPages"], tt.name) assert.Equal(t, tt.listRRSets, counter.calls["ListResourceRecordSetsPages"], tt.name) - validateRecords(t, listAWSRecords(t, provider.clients[defaultAWSProfile], "/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do."), []*route53.ResourceRecordSet{ + validateRecords(t, listAWSRecords(t, provider.clients[defaultAWSProfile], "/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do."), []route53types.ResourceRecordSet{ { Name: aws.String("create-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { Name: aws.String("update-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, }, { Name: aws.String("update-test-a-to-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), - AliasTarget: &route53.AliasTarget{ + Type: route53types.RRTypeA, + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("foo.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(true), + EvaluateTargetHealth: true, HostedZoneId: aws.String("zone-1.ext-dns-test-2.teapot.zalan.do."), }, }, { Name: aws.String("update-test-alias-to-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("my-internal-host.example.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("my-internal-host.example.com")}}, }, { Name: aws.String("create-test-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("foo.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("foo.elb.amazonaws.com")}}, }, { Name: aws.String("update-test-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("baz.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("baz.elb.amazonaws.com")}}, }, { Name: aws.String("create-test-cname-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("foo.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("foo.elb.amazonaws.com")}}, }, { Name: aws.String("update-test-cname-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("baz.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("baz.elb.amazonaws.com")}}, }, { Name: aws.String("weighted-to-simple.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, }, { Name: aws.String("simple-to-weighted.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("simple-to-weighted"), Weight: aws.Int64(10), }, { Name: aws.String("policy-change.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("policy-change"), - Region: aws.String("us-east-1"), + Region: route53types.ResourceRecordSetRegionUsEast1, }, { Name: aws.String("set-identifier-change.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("after"), Weight: aws.Int64(10), }, { Name: aws.String("set-identifier-no-change.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, SetIdentifier: aws.String("no-change"), Weight: aws.Int64(20), }, { Name: aws.String("create-test-mx.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeMx), + Type: route53types.RRTypeMx, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("10 mailhost1.foo.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("10 mailhost1.foo.elb.amazonaws.com")}}, }, }) - validateRecords(t, listAWSRecords(t, provider.clients[defaultAWSProfile], "/hostedzone/zone-2.ext-dns-test-2.teapot.zalan.do."), []*route53.ResourceRecordSet{ - { - Name: aws.String("escape-\\045\\041s\\050\\074nil\\076\\051-codes.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), - TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}}, - SetIdentifier: aws.String("no-change"), - Weight: aws.Int64(10), - }, + validateRecords(t, listAWSRecords(t, provider.clients[defaultAWSProfile], "/hostedzone/zone-2.ext-dns-test-2.teapot.zalan.do."), []route53types.ResourceRecordSet{ { Name: aws.String("create-test.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("update-test.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("4.3.2.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("4.3.2.1")}}, }, { Name: aws.String("create-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("update-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}, {Value: aws.String("4.3.2.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}, {Value: aws.String("4.3.2.1")}}, }, { Name: aws.String("update-test-mx.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeMx), + Type: route53types.RRTypeMx, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("20 mailhost3.foo.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("20 mailhost3.foo.elb.amazonaws.com")}}, }, }) } } func TestAWSApplyChangesDryRun(t *testing.T) { - originalRecords := []*route53.ResourceRecordSet{ + originalRecords := []route53types.ResourceRecordSet{ { Name: aws.String("update-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { Name: aws.String("delete-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { Name: aws.String("update-test.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("delete-test.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("update-test-a-to-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.1.1.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.1.1.1")}}, }, { Name: aws.String("update-test-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, }, { Name: aws.String("delete-test-cname.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, }, { Name: aws.String("update-test-cname-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("bar.elb.amazonaws.com")}}, }, { Name: aws.String("delete-test-cname-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeCname), + Type: route53types.RRTypeCname, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("qux.elb.amazonaws.com")}}, }, { Name: aws.String("update-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}, {Value: aws.String("8.8.4.4")}}, }, { Name: aws.String("delete-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("1.2.3.4")}, {Value: aws.String("4.3.2.1")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}, {Value: aws.String("4.3.2.1")}}, }, { Name: aws.String("update-test-mx.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeMx), + Type: route53types.RRTypeMx, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("20 mail.foo.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("20 mail.foo.elb.amazonaws.com")}}, }, { Name: aws.String("delete-test-mx.zone-2.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeMx), + Type: route53types.RRTypeMx, TTL: aws.Int64(recordTTL), - ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("10 mail.bar.elb.amazonaws.com")}}, + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("10 mail.bar.elb.amazonaws.com")}}, }, } @@ -1087,33 +1029,33 @@ func TestAWSApplyChangesDryRun(t *testing.T) { func TestAWSChangesByZones(t *testing.T) { changes := Route53Changes{ { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("qux.foo.example.org"), TTL: aws.Int64(1), }, }, }, { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("qux.bar.example.org"), TTL: aws.Int64(2), }, }, }, { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionDelete), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionDelete, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("wambo.foo.example.org"), TTL: aws.Int64(10), }, }, }, { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionDelete), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionDelete, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("wambo.bar.example.org"), TTL: aws.Int64(20), }, }, @@ -1123,29 +1065,29 @@ func TestAWSChangesByZones(t *testing.T) { zones := map[string]*profiledZone{ "foo-example-org": { profile: defaultAWSProfile, - zone: &route53.HostedZone{ + zone: &route53types.HostedZone{ Id: aws.String("foo-example-org"), Name: aws.String("foo.example.org."), }, }, "bar-example-org": { profile: defaultAWSProfile, - zone: &route53.HostedZone{ + zone: &route53types.HostedZone{ Id: aws.String("bar-example-org"), Name: aws.String("bar.example.org."), }, }, "bar-example-org-private": { profile: defaultAWSProfile, - zone: &route53.HostedZone{ + zone: &route53types.HostedZone{ Id: aws.String("bar-example-org-private"), Name: aws.String("bar.example.org."), - Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(true)}, + Config: &route53types.HostedZoneConfig{PrivateZone: true}, }, }, "baz-example-org": { profile: defaultAWSProfile, - zone: &route53.HostedZone{ + zone: &route53types.HostedZone{ Id: aws.String("baz-example-org"), Name: aws.String("baz.example.org."), }, @@ -1157,17 +1099,17 @@ func TestAWSChangesByZones(t *testing.T) { validateAWSChangeRecords(t, changesByZone["foo-example-org"], Route53Changes{ { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("qux.foo.example.org"), TTL: aws.Int64(1), }, }, }, { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionDelete), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionDelete, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("wambo.foo.example.org"), TTL: aws.Int64(10), }, }, @@ -1176,17 +1118,17 @@ func TestAWSChangesByZones(t *testing.T) { validateAWSChangeRecords(t, changesByZone["bar-example-org"], Route53Changes{ { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("qux.bar.example.org"), TTL: aws.Int64(2), }, }, }, { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionDelete), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionDelete, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("wambo.bar.example.org"), TTL: aws.Int64(20), }, }, @@ -1195,17 +1137,17 @@ func TestAWSChangesByZones(t *testing.T) { validateAWSChangeRecords(t, changesByZone["bar-example-org-private"], Route53Changes{ { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("qux.bar.example.org"), TTL: aws.Int64(2), }, }, }, { - Change: route53.Change{ - Action: aws.String(route53.ChangeActionDelete), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionDelete, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String("wambo.bar.example.org"), TTL: aws.Int64(20), }, }, @@ -1232,7 +1174,7 @@ func TestAWSsubmitChanges(t *testing.T) { zones, _ := provider.zones(ctx) records, _ := provider.Records(ctx) cs := make(Route53Changes, 0, len(endpoints)) - cs = append(cs, provider.newChanges(route53.ChangeActionCreate, endpoints)...) + cs = append(cs, provider.newChanges(route53types.ChangeActionCreate, endpoints)...) require.NoError(t, provider.submitChanges(ctx, cs, zones)) @@ -1251,7 +1193,7 @@ func TestAWSsubmitChangesError(t *testing.T) { require.NoError(t, err) ep := endpoint.NewEndpointWithTTL("fail.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "1.0.0.1") - cs := provider.newChanges(route53.ChangeActionCreate, []*endpoint.Endpoint{ep}) + cs := provider.newChanges(route53types.ChangeActionCreate, []*endpoint.Endpoint{ep}) require.Error(t, provider.submitChanges(ctx, cs, zones)) } @@ -1273,20 +1215,20 @@ func TestAWSsubmitChangesRetryOnError(t *testing.T) { } // "success" and "fail" are created in the first step, both are submitted in the same batch; this should fail - cs1 := provider.newChanges(route53.ChangeActionCreate, []*endpoint.Endpoint{ep2, ep2txt, ep1}) + cs1 := provider.newChanges(route53types.ChangeActionCreate, []*endpoint.Endpoint{ep2, ep2txt, ep1}) input1 := &route53.ChangeResourceRecordSetsInput{ HostedZoneId: aws.String("/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do."), - ChangeBatch: &route53.ChangeBatch{ + ChangeBatch: &route53types.ChangeBatch{ Changes: cs1.Route53Changes(), }, } clientStub.MockMethod("ChangeResourceRecordSets", input1).Return(nil, fmt.Errorf("Mock route53 failure")) // because of the failure, changes will be retried one by one; make "fail" submitted in its own batch fail as well - cs2 := provider.newChanges(route53.ChangeActionCreate, []*endpoint.Endpoint{ep2, ep2txt}) + cs2 := provider.newChanges(route53types.ChangeActionCreate, []*endpoint.Endpoint{ep2, ep2txt}) input2 := &route53.ChangeResourceRecordSetsInput{ HostedZoneId: aws.String("/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do."), - ChangeBatch: &route53.ChangeBatch{ + ChangeBatch: &route53types.ChangeBatch{ Changes: cs2.Route53Changes(), }, } @@ -1303,7 +1245,7 @@ func TestAWSsubmitChangesRetryOnError(t *testing.T) { require.False(t, containsRecordWithDNSName(records, "fail__edns_housekeeping.zone-1.ext-dns-test-2.teapot.zalan.do")) // next batch should contain "fail" and "success2", should succeed this time - cs3 := provider.newChanges(route53.ChangeActionCreate, []*endpoint.Endpoint{ep2, ep2txt, ep3}) + cs3 := provider.newChanges(route53types.ChangeActionCreate, []*endpoint.Endpoint{ep2, ep2txt, ep3}) require.NoError(t, provider.submitChanges(ctx, cs3, zones)) // verify all records are there @@ -1320,20 +1262,20 @@ func TestAWSBatchChangeSet(t *testing.T) { for i := 1; i <= defaultBatchChangeSize; i += 2 { cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("A"), + Type: route53types.RRTypeA, }, }, }) cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("TXT"), + Type: route53types.RRTypeTxt, }, }, }) @@ -1357,20 +1299,20 @@ func TestAWSBatchChangeSetExceeding(t *testing.T) { for i := 1; i <= testCount; i += 2 { cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("A"), + Type: route53types.RRTypeA, }, }, }, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("TXT"), + Type: route53types.RRTypeTxt, }, }, }, @@ -1395,20 +1337,20 @@ func TestAWSBatchChangeSetExceedingNameChange(t *testing.T) { for i := 1; i <= testCount; i += 2 { cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("A"), + Type: route53types.RRTypeA, }, }, }, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("TXT"), + Type: route53types.RRTypeTxt, }, }, }, @@ -1440,12 +1382,12 @@ func TestAWSBatchChangeSetExceedingBytesLimit(t *testing.T) { for i := 1; i <= testCount; i += groupSize { cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("A"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeA, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("1.2.3.4"), }, @@ -1456,12 +1398,12 @@ func TestAWSBatchChangeSetExceedingBytesLimit(t *testing.T) { sizeValues: 1, }, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("TXT"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeTxt, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("txt-record"), }, @@ -1499,12 +1441,12 @@ func TestAWSBatchChangeSetExceedingBytesLimitUpsert(t *testing.T) { for i := 1; i <= testCount; i += groupSize { cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionUpsert), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionUpsert, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("A"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeA, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("1.2.3.4"), }, @@ -1515,12 +1457,12 @@ func TestAWSBatchChangeSetExceedingBytesLimitUpsert(t *testing.T) { sizeValues: 1, }, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionUpsert), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionUpsert, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("TXT"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeTxt, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("txt-record"), }, @@ -1558,12 +1500,12 @@ func TestAWSBatchChangeSetExceedingValuesLimit(t *testing.T) { for i := 1; i <= testCount; i += groupSize { cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("A"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeA, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("1.2.3.4"), }, @@ -1574,12 +1516,12 @@ func TestAWSBatchChangeSetExceedingValuesLimit(t *testing.T) { sizeValues: 1, }, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("TXT"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeTxt, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("txt-record"), }, @@ -1617,12 +1559,12 @@ func TestAWSBatchChangeSetExceedingValuesLimitUpsert(t *testing.T) { for i := 1; i <= testCount; i += groupSize { cs = append(cs, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionUpsert), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionUpsert, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("A"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeA, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("1.2.3.4"), }, @@ -1633,12 +1575,12 @@ func TestAWSBatchChangeSetExceedingValuesLimitUpsert(t *testing.T) { sizeValues: 1, }, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionUpsert), - ResourceRecordSet: &route53.ResourceRecordSet{ + Change: route53types.Change{ + Action: route53types.ChangeActionUpsert, + ResourceRecordSet: &route53types.ResourceRecordSet{ Name: aws.String(fmt.Sprintf("host-%d", i)), - Type: aws.String("TXT"), - ResourceRecords: []*route53.ResourceRecord{ + Type: route53types.RRTypeTxt, + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("txt-record"), }, @@ -1664,7 +1606,7 @@ func validateEndpoints(t *testing.T, provider *AWSProvider, endpoints []*endpoin assert.True(t, testutils.SameEndpoints(normalized, expected), "actual and normalized endpoints don't match. %+v:%+v", endpoints, normalized) } -func validateAWSZones(t *testing.T, zones map[string]*route53.HostedZone, expected map[string]*route53.HostedZone) { +func validateAWSZones(t *testing.T, zones map[string]*route53types.HostedZone, expected map[string]*route53types.HostedZone) { require.Len(t, zones, len(expected)) for i, zone := range zones { @@ -1672,9 +1614,9 @@ func validateAWSZones(t *testing.T, zones map[string]*route53.HostedZone, expect } } -func validateAWSZone(t *testing.T, zone *route53.HostedZone, expected *route53.HostedZone) { - assert.Equal(t, aws.StringValue(expected.Id), aws.StringValue(zone.Id)) - assert.Equal(t, aws.StringValue(expected.Name), aws.StringValue(zone.Name)) +func validateAWSZone(t *testing.T, zone *route53types.HostedZone, expected *route53types.HostedZone) { + assert.Equal(t, *expected.Id, *zone.Id) + assert.Equal(t, *expected.Name, *zone.Name) } func validateAWSChangeRecords(t *testing.T, records Route53Changes, expected Route53Changes) { @@ -1686,9 +1628,9 @@ func validateAWSChangeRecords(t *testing.T, records Route53Changes, expected Rou } func validateAWSChangeRecord(t *testing.T, record *Route53Change, expected *Route53Change) { - assert.Equal(t, aws.StringValue(expected.Action), aws.StringValue(record.Action)) - assert.Equal(t, aws.StringValue(expected.ResourceRecordSet.Name), aws.StringValue(record.ResourceRecordSet.Name)) - assert.Equal(t, aws.StringValue(expected.ResourceRecordSet.Type), aws.StringValue(record.ResourceRecordSet.Type)) + assert.Equal(t, expected.Action, record.Action) + assert.Equal(t, *expected.ResourceRecordSet.Name, *record.ResourceRecordSet.Name) + assert.Equal(t, expected.ResourceRecordSet.Type, record.ResourceRecordSet.Type) } func TestAWSCreateRecordsWithCNAME(t *testing.T) { @@ -1706,12 +1648,12 @@ func TestAWSCreateRecordsWithCNAME(t *testing.T) { recordSets := listAWSRecords(t, provider.clients[defaultAWSProfile], "/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do.") - validateRecords(t, recordSets, []*route53.ResourceRecordSet{ + validateRecords(t, recordSets, []route53types.ResourceRecordSet{ { Name: aws.String("create-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(endpoint.RecordTypeCNAME), + Type: route53types.RRTypeCname, TTL: aws.Int64(300), - ResourceRecords: []*route53.ResourceRecord{ + ResourceRecords: []route53types.ResourceRecord{ { Value: aws.String("foo.example.org"), }, @@ -1770,33 +1712,33 @@ func TestAWSCreateRecordsWithALIAS(t *testing.T) { recordSets := listAWSRecords(t, provider.clients[defaultAWSProfile], "/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do.") - validateRecords(t, recordSets, []*route53.ResourceRecordSet{ + validateRecords(t, recordSets, []route53types.ResourceRecordSet{ { - AliasTarget: &route53.AliasTarget{ + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("foo.eu-central-1.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(evaluateTargetHealth), + EvaluateTargetHealth: evaluateTargetHealth, HostedZoneId: aws.String("Z215JYRZR1TBD5"), }, Name: aws.String("create-test.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, }, { - AliasTarget: &route53.AliasTarget{ + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("bar.eu-central-1.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(evaluateTargetHealth), + EvaluateTargetHealth: evaluateTargetHealth, HostedZoneId: aws.String("Z215JYRZR1TBD5"), }, Name: aws.String("create-test-dualstack.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeA), + Type: route53types.RRTypeA, }, { - AliasTarget: &route53.AliasTarget{ + AliasTarget: &route53types.AliasTarget{ DNSName: aws.String("bar.eu-central-1.elb.amazonaws.com."), - EvaluateTargetHealth: aws.Bool(evaluateTargetHealth), + EvaluateTargetHealth: evaluateTargetHealth, HostedZoneId: aws.String("Z215JYRZR1TBD5"), }, Name: aws.String("create-test-dualstack.zone-1.ext-dns-test-2.teapot.zalan.do."), - Type: aws.String(route53.RRTypeAaaa), + Type: route53types.RRTypeAaaa, }, }) } @@ -1859,15 +1801,15 @@ func TestAWSCanonicalHostedZone(t *testing.T) { func TestAWSSuitableZones(t *testing.T) { zones := map[string]*profiledZone{ // Public domain - "example-org": {profile: defaultAWSProfile, zone: &route53.HostedZone{Id: aws.String("example-org"), Name: aws.String("example.org.")}}, + "example-org": {profile: defaultAWSProfile, zone: &route53types.HostedZone{Id: aws.String("example-org"), Name: aws.String("example.org.")}}, // Public subdomain - "bar-example-org": {profile: defaultAWSProfile, zone: &route53.HostedZone{Id: aws.String("bar-example-org"), Name: aws.String("bar.example.org."), Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(false)}}}, + "bar-example-org": {profile: defaultAWSProfile, zone: &route53types.HostedZone{Id: aws.String("bar-example-org"), Name: aws.String("bar.example.org."), Config: &route53types.HostedZoneConfig{PrivateZone: false}}}, // Public subdomain - "longfoo-bar-example-org": {profile: defaultAWSProfile, zone: &route53.HostedZone{Id: aws.String("longfoo-bar-example-org"), Name: aws.String("longfoo.bar.example.org.")}}, + "longfoo-bar-example-org": {profile: defaultAWSProfile, zone: &route53types.HostedZone{Id: aws.String("longfoo-bar-example-org"), Name: aws.String("longfoo.bar.example.org.")}}, // Private domain - "example-org-private": {profile: defaultAWSProfile, zone: &route53.HostedZone{Id: aws.String("example-org-private"), Name: aws.String("example.org."), Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(true)}}}, + "example-org-private": {profile: defaultAWSProfile, zone: &route53types.HostedZone{Id: aws.String("example-org-private"), Name: aws.String("example.org."), Config: &route53types.HostedZoneConfig{PrivateZone: true}}}, // Private subdomain - "bar-example-org-private": {profile: defaultAWSProfile, zone: &route53.HostedZone{Id: aws.String("bar-example-org-private"), Name: aws.String("bar.example.org."), Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(true)}}}, + "bar-example-org-private": {profile: defaultAWSProfile, zone: &route53types.HostedZone{Id: aws.String("bar-example-org-private"), Name: aws.String("bar.example.org."), Config: &route53types.HostedZoneConfig{PrivateZone: true}}}, } for _, tc := range []struct { @@ -1896,19 +1838,20 @@ func TestAWSSuitableZones(t *testing.T) { } } -func createAWSZone(t *testing.T, provider *AWSProvider, zone *route53.HostedZone) { +func createAWSZone(t *testing.T, provider *AWSProvider, zone *route53types.HostedZone) { params := &route53.CreateHostedZoneInput{ CallerReference: aws.String("external-dns.alpha.kubernetes.io/test-zone"), Name: zone.Name, HostedZoneConfig: zone.Config, } - if _, err := provider.clients[defaultAWSProfile].CreateHostedZoneWithContext(context.Background(), params); err != nil { - require.EqualError(t, err, route53.ErrCodeHostedZoneAlreadyExists) + if _, err := provider.clients[defaultAWSProfile].CreateHostedZone(context.Background(), params); err != nil { + var hzExists *route53types.HostedZoneAlreadyExists + require.ErrorAs(t, err, &hzExists) } } -func setAWSRecords(t *testing.T, provider *AWSProvider, records []*route53.ResourceRecordSet) { +func setAWSRecords(t *testing.T, provider *AWSProvider, records []route53types.ResourceRecordSet) { dryRun := provider.dryRun provider.dryRun = false defer func() { @@ -1924,9 +1867,9 @@ func setAWSRecords(t *testing.T, provider *AWSProvider, records []*route53.Resou var changes Route53Changes for _, record := range records { changes = append(changes, &Route53Change{ - Change: route53.Change{ - Action: aws.String(route53.ChangeActionCreate), - ResourceRecordSet: record, + Change: route53types.Change{ + Action: route53types.ChangeActionCreate, + ResourceRecordSet: &record, }, }) } @@ -1940,24 +1883,21 @@ func setAWSRecords(t *testing.T, provider *AWSProvider, records []*route53.Resou require.NoError(t, err) } -func listAWSRecords(t *testing.T, client Route53API, zone string) []*route53.ResourceRecordSet { - recordSets := []*route53.ResourceRecordSet{} - require.NoError(t, client.ListResourceRecordSetsPagesWithContext(context.Background(), &route53.ListResourceRecordSetsInput{ +func listAWSRecords(t *testing.T, client Route53API, zone string) []route53types.ResourceRecordSet { + resp, err := client.ListResourceRecordSets(context.Background(), &route53.ListResourceRecordSetsInput{ HostedZoneId: aws.String(zone), - MaxItems: aws.String(route53PageSize), - }, func(resp *route53.ListResourceRecordSetsOutput, _ bool) bool { - recordSets = append(recordSets, resp.ResourceRecordSets...) - return true - })) + MaxItems: aws.Int32(route53PageSize), + }) + require.NoError(t, err) - return recordSets + return resp.ResourceRecordSets } -func newAWSProvider(t *testing.T, domainFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, zoneTypeFilter provider.ZoneTypeFilter, evaluateTargetHealth, dryRun bool, records []*route53.ResourceRecordSet) (*AWSProvider, *Route53APIStub) { +func newAWSProvider(t *testing.T, domainFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, zoneTypeFilter provider.ZoneTypeFilter, evaluateTargetHealth, dryRun bool, records []route53types.ResourceRecordSet) (*AWSProvider, *Route53APIStub) { return newAWSProviderWithTagFilter(t, domainFilter, zoneIDFilter, zoneTypeFilter, provider.NewZoneTagFilter([]string{}), evaluateTargetHealth, dryRun, records) } -func newAWSProviderWithTagFilter(t *testing.T, domainFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, zoneTypeFilter provider.ZoneTypeFilter, zoneTagFilter provider.ZoneTagFilter, evaluateTargetHealth, dryRun bool, records []*route53.ResourceRecordSet) (*AWSProvider, *Route53APIStub) { +func newAWSProviderWithTagFilter(t *testing.T, domainFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, zoneTypeFilter provider.ZoneTypeFilter, zoneTagFilter provider.ZoneTagFilter, evaluateTargetHealth, dryRun bool, records []route53types.ResourceRecordSet) (*AWSProvider, *Route53APIStub) { client := NewRoute53APIStub(t) provider := &AWSProvider{ @@ -1976,29 +1916,29 @@ func newAWSProviderWithTagFilter(t *testing.T, domainFilter endpoint.DomainFilte failedChangesQueue: make(map[string]Route53Changes), } - createAWSZone(t, provider, &route53.HostedZone{ + createAWSZone(t, provider, &route53types.HostedZone{ Id: aws.String("/hostedzone/zone-1.ext-dns-test-2.teapot.zalan.do."), Name: aws.String("zone-1.ext-dns-test-2.teapot.zalan.do."), - Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(false)}, + Config: &route53types.HostedZoneConfig{PrivateZone: false}, }) - createAWSZone(t, provider, &route53.HostedZone{ + createAWSZone(t, provider, &route53types.HostedZone{ Id: aws.String("/hostedzone/zone-2.ext-dns-test-2.teapot.zalan.do."), Name: aws.String("zone-2.ext-dns-test-2.teapot.zalan.do."), - Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(false)}, + Config: &route53types.HostedZoneConfig{PrivateZone: false}, }) - createAWSZone(t, provider, &route53.HostedZone{ + createAWSZone(t, provider, &route53types.HostedZone{ Id: aws.String("/hostedzone/zone-3.ext-dns-test-2.teapot.zalan.do."), Name: aws.String("zone-3.ext-dns-test-2.teapot.zalan.do."), - Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(true)}, + Config: &route53types.HostedZoneConfig{PrivateZone: true}, }) // filtered out by domain filter - createAWSZone(t, provider, &route53.HostedZone{ + createAWSZone(t, provider, &route53types.HostedZone{ Id: aws.String("/hostedzone/zone-4.ext-dns-test-3.teapot.zalan.do."), Name: aws.String("zone-4.ext-dns-test-3.teapot.zalan.do."), - Config: &route53.HostedZoneConfig{PrivateZone: aws.Bool(false)}, + Config: &route53types.HostedZoneConfig{PrivateZone: false}, }) setupZoneTags(provider.clients[defaultAWSProfile].(*Route53APIStub)) @@ -2033,10 +1973,10 @@ func setupZoneTags(client *Route53APIStub) { }) } -func addZoneTags(tagMap map[string][]*route53.Tag, zoneID string, tags map[string]string) { - tagList := make([]*route53.Tag, 0, len(tags)) +func addZoneTags(tagMap map[string][]route53types.Tag, zoneID string, tags map[string]string) { + tagList := make([]route53types.Tag, 0, len(tags)) for k, v := range tags { - tagList = append(tagList, &route53.Tag{ + tagList = append(tagList, route53types.Tag{ Key: aws.String(k), Value: aws.String(v), }) @@ -2044,7 +1984,7 @@ func addZoneTags(tagMap map[string][]*route53.Tag, zoneID string, tags map[strin tagMap[zoneID] = tagList } -func validateRecords(t *testing.T, records []*route53.ResourceRecordSet, expected []*route53.ResourceRecordSet) { +func validateRecords(t *testing.T, records []route53types.ResourceRecordSet, expected []route53types.ResourceRecordSet) { assert.ElementsMatch(t, expected, records) } @@ -2084,34 +2024,3 @@ func TestRequiresDeleteCreate(t *testing.T) { assert.False(t, provider.requiresDeleteCreate(oldSetIdentifier, oldSetIdentifier), "actual and expected endpoints don't match. %+v:%+v", oldSetIdentifier, oldSetIdentifier) assert.True(t, provider.requiresDeleteCreate(oldSetIdentifier, newSetIdentifier), "actual and expected endpoints don't match. %+v:%+v", oldSetIdentifier, newSetIdentifier) } - -func TestConvertOctalToAscii(t *testing.T) { - tests := []struct { - name string - input string - expected string - }{ - { - name: "Characters escaped !\"#$%&'()*+,-/:;", - input: "txt-\\041\\042\\043\\044\\045\\046\\047\\050\\051\\052\\053\\054-\\057\\072\\073-test.example.com", - expected: "txt-!\"#$%&'()*+,-/:;-test.example.com", - }, - { - name: "Characters escaped <=>?@[\\]^_`{|}~", - input: "txt-\\074\\075\\076\\077\\100\\133\\134\\135\\136_\\140\\173\\174\\175\\176-test2.example.com", - expected: "txt-<=>?@[\\]^_`{|}~-test2.example.com", - }, - { - name: "No escaped characters in domain", - input: "txt-awesome-test3.example.com", - expected: "txt-awesome-test3.example.com", - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - actual := convertOctalToAscii(tt.input) - assert.Equal(t, tt.expected, actual) - }) - } -} From d11ddb7ba727e1569de56b36b1b1c26822605ea6 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sat, 14 Sep 2024 10:24:23 +0100 Subject: [PATCH 43/82] merge with master Signed-off-by: ivan katliarchuk --- provider/aws/aws.go | 29 ++++++++++++- provider/aws/aws_test.go | 89 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 115 insertions(+), 3 deletions(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index fd06c65ec..924833343 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -20,6 +20,7 @@ import ( "context" "errors" "fmt" + "regexp" "sort" "strconv" "strings" @@ -398,6 +399,28 @@ func wildcardUnescape(s string) string { return strings.Replace(s, "\\052", "*", 1) } +// See https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html +// convertOctalToAscii decodes inputs that contain octal escape sequences into their original ASCII characters. +// The function returns converted string where any octal escape sequences have been replaced with their corresponding ASCII characters. +func convertOctalToAscii(input string) string { + if !containsOctalSequence(input) { + return input + } + result, err := strconv.Unquote("\"" + input + "\"") + if err != nil { + return input + } + return result +} + +// validateDomainName checks if the domain name contains valid octal escape sequences. +func containsOctalSequence(domain string) bool { + // Pattern to match valid octal escape sequences + octalEscapePattern := `\\[0-3][0-7]{2}` + octalEscapeRegex := regexp.MustCompile(octalEscapePattern) + return octalEscapeRegex.MatchString(domain) +} + // Records returns the list of records in a given hosted zone. func (p *AWSProvider) Records(ctx context.Context) (endpoints []*endpoint.Endpoint, _ error) { zones, err := p.zones(ctx) @@ -432,6 +455,8 @@ func (p *AWSProvider) records(ctx context.Context, zones map[string]*profiledZon continue } + name := convertOctalToAscii(wildcardUnescape(*r.Name)) + var ttl endpoint.TTL if r.TTL != nil { ttl = endpoint.TTL(*r.TTL) @@ -443,7 +468,7 @@ func (p *AWSProvider) records(ctx context.Context, zones map[string]*profiledZon targets[idx] = *rr.Value } - ep := endpoint.NewEndpointWithTTL(wildcardUnescape(*r.Name), string(r.Type), ttl, targets...) + ep := endpoint.NewEndpointWithTTL(name, string(r.Type), ttl, targets...) if r.Type == endpoint.RecordTypeCNAME { ep = ep.WithProviderSpecific(providerSpecificAlias, "false") } @@ -456,7 +481,7 @@ func (p *AWSProvider) records(ctx context.Context, zones map[string]*profiledZon ttl = recordTTL } ep := endpoint. - NewEndpointWithTTL(wildcardUnescape(*r.Name), endpoint.RecordTypeA, ttl, *r.AliasTarget.DNSName). + NewEndpointWithTTL(name, endpoint.RecordTypeA, ttl, *r.AliasTarget.DNSName). WithProviderSpecific(providerSpecificEvaluateTargetHealth, fmt.Sprintf("%t", r.AliasTarget.EvaluateTargetHealth)). WithProviderSpecific(providerSpecificAlias, "true") newEndpoints = append(newEndpoints, ep) diff --git a/provider/aws/aws_test.go b/provider/aws/aws_test.go index 806ed1d5c..4681aff28 100644 --- a/provider/aws/aws_test.go +++ b/provider/aws/aws_test.go @@ -141,6 +141,20 @@ func wildcardEscape(s string) string { return s } +// Route53 octal escapes https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html +func specialCharactersEscape(s string) string { + var result strings.Builder + for _, char := range s { + if (char >= 'a' && char <= 'z') || (char >= '0' && char <= '9') || char == '-' || char == '.' { + result.WriteRune(char) + } else { + octalCode := fmt.Sprintf("\\%03o", char) + result.WriteString(octalCode) + } + } + return result.String() +} + func (r *Route53APIStub) ListTagsForResource(ctx context.Context, input *route53.ListTagsForResourceInput, optFns ...func(options *route53.Options)) (*route53.ListTagsForResourceOutput, error) { if input.ResourceType == route53types.TagResourceTypeHostedzone { tags := r.zoneTags[*input.ResourceId] @@ -352,11 +366,33 @@ func TestAWSRecords(t *testing.T) { ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, { - Name: aws.String("*.wildcard-test.zone-2.ext-dns-test-2.teapot.zalan.do."), + Name: aws.String(wildcardEscape("*.wildcard-test.zone-2.ext-dns-test-2.teapot.zalan.do.")), Type: route53types.RRTypeA, TTL: aws.Int64(recordTTL), ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("8.8.8.8")}}, }, + { + Name: aws.String(specialCharactersEscape("escape-%!s()-codes.zone-2.ext-dns-test-2.teapot.zalan.do.")), + Type: route53types.RRTypeCname, + TTL: aws.Int64(recordTTL), + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("example")}}, + }, + { + Name: aws.String(specialCharactersEscape("escape-%!s()-codes-a.zone-2.ext-dns-test-2.teapot.zalan.do.")), + Type: route53types.RRTypeA, + TTL: aws.Int64(recordTTL), + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + }, + { + Name: aws.String(specialCharactersEscape("escape-%!s()-codes-alias.zone-2.ext-dns-test-2.teapot.zalan.do.")), + Type: route53types.RRTypeA, + TTL: aws.Int64(recordTTL), + AliasTarget: &route53types.AliasTarget{ + DNSName: aws.String("escape-codes.eu-central-1.elb.amazonaws.com."), + EvaluateTargetHealth: false, + HostedZoneId: aws.String("Z215JYRZR1TBD5"), + }, + }, { Name: aws.String("list-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do."), Type: route53types.RRTypeA, @@ -499,6 +535,9 @@ func TestAWSRecords(t *testing.T) { endpoint.NewEndpointWithTTL("list-test.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "1.2.3.4"), endpoint.NewEndpointWithTTL("list-test.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "8.8.8.8"), endpoint.NewEndpointWithTTL("*.wildcard-test.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "8.8.8.8"), + endpoint.NewEndpointWithTTL("escape-%!s()-codes.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeCNAME, endpoint.TTL(recordTTL), "example").WithProviderSpecific(providerSpecificAlias, "false"), + endpoint.NewEndpointWithTTL("escape-%!s()-codes-a.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "1.2.3.4"), + endpoint.NewEndpointWithTTL("escape-%!s()-codes-alias.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "escape-codes.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "false").WithProviderSpecific(providerSpecificAlias, "true"), endpoint.NewEndpointWithTTL("list-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "foo.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "false").WithProviderSpecific(providerSpecificAlias, "true"), endpoint.NewEndpointWithTTL("*.wildcard-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "foo.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "false").WithProviderSpecific(providerSpecificAlias, "true"), endpoint.NewEndpointWithTTL("list-test-alias-evaluate.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, endpoint.TTL(recordTTL), "foo.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "true").WithProviderSpecific(providerSpecificAlias, "true"), @@ -687,6 +726,14 @@ func TestAWSApplyChanges(t *testing.T) { TTL: aws.Int64(recordTTL), ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("30 mailhost1.foo.elb.amazonaws.com")}}, }, + { + Name: aws.String(specialCharactersEscape("escape-%!s()-codes.zone-2.ext-dns-test-2.teapot.zalan.do.")), + Type: route53types.RRTypeA, + TTL: aws.Int64(recordTTL), + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + SetIdentifier: aws.String("no-change"), + Weight: aws.Int64(10), + }, }) createRecords := []*endpoint.Endpoint{ @@ -712,6 +759,7 @@ func TestAWSApplyChanges(t *testing.T) { endpoint.NewEndpoint("set-identifier-change.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4").WithSetIdentifier("before").WithProviderSpecific(providerSpecificWeight, "10"), endpoint.NewEndpoint("set-identifier-no-change.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4").WithSetIdentifier("no-change").WithProviderSpecific(providerSpecificWeight, "10"), endpoint.NewEndpoint("update-test-mx.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeMX, "10 mailhost2.bar.elb.amazonaws.com"), + endpoint.NewEndpoint("escape-%!s()-codes.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4").WithSetIdentifier("policy-change").WithSetIdentifier("no-change").WithProviderSpecific(providerSpecificWeight, "10"), } updatedRecords := []*endpoint.Endpoint{ endpoint.NewEndpoint("update-test.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "1.2.3.4"), @@ -853,6 +901,14 @@ func TestAWSApplyChanges(t *testing.T) { }, }) validateRecords(t, listAWSRecords(t, provider.clients[defaultAWSProfile], "/hostedzone/zone-2.ext-dns-test-2.teapot.zalan.do."), []route53types.ResourceRecordSet{ + { + Name: aws.String("escape-\\045\\041s\\050\\074nil\\076\\051-codes.zone-2.ext-dns-test-2.teapot.zalan.do."), + Type: route53types.RRTypeA, + TTL: aws.Int64(recordTTL), + ResourceRecords: []route53types.ResourceRecord{{Value: aws.String("1.2.3.4")}}, + SetIdentifier: aws.String("no-change"), + Weight: aws.Int64(10), + }, { Name: aws.String("create-test.zone-2.ext-dns-test-2.teapot.zalan.do."), Type: route53types.RRTypeA, @@ -2024,3 +2080,34 @@ func TestRequiresDeleteCreate(t *testing.T) { assert.False(t, provider.requiresDeleteCreate(oldSetIdentifier, oldSetIdentifier), "actual and expected endpoints don't match. %+v:%+v", oldSetIdentifier, oldSetIdentifier) assert.True(t, provider.requiresDeleteCreate(oldSetIdentifier, newSetIdentifier), "actual and expected endpoints don't match. %+v:%+v", oldSetIdentifier, newSetIdentifier) } + +func TestConvertOctalToAscii(t *testing.T) { + tests := []struct { + name string + input string + expected string + }{ + { + name: "Characters escaped !\"#$%&'()*+,-/:;", + input: "txt-\\041\\042\\043\\044\\045\\046\\047\\050\\051\\052\\053\\054-\\057\\072\\073-test.example.com", + expected: "txt-!\"#$%&'()*+,-/:;-test.example.com", + }, + { + name: "Characters escaped <=>?@[\\]^_`{|}~", + input: "txt-\\074\\075\\076\\077\\100\\133\\134\\135\\136_\\140\\173\\174\\175\\176-test2.example.com", + expected: "txt-<=>?@[\\]^_`{|}~-test2.example.com", + }, + { + name: "No escaped characters in domain", + input: "txt-awesome-test3.example.com", + expected: "txt-awesome-test3.example.com", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + actual := convertOctalToAscii(tt.input) + assert.Equal(t, tt.expected, actual) + }) + } +} From 847bd3ed7aac06bf02b5eec9a3f1faeb7710e0ca Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sat, 14 Sep 2024 10:25:00 +0100 Subject: [PATCH 44/82] merge with master Signed-off-by: ivan katliarchuk --- .github/workflows/scorecards.yml | 70 -------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 .github/workflows/scorecards.yml diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml deleted file mode 100644 index bd7890cad..000000000 --- a/.github/workflows/scorecards.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: Scorecard supply-chain security -on: - # For Branch-Protection check. Only the default branch is supported. See - # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection - branch_protection_rule: - # To guarantee Maintained check is occasionally updated. See - # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained - schedule: - - cron: '25 7 * * 0' - push: - branches: [ "main" , "issue-4673"] - workflow_dispatch: - -# Declare default permissions as read only. -permissions: read-all - -jobs: - analysis: - name: Scorecard analysis - runs-on: ubuntu-latest - permissions: - # Needed to upload the results to code-scanning dashboard. - security-events: write - # Needed to publish results and get a badge (see publish_results below). - id-token: write - # Uncomment the permissions below if installing in a private repository. - # contents: read - # actions: read - - steps: - - name: "Checkout code" - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - persist-credentials: false - - - name: "Run analysis" - uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 - with: - results_file: results.sarif - results_format: sarif - # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: - # - you want to enable the Branch-Protection check on a *public* repository, or - # - you are installing Scorecard on a *private* repository - # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional. - # repo_token: ${{ secrets.SCORECARD_TOKEN }} - - # Public repositories: - # - Publish results to OpenSSF REST API for easy access by consumers - # - Allows the repository to include the Scorecard badge. - # - See https://github.com/ossf/scorecard-action#publishing-results. - # For private repositories: - # - `publish_results` will always be set to `false`, regardless - # of the value entered here. - publish_results: true - - # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF - # format to the repository Actions tab. - - name: "Upload artifact" - uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20 - with: - name: SARIF file - path: results.sarif - retention-days: 5 - - # Upload the results to GitHub's code scanning dashboard (optional). - # Commenting out will disable upload of results to your repo's Code Scanning dashboard - - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: results.sarif From 8eaf6df3d5ba5297886d4a894c3e15b2d1a9c9ab Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sat, 14 Sep 2024 10:25:44 +0100 Subject: [PATCH 45/82] add back different tabulation Signed-off-by: ivan katliarchuk --- provider/aws/aws.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index 924833343..570e9c0c9 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, From cfd80f0b6bcdea2d9109c4aa1491135cabc3ea5a Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sat, 14 Sep 2024 10:31:49 +0100 Subject: [PATCH 46/82] remove tabulation Signed-off-by: ivan katliarchuk --- provider/aws/aws.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index 570e9c0c9..f4ad9bdea 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, From 7664cea905f35f048a41a55e2c82ed1fa687bac5 Mon Sep 17 00:00:00 2001 From: Vincent Miszczak Date: Mon, 16 Sep 2024 14:41:51 +0200 Subject: [PATCH 47/82] feat: aws-sd tags --- docs/tutorials/aws-sd.md | 82 +++++++++++++++++++++++++++++- main.go | 2 +- pkg/apis/externaldns/types.go | 7 ++- pkg/apis/externaldns/types_test.go | 9 +++- provider/awssd/aws_sd.go | 12 ++++- 5 files changed, 106 insertions(+), 6 deletions(-) diff --git a/docs/tutorials/aws-sd.md b/docs/tutorials/aws-sd.md index c12616931..2e69d9073 100644 --- a/docs/tutorials/aws-sd.md +++ b/docs/tutorials/aws-sd.md @@ -12,7 +12,7 @@ Learn more about the API in the [AWS Cloud Map API Reference](https://docs.aws.a ## IAM Permissions -To use the AWS Cloud Map API, a user must have permissions to create the DNS namespace. Additionally you need to make sure that your nodes (on which External DNS runs) have an IAM instance profile with the `AWSCloudMapFullAccess` managed policy attached, that provides following permissions: +To use the AWS Cloud Map API, a user must have permissions to create the DNS namespace. For simple deployments, you need to make sure that your nodes (on which External DNS runs) have an IAM instance profile with the `AWSCloudMapFullAccess` managed policy attached, that provides following permissions: ``` { @@ -42,6 +42,86 @@ To use the AWS Cloud Map API, a user must have permissions to create the DNS nam } ``` +### IAM Permissions with ABAC +You can use Attribute-based access control(ABAC) for advanced deployments. + +You can define AWS tags that are applied to services created by the controller. By doing so, you can have precise control over your IAM policy to limit the scope of the permissions to services managed by the controller, rather than having to grant full permissions on your entire AWS account. +To pass tags to service creation, use either CLI flags or environment variables: + +*cli:* +``` +--aws-sd-create-tag=key1=value1 --aws-sd-create-tag=key2=value2 +``` + +*environment:* +``` +EXTERNAL_DNS_AWS_SD_CREATE_TAG=key1=value1\nkey2=value2 +``` +Using tags, your `servicediscovery` policy can become: +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "servicediscovery:ListNamespaces", + "servicediscovery:ListServices" + ], + "Resource": [ + "*" + ] + }, + { + "Effect": "Allow", + "Action": [ + "servicediscovery:CreateService", + "servicediscovery:TagResource" + ], + "Resource": [ + "*" + ], + "Condition": { + "StringEquals": { + "aws:RequestTag/YOUR_TAG_KEY": "YOUR_TAG_VALUE" + } + } + }, + { + "Effect": "Allow", + "Action": [ + "servicediscovery:DiscoverInstances" + ], + "Resource": [ + "*" + ], + "Condition": { + "StringEquals": { + "servicediscovery:NamespaceName": "YOUR_NAMESPACE_NAME" + } + } + }, + { + "Effect": "Allow", + "Action": [ + "servicediscovery:RegisterInstance", + "servicediscovery:DeregisterInstance", + "servicediscovery:DeleteService", + "servicediscovery:UpdateService" + ], + "Resource": [ + "*" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/YOUR_TAG_KEY": "YOUR_TAG_VALUE" + } + } + } + ] +} +``` + ## Set up a namespace Create a DNS namespace using the AWS Cloud Map API: diff --git a/main.go b/main.go index 985124349..215a16e3a 100644 --- a/main.go +++ b/main.go @@ -235,7 +235,7 @@ func main() { log.Infof("Registry \"%s\" cannot be used with AWS Cloud Map. Switching to \"aws-sd\".", cfg.Registry) cfg.Registry = "aws-sd" } - p, err = awssd.NewAWSSDProvider(domainFilter, cfg.AWSZoneType, cfg.DryRun, cfg.AWSSDServiceCleanup, cfg.TXTOwnerID, sd.NewFromConfig(aws.CreateDefaultV2Config(cfg))) + p, err = awssd.NewAWSSDProvider(domainFilter, cfg.AWSZoneType, cfg.DryRun, cfg.AWSSDServiceCleanup, cfg.TXTOwnerID, cfg.AWSSDCreateTag, sd.NewFromConfig(aws.CreateDefaultV2Config(cfg))) case "azure-dns", "azure": p, err = azure.NewAzureProvider(cfg.AzureConfigFile, domainFilter, zoneNameFilter, zoneIDFilter, cfg.AzureSubscriptionID, cfg.AzureResourceGroup, cfg.AzureUserAssignedIdentityClientID, cfg.AzureActiveDirectoryAuthorityHost, cfg.DryRun) case "azure-private-dns": diff --git a/pkg/apis/externaldns/types.go b/pkg/apis/externaldns/types.go index 02b59a422..1bbd20ea8 100644 --- a/pkg/apis/externaldns/types.go +++ b/pkg/apis/externaldns/types.go @@ -96,6 +96,7 @@ type Config struct { AWSPreferCNAME bool AWSZoneCacheDuration time.Duration AWSSDServiceCleanup bool + AWSSDCreateTag map[string]string AWSZoneMatchParent bool AWSDynamoDBRegion string AWSDynamoDBTable string @@ -255,6 +256,7 @@ var defaultConfig = &Config{ AWSPreferCNAME: false, AWSZoneCacheDuration: 0 * time.Second, AWSSDServiceCleanup: false, + AWSSDCreateTag: map[string]string{}, AWSDynamoDBRegion: "", AWSDynamoDBTable: "external-dns", AzureConfigFile: "/etc/kubernetes/azure.json", @@ -355,7 +357,9 @@ var defaultConfig = &Config{ // NewConfig returns new Config object func NewConfig() *Config { - return &Config{} + return &Config{ + AWSSDCreateTag: map[string]string{}, + } } func (cfg *Config) String() string { @@ -473,6 +477,7 @@ func (cfg *Config) ParseFlags(args []string) error { app.Flag("aws-zones-cache-duration", "When using the AWS provider, set the zones list cache TTL (0s to disable).").Default(defaultConfig.AWSZoneCacheDuration.String()).DurationVar(&cfg.AWSZoneCacheDuration) app.Flag("aws-zone-match-parent", "Expand limit possible target by sub-domains (default: disabled)").BoolVar(&cfg.AWSZoneMatchParent) app.Flag("aws-sd-service-cleanup", "When using the AWS CloudMap provider, delete empty Services without endpoints (default: disabled)").BoolVar(&cfg.AWSSDServiceCleanup) + app.Flag("aws-sd-create-tag", "When using the AWS CloudMap provider, add tag to created services. The flag can be used multiple times").StringMapVar(&cfg.AWSSDCreateTag) app.Flag("azure-config-file", "When using the Azure provider, specify the Azure configuration file (required when --provider=azure)").Default(defaultConfig.AzureConfigFile).StringVar(&cfg.AzureConfigFile) app.Flag("azure-resource-group", "When using the Azure provider, override the Azure resource group to use (optional)").Default(defaultConfig.AzureResourceGroup).StringVar(&cfg.AzureResourceGroup) app.Flag("azure-subscription-id", "When using the Azure provider, override the Azure subscription to use (optional)").Default(defaultConfig.AzureSubscriptionID).StringVar(&cfg.AzureSubscriptionID) diff --git a/pkg/apis/externaldns/types_test.go b/pkg/apis/externaldns/types_test.go index e52f87f49..79abdf08a 100644 --- a/pkg/apis/externaldns/types_test.go +++ b/pkg/apis/externaldns/types_test.go @@ -68,6 +68,7 @@ var ( AWSProfiles: []string{""}, AWSZoneCacheDuration: 0 * time.Second, AWSSDServiceCleanup: false, + AWSSDCreateTag: map[string]string{}, AWSDynamoDBTable: "external-dns", AzureConfigFile: "/etc/kubernetes/azure.json", AzureResourceGroup: "", @@ -166,6 +167,7 @@ var ( AWSProfiles: []string{"profile1", "profile2"}, AWSZoneCacheDuration: 10 * time.Second, AWSSDServiceCleanup: true, + AWSSDCreateTag: map[string]string{"key1": "value1", "key2": "value2"}, AWSDynamoDBTable: "custom-table", AzureConfigFile: "azure.json", AzureResourceGroup: "arg", @@ -322,6 +324,8 @@ func TestParseFlags(t *testing.T) { "--aws-profile=profile2", "--aws-zones-cache-duration=10s", "--aws-sd-service-cleanup", + "--aws-sd-create-tag=key1=value1", + "--aws-sd-create-tag=key2=value2", "--no-aws-evaluate-target-health", "--policy=upsert-only", "--registry=noop", @@ -432,6 +436,7 @@ func TestParseFlags(t *testing.T) { "EXTERNAL_DNS_AWS_PROFILE": "profile1\nprofile2", "EXTERNAL_DNS_AWS_ZONES_CACHE_DURATION": "10s", "EXTERNAL_DNS_AWS_SD_SERVICE_CLEANUP": "true", + "EXTERNAL_DNS_AWS_SD_CREATE_TAG": "key1=value1\nkey2=value2", "EXTERNAL_DNS_DYNAMODB_TABLE": "custom-table", "EXTERNAL_DNS_POLICY": "upsert-only", "EXTERNAL_DNS_REGISTRY": "noop", @@ -500,8 +505,8 @@ func restoreEnv(t *testing.T, originalEnv map[string]string) { func TestPasswordsNotLogged(t *testing.T) { cfg := Config{ - PDNSAPIKey: "pdns-api-key", - RFC2136TSIGSecret: "tsig-secret", + PDNSAPIKey: "pdns-api-key", + RFC2136TSIGSecret: "tsig-secret", } s := cfg.String() diff --git a/provider/awssd/aws_sd.go b/provider/awssd/aws_sd.go index 14a977873..33f131162 100644 --- a/provider/awssd/aws_sd.go +++ b/provider/awssd/aws_sd.go @@ -79,10 +79,12 @@ type AWSSDProvider struct { cleanEmptyService bool // filter services for removal ownerID string + // tags to be added to the service + tags []sdtypes.Tag } // NewAWSSDProvider initializes a new AWS Cloud Map based Provider. -func NewAWSSDProvider(domainFilter endpoint.DomainFilter, namespaceType string, dryRun, cleanEmptyService bool, ownerID string, client AWSSDClient) (*AWSSDProvider, error) { +func NewAWSSDProvider(domainFilter endpoint.DomainFilter, namespaceType string, dryRun, cleanEmptyService bool, ownerID string, tags map[string]string, client AWSSDClient) (*AWSSDProvider, error) { p := &AWSSDProvider{ client: client, dryRun: dryRun, @@ -90,6 +92,13 @@ func NewAWSSDProvider(domainFilter endpoint.DomainFilter, namespaceType string, namespaceTypeFilter: newSdNamespaceFilter(namespaceType), cleanEmptyService: cleanEmptyService, ownerID: ownerID, + tags: func() []sdtypes.Tag { + awsTags := make([]sdtypes.Tag, 0, len(tags)) + for k, v := range tags { + awsTags = append(awsTags, sdtypes.Tag{Key: aws.String(k), Value: aws.String(v)}) + } + return awsTags + }(), } return p, nil @@ -400,6 +409,7 @@ func (p *AWSSDProvider) CreateService(ctx context.Context, namespaceID *string, }}, }, NamespaceId: namespaceID, + Tags: p.tags, }) if err != nil { return nil, err From 51300362ccee99ca87c88e1cb8fdaa348e92623e Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Tue, 17 Sep 2024 09:18:27 +0200 Subject: [PATCH 48/82] chore(deps): fix update on cloudflare and alibaba --- go.mod | 126 +++++----- go.sum | 252 ++++++++++---------- provider/alibabacloud/alibaba_cloud_test.go | 10 +- provider/cloudflare/cloudflare_test.go | 7 - 4 files changed, 194 insertions(+), 201 deletions(-) diff --git a/go.mod b/go.mod index a4350b89c..2a6f1754c 100644 --- a/go.mod +++ b/go.mod @@ -3,35 +3,35 @@ module sigs.k8s.io/external-dns go 1.23 require ( - cloud.google.com/go/compute/metadata v0.5.0 + cloud.google.com/go/compute/metadata v0.5.1 github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.2.0 - github.com/F5Networks/k8s-bigip-ctlr/v2 v2.17.1 + github.com/F5Networks/k8s-bigip-ctlr/v2 v2.18.0 github.com/IBM-Cloud/ibm-cloud-cli-sdk v1.5.0 - github.com/IBM/go-sdk-core/v5 v5.17.4 + github.com/IBM/go-sdk-core/v5 v5.17.5 github.com/IBM/networking-go-sdk v0.49.0 - github.com/Yamashou/gqlgenc v0.24.0 + github.com/Yamashou/gqlgenc v0.25.0 github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2 github.com/alecthomas/kingpin/v2 v2.4.0 - github.com/aliyun/alibaba-cloud-sdk-go v1.63.0 - github.com/aws/aws-sdk-go-v2 v1.30.3 - github.com/aws/aws-sdk-go-v2/config v1.27.27 - github.com/aws/aws-sdk-go-v2/credentials v1.17.27 - github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.14.10 - github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.4 - github.com/aws/aws-sdk-go-v2/service/route53 v1.42.3 - github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.3 - github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 + github.com/aliyun/alibaba-cloud-sdk-go v1.63.16 + github.com/aws/aws-sdk-go-v2 v1.30.5 + github.com/aws/aws-sdk-go-v2/config v1.27.34 + github.com/aws/aws-sdk-go-v2/credentials v1.17.32 + github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.3 + github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.9 + github.com/aws/aws-sdk-go-v2/service/route53 v1.43.2 + github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.7 + github.com/aws/aws-sdk-go-v2/service/sts v1.30.7 github.com/bodgit/tsig v1.2.2 github.com/cenkalti/backoff/v4 v4.3.0 - github.com/civo/civogo v0.3.73 - github.com/cloudflare/cloudflare-go v0.102.0 + github.com/civo/civogo v0.3.77 + github.com/cloudflare/cloudflare-go v0.104.0 github.com/cloudfoundry-community/go-cfclient v0.0.0-20190201205600-f136f9222381 github.com/datawire/ambassador v1.12.4 github.com/denverdino/aliyungo v0.0.0-20230411124812-ab98a9173ace - github.com/digitalocean/godo v1.120.0 + github.com/digitalocean/godo v1.124.0 github.com/dnsimple/dnsimple-go v1.7.0 github.com/exoscale/egoscale v0.102.3 github.com/ffledgling/pdns-go v0.0.0-20180219074714-524e7daccd99 @@ -41,68 +41,68 @@ require ( github.com/google/uuid v1.6.0 github.com/gophercloud/gophercloud v1.14.0 github.com/linki/instrumented_http v0.3.0 - github.com/linode/linodego v1.39.0 + github.com/linode/linodego v1.40.0 github.com/maxatome/go-testdeep v1.14.0 github.com/miekg/dns v1.1.62 github.com/onsi/ginkgo v1.16.5 github.com/openshift/api v0.0.0-20230607130528-611114dca681 github.com/openshift/client-go v0.0.0-20230607134213-3cd0021bbee3 - github.com/oracle/oci-go-sdk/v65 v65.71.1 + github.com/oracle/oci-go-sdk/v65 v65.73.0 github.com/ovh/go-ovh v1.6.0 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pkg/errors v0.9.1 github.com/pluralsh/gqlclient v1.12.2 github.com/projectcontour/contour v1.30.0 - github.com/prometheus/client_golang v1.20.0 - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29 + github.com/prometheus/client_golang v1.20.3 + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.9.0 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.984 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.984 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.984 - github.com/transip/gotransip/v6 v6.25.0 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1003 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1003 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1003 + github.com/transip/gotransip/v6 v6.26.0 github.com/ultradns/ultradns-sdk-go v1.3.7 - go.etcd.io/etcd/api/v3 v3.5.15 - go.etcd.io/etcd/client/v3 v3.5.15 + go.etcd.io/etcd/api/v3 v3.5.16 + go.etcd.io/etcd/client/v3 v3.5.16 go.uber.org/ratelimit v0.3.1 - golang.org/x/net v0.28.0 - golang.org/x/oauth2 v0.22.0 + golang.org/x/net v0.29.0 + golang.org/x/oauth2 v0.23.0 golang.org/x/sync v0.8.0 golang.org/x/time v0.6.0 - google.golang.org/api v0.192.0 + google.golang.org/api v0.197.0 gopkg.in/ns1/ns1-go.v2 v2.12.0 gopkg.in/yaml.v2 v2.4.0 - istio.io/api v1.23.0 - istio.io/client-go v1.23.0 - k8s.io/api v0.31.0 - k8s.io/apimachinery v0.31.0 - k8s.io/client-go v0.31.0 + istio.io/api v1.23.1 + istio.io/client-go v1.23.1 + k8s.io/api v0.31.1 + k8s.io/apimachinery v0.31.1 + k8s.io/client-go v0.31.1 k8s.io/klog/v2 v2.130.1 sigs.k8s.io/gateway-api v1.1.0 ) require ( - cloud.google.com/go/auth v0.8.1 // indirect - cloud.google.com/go/auth/oauth2adapt v0.2.3 // indirect + cloud.google.com/go/auth v0.9.3 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect code.cloudfoundry.org/gofileutils v0.0.0-20170111115228-4d0c80011a0f // indirect - github.com/99designs/gqlgen v0.17.44 // indirect + github.com/99designs/gqlgen v0.17.49 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/Masterminds/semver v1.4.2 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect - github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.3 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.16 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 // indirect - github.com/aws/smithy-go v1.20.3 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect + github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.18 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.22.7 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7 // indirect + github.com/aws/smithy-go v1.20.4 // indirect github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -137,7 +137,7 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/s2a-go v0.1.8 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect github.com/googleapis/gax-go/v2 v2.13.0 // indirect github.com/gopherjs/gopherjs v1.17.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect @@ -181,32 +181,32 @@ require ( github.com/schollz/progressbar/v3 v3.8.6 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/sony/gobreaker v0.5.0 // indirect - github.com/sosodev/duration v1.2.0 // indirect + github.com/sosodev/duration v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/terra-farm/udnssdk v1.3.5 // indirect - github.com/vektah/gqlparser/v2 v2.5.14 // indirect + github.com/vektah/gqlparser/v2 v2.5.16 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xhit/go-str2duration/v2 v2.1.0 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.15 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect go.mongodb.org/mongo-driver v1.14.0 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect - go.opentelemetry.io/otel v1.24.0 // indirect - go.opentelemetry.io/otel/metric v1.24.0 // indirect - go.opentelemetry.io/otel/trace v1.24.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect + go.opentelemetry.io/otel v1.29.0 // indirect + go.opentelemetry.io/otel/metric v1.29.0 // indirect + go.opentelemetry.io/otel/trace v1.29.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.26.0 // indirect + golang.org/x/crypto v0.27.0 // indirect golang.org/x/mod v0.18.0 // indirect - golang.org/x/sys v0.23.0 // indirect - golang.org/x/term v0.23.0 // indirect - golang.org/x/text v0.17.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/text v0.18.0 // indirect golang.org/x/tools v0.22.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf // indirect - google.golang.org/grpc v1.65.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/grpc v1.66.1 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index 70d598d21..dc5eafdcc 100644 --- a/go.sum +++ b/go.sum @@ -2,18 +2,18 @@ bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxo cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go/auth v0.8.1 h1:QZW9FjC5lZzN864p13YxvAtGUlQ+KgRL+8Sg45Z6vxo= -cloud.google.com/go/auth v0.8.1/go.mod h1:qGVp/Y3kDRSDZ5gFD/XPUfYQ9xW1iI7q8RIRoCyBbJc= -cloud.google.com/go/auth/oauth2adapt v0.2.3 h1:MlxF+Pd3OmSudg/b1yZ5lJwoXCEaeedAguodky1PcKI= -cloud.google.com/go/auth/oauth2adapt v0.2.3/go.mod h1:tMQXOfZzFuNuUxOypHlQEXgdfX5cuhwU+ffUuXRJE8I= -cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= -cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= +cloud.google.com/go/auth v0.9.3 h1:VOEUIAADkkLtyfr3BLa3R8Ed/j6w1jTBmARx+wb5w5U= +cloud.google.com/go/auth v0.9.3/go.mod h1:7z6VY+7h3KUdRov5F1i8NDP5ZzWKYmEPO842BgCsmTk= +cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= +cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= +cloud.google.com/go/compute/metadata v0.5.1 h1:NM6oZeZNlYjiwYje+sYFjEpP0Q0zCan1bmQW/KmIrGs= +cloud.google.com/go/compute/metadata v0.5.1/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= code.cloudfoundry.org/gofileutils v0.0.0-20170111115228-4d0c80011a0f h1:UrKzEwTgeiff9vxdrfdqxibzpWjxLnuXDI5m6z3GJAk= code.cloudfoundry.org/gofileutils v0.0.0-20170111115228-4d0c80011a0f/go.mod h1:sk5LnIjB/nIEU7yP5sDQExVm62wu0pBh3yrElngUisI= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= git.lukeshu.com/go/libsystemd v0.5.3/go.mod h1:FfDoP0i92r4p5Vn4NCLxvjkd7rCOe6otPa4L6hZg9WM= -github.com/99designs/gqlgen v0.17.44 h1:OS2wLk/67Y+vXM75XHbwRnNYJcbuJd4OBL76RX3NQQA= -github.com/99designs/gqlgen v0.17.44/go.mod h1:UTCu3xpK2mLI5qcMNw+HKDiEL77it/1XtAjisC4sLwM= +github.com/99designs/gqlgen v0.17.49 h1:b3hNGexHd33fBSAd4NDT/c3NCcQzcAVkknhN9ym36YQ= +github.com/99designs/gqlgen v0.17.49/go.mod h1:tC8YFVZMed81x7UJ7ORUwXF4Kn6SXuucFqQBhN8+BU0= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible h1:KnPIugL51v3N3WwvaSmZbxukD1WuWXOiE9fRdu32f2I= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= @@ -44,13 +44,13 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/F5Networks/k8s-bigip-ctlr/v2 v2.17.1 h1:DsX6HIG2kxYg2bRM7jIVgyBb6PcJXBt9iCsTfLvFwWE= -github.com/F5Networks/k8s-bigip-ctlr/v2 v2.17.1/go.mod h1:mMF9pk71U8aIzMBS+CWq8OL3gLcFCRCiy+wNpE4gDIE= +github.com/F5Networks/k8s-bigip-ctlr/v2 v2.18.0 h1:soCQ+QIHHVk/WFQPOfS2moxtFqLHIQuFJlf1U9773aM= +github.com/F5Networks/k8s-bigip-ctlr/v2 v2.18.0/go.mod h1:m2bDK0Bb/KdhazvWWsQeQFw7R4QpHxX4U/cefZFBtHs= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/IBM-Cloud/ibm-cloud-cli-sdk v1.5.0 h1:+a994rHmNFwlSA609Z6SYhn9xt+lhGFF+dsgjMF75hY= github.com/IBM-Cloud/ibm-cloud-cli-sdk v1.5.0/go.mod h1:XxWyb5MQDU4GnRBSDZpGgIFwfbcn+GAUbPKS8CR8Bxc= -github.com/IBM/go-sdk-core/v5 v5.17.4 h1:VGb9+mRrnS2HpHZFM5hy4J6ppIWnwNrw0G+tLSgcJLc= -github.com/IBM/go-sdk-core/v5 v5.17.4/go.mod h1:KsAAI7eStAWwQa4F96MLy+whYSh39JzNjklZRbN/8ns= +github.com/IBM/go-sdk-core/v5 v5.17.5 h1:AjGC7xNee5tgDIjndekBDW5AbypdERHSgib3EZ1KNsA= +github.com/IBM/go-sdk-core/v5 v5.17.5/go.mod h1:KsAAI7eStAWwQa4F96MLy+whYSh39JzNjklZRbN/8ns= github.com/IBM/networking-go-sdk v0.49.0 h1:lPS34u3C0JVrbxH+Ulua76Nwl6Frv8BEfq6LRkyvOv0= github.com/IBM/networking-go-sdk v0.49.0/go.mod h1:G9CKbmPE8gSLjN+ABh4hIZ1bMx076enl5Eekvj6zQnA= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= @@ -77,8 +77,8 @@ github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:H github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/Yamashou/gqlgenc v0.24.0 h1:Aeufjb2zF0XxkeSTAVQ+DfiHL+ney/M2ovShZozBmHw= -github.com/Yamashou/gqlgenc v0.24.0/go.mod h1:3QQD8ZoeEyVXuzqcMDsl8OfCCCTk+ulaxkvFFQDupIA= +github.com/Yamashou/gqlgenc v0.25.0 h1:wb4CKKpnklmK9R+RQ68yoSdhqlK+MPflYT/hsMOE1+I= +github.com/Yamashou/gqlgenc v0.25.0/go.mod h1:KheDl3KZUFmnGCLHCHPQ6hodwWbggc889vwwaf0VqH8= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -94,8 +94,8 @@ github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAu github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 h1:P5U+E4x5OkVEKQDklVPmzs71WM56RTTRqV4OrDC//Y4= github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5/go.mod h1:976q2ETgjT2snVCf2ZaBnyBbVoPERGjUz+0sofzEfro= -github.com/aliyun/alibaba-cloud-sdk-go v1.63.0 h1:GIwkDPfeF/IBh5lZ5Mig50r1LXomNXR7t/oKGSMJWns= -github.com/aliyun/alibaba-cloud-sdk-go v1.63.0/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ= +github.com/aliyun/alibaba-cloud-sdk-go v1.63.16 h1:LNaqt0rxIcqHYarmdIZ3ZM7lqUWaWZ1Sqi1XPV1zMko= +github.com/aliyun/alibaba-cloud-sdk-go v1.63.16/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6/go.mod h1:+lx6/Aqd1kLJ1GQfkvOnaZ1WGmLpMpbprPuIOOZX30U= @@ -117,44 +117,44 @@ github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQ github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP8dY= -github.com/aws/aws-sdk-go-v2 v1.30.3/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc= -github.com/aws/aws-sdk-go-v2/config v1.27.27 h1:HdqgGt1OAP0HkEDDShEl0oSYa9ZZBSOmKpdpsDMdO90= -github.com/aws/aws-sdk-go-v2/config v1.27.27/go.mod h1:MVYamCg76dFNINkZFu4n4RjDixhVr51HLj4ErWzrVwg= -github.com/aws/aws-sdk-go-v2/credentials v1.17.27 h1:2raNba6gr2IfA0eqqiP2XiQ0UVOpGPgDSi0I9iAP+UI= -github.com/aws/aws-sdk-go-v2/credentials v1.17.27/go.mod h1:gniiwbGahQByxan6YjQUMcW4Aov6bLC3m+evgcoN4r4= -github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.14.10 h1:orAIBscNu5aIjDOnKIrjO+IUFPMLKj3Lp0bPf4chiPc= -github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.14.10/go.mod h1:GNjJ8daGhv10hmQYCnmkV8HuY6xXOXV4vzBssSjEIlU= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 h1:KreluoV8FZDEtI6Co2xuNk/UqI9iwMrOx/87PBNIKqw= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11/go.mod h1:SeSUYBLsMYFoRvHE0Tjvn7kbxaUhl75CJi1sbfhMxkU= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 h1:SoNJ4RlFEQEbtDcCEt+QG56MY4fm4W8rYirAmq+/DdU= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15/go.mod h1:U9ke74k1n2bf+RIgoX1SXFed1HLs51OgUSs+Ph0KJP8= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 h1:C6WHdGnTDIYETAm5iErQUiVNsclNx9qbJVPIt03B6bI= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15/go.mod h1:ZQLZqhcu+JhSrA9/NXRm8SkDvsycE+JkV3WGY41e+IM= -github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= -github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.4 h1:utG3S4T+X7nONPIpRoi1tVcQdAdJxntiVS2yolPJyXc= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.4/go.mod h1:q9vzW3Xr1KEXa8n4waHiFt1PrppNDlMymlYP+xpsFbY= -github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.3 h1:r27/FnxLPixKBRIlslsvhqscBuMK8uysCYG9Kfgm098= -github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.3/go.mod h1:jqOFyN+QSWSoQC+ppyc4weiO8iNQXbzRbxDjQ1ayYd4= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 h1:dT3MqvGhSoaIhRseqw2I0yH81l7wiR2vjs57O51EAm8= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3/go.mod h1:GlAeCkHwugxdHaueRr4nhPuY+WW+gR8UjlcqzPr1SPI= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.16 h1:lhAX5f7KpgwyieXjbDnRTjPEUI0l3emSRyxXj1PXP8w= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.16/go.mod h1:AblAlCwvi7Q/SFowvckgN+8M3uFPlopSYeLlbNDArhA= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 h1:HGErhhrxZlQ044RiM+WdoZxp0p+EGM62y3L6pwA4olE= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17/go.mod h1:RkZEx4l0EHYDJpWppMJ3nD9wZJAa8/0lq9aVC+r2UII= -github.com/aws/aws-sdk-go-v2/service/route53 v1.42.3 h1:MmLCRqP4U4Cw9gJ4bNrCG0mWqEtBlmAVleyelcHARMU= -github.com/aws/aws-sdk-go-v2/service/route53 v1.42.3/go.mod h1:AMPjK2YnRh0YgOID3PqhJA1BRNfXDfGOnSsKHtAe8yA= -github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.3 h1:EthA93BNgTnk36FoI9DCKtv4S0m63WzdGDYlBp/CvHQ= -github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.3/go.mod h1:4xh/h0pevPhBkA4b2iYosZaqrThccxFREQxiGuZpJlc= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 h1:BXx0ZIxvrJdSgSvKTZ+yRBeSqqgPM89VPlulEcl37tM= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.4/go.mod h1:ooyCOXjvJEsUw7x+ZDHeISPMhtwI3ZCB7ggFMcFfWLU= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 h1:yiwVzJW2ZxZTurVbYWA7QOrAaCYQR72t0wrSBfoesUE= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4/go.mod h1:0oxfLkpz3rQ/CHlx5hB7H69YUpFiI1tql6Q6Ne+1bCw= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 h1:ZsDKRLXGWHk8WdtyYMoGNO7bTudrvuKpDKgMVRlepGE= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.3/go.mod h1:zwySh8fpFyXp9yOr/KVzxOl8SRqgf/IDw5aUt9UKFcQ= -github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE= -github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= +github.com/aws/aws-sdk-go-v2 v1.30.5 h1:mWSRTwQAb0aLE17dSzztCVJWI9+cRMgqebndjwDyK0g= +github.com/aws/aws-sdk-go-v2 v1.30.5/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0= +github.com/aws/aws-sdk-go-v2/config v1.27.34 h1:5sLceuETg/215nLtY/QIVB2O6cosS0iC/Tx5oyqUhbw= +github.com/aws/aws-sdk-go-v2/config v1.27.34/go.mod h1:kEqdYzRb8dd8Sy2pOdEbExTTF5v7ozEXX0McgPE7xks= +github.com/aws/aws-sdk-go-v2/credentials v1.17.32 h1:7Cxhp/BnT2RcGy4VisJ9miUPecY+lyE9I8JvcZofn9I= +github.com/aws/aws-sdk-go-v2/credentials v1.17.32/go.mod h1:P5/QMF3/DCHbXGEGkdbilXHsyTBX5D3HSwcrSc9p20I= +github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.3 h1:/BPXKQ6n1cDWPmc5FWF6fCSaUtK+dWkWd0x9dI4dgaI= +github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.3/go.mod h1:qabLXChRlJREypX5RN/Z47GU+RaMsjotNCZfZ85oD0M= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 h1:pfQ2sqNpMVK6xz2RbqLEL0GH87JOwSxPV2rzm8Zsb74= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13/go.mod h1:NG7RXPUlqfsCLLFfi0+IpKN4sCB9D9fw/qTaSB+xRoU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 h1:pI7Bzt0BJtYA0N/JEC6B8fJ4RBrEMi1LBrkMdFYNSnQ= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17/go.mod h1:Dh5zzJYMtxfIjYW+/evjQ8uj2OyR/ve2KROHGHlSFqE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17 h1:Mqr/V5gvrhA2gvgnF42Zh5iMiQNcOYthFYwCyrnuWlc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17/go.mod h1:aLJpZlCmjE+V+KtN1q1uyZkfnUWpQGpbsn89XPKyzfU= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.9 h1:jbqgtdKfAXebx2/l2UhDEe/jmmCIhaCO3HFK71M7VzM= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.9/go.mod h1:N3YdUYxyxhiuAelUgCpSVBuBI1klobJxZrDtL+olu10= +github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.7 h1:VTBHXWkSeFgT3sfYB4U92qMgzHl0nz9H1tYNHHutLg0= +github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.7/go.mod h1:F/ybU7YfgFcktSp+biKgiHjyscGhlZxOz4QFFQqHXGw= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 h1:KypMCbLPPHEmf9DgMGw51jMj77VfGPAN2Kv4cfhlfgI= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4/go.mod h1:Vz1JQXliGcQktFTN/LN6uGppAIRoLBR2bMvIMP0gOjc= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.18 h1:GACdEPdpBE59I7pbfvu0/Mw1wzstlP3QtPHklUxybFE= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.18/go.mod h1:K+xV06+Wni4TSaOOJ1Y35e5tYOCUBYbebLKmJQQa8yY= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 h1:rfprUlsdzgl7ZL2KlXiUAoJnI/VxfHCvDFr2QDFj6u4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19/go.mod h1:SCWkEdRq8/7EK60NcvvQ6NXKuTcchAD4ROAsC37VEZE= +github.com/aws/aws-sdk-go-v2/service/route53 v1.43.2 h1:957e1/SwXIfPi/0OUJkH9YnPZRe9G6Kisd/xUhF7AUE= +github.com/aws/aws-sdk-go-v2/service/route53 v1.43.2/go.mod h1:343vcjcyOTuHTBBgUrOxPM36/jE96qLZnGL447ldrB0= +github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.7 h1:mHdnEFOQ0JVjsbjHGqkuE0pmEpnk/aWz8YxyyB4e2+E= +github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.7/go.mod h1:JsD+G3R0ZMWqjt7VDggNsc5SFl4hw+Sk8KQaRN1sltI= +github.com/aws/aws-sdk-go-v2/service/sso v1.22.7 h1:pIaGg+08llrP7Q5aiz9ICWbY8cqhTkyy+0SHvfzQpTc= +github.com/aws/aws-sdk-go-v2/service/sso v1.22.7/go.mod h1:eEygMHnTKH/3kNp9Jr1n3PdejuSNcgwLe1dWgQtO0VQ= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7 h1:/Cfdu0XV3mONYKaOt1Gr0k1KvQzkzPyiKUdlWJqy+J4= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7/go.mod h1:bCbAxKDqNvkHxRaIMnyVPXPo+OaPRwvmgzMxbz1VKSA= +github.com/aws/aws-sdk-go-v2/service/sts v1.30.7 h1:NKTa1eqZYw8tiHSRGpP0VtTdub/8KNk8sDkNPFaOKDE= +github.com/aws/aws-sdk-go-v2/service/sts v1.30.7/go.mod h1:NXi1dIAGteSaRLqYgarlhP/Ij0cFT+qmCwiJqWh/U5o= +github.com/aws/smithy-go v1.20.4 h1:2HK1zBdPgRbjFOHlfeQZfpC4r72MOb9bZkiFwggKO+4= +github.com/aws/smithy-go v1.20.4/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -183,12 +183,12 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= -github.com/civo/civogo v0.3.73 h1:thkNnkziU+xh+MEOChIUwRZI1forN20+SSAPe/VFDME= -github.com/civo/civogo v0.3.73/go.mod h1:7UCYX+qeeJbrG55E1huv+0ySxcHTqq/26FcHLVelQJM= +github.com/civo/civogo v0.3.77 h1:1rl5cpQruPhh+w8BBMpGQsaovjDvA44udPoDTAa45rk= +github.com/civo/civogo v0.3.77/go.mod h1:7UCYX+qeeJbrG55E1huv+0ySxcHTqq/26FcHLVelQJM= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.102.0 h1:+0MGbkirM/yzVLOYpWMgW7CDdKzesSbdwA2Y+rABrWI= -github.com/cloudflare/cloudflare-go v0.102.0/go.mod h1:BOB41tXf31ti/qtBO9paYhyapotQbGRDbQoLOAF7pSg= +github.com/cloudflare/cloudflare-go v0.104.0 h1:R/lB0dZupaZbOgibAH/BRrkFbZ6Acn/WsKg2iX2xXuY= +github.com/cloudflare/cloudflare-go v0.104.0/go.mod h1:pfUQ4PIG4ISI0/Mmc21Bp86UnFU0ktmPf3iTgbSL+cM= github.com/cloudfoundry-community/go-cfclient v0.0.0-20190201205600-f136f9222381 h1:rdRS5BT13Iae9ssvcslol66gfOOXjaLYwqerEn/cl9s= github.com/cloudfoundry-community/go-cfclient v0.0.0-20190201205600-f136f9222381/go.mod h1:e5+USP2j8Le2M0Jo3qKPFnNhuo1wueU4nWHCXBOfQ14= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -251,8 +251,8 @@ github.com/denverdino/aliyungo v0.0.0-20230411124812-ab98a9173ace/go.mod h1:TK05 github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/digitalocean/godo v1.120.0 h1:t2DpzIitSnCDNQM7svSW4+cZd8E4Lv6+r8y33Kym0Xw= -github.com/digitalocean/godo v1.120.0/go.mod h1:WQVH83OHUy6gC4gXpEVQKtxTd4L5oCp+5OialidkPLY= +github.com/digitalocean/godo v1.124.0 h1:qroI1QdtcgnXF/pefq9blZRbXqBw1Ry/aHh2pnu/328= +github.com/digitalocean/godo v1.124.0/go.mod h1:WQVH83OHUy6gC4gXpEVQKtxTd4L5oCp+5OialidkPLY= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnsimple/dnsimple-go v1.7.0 h1:JKu9xJtZ3SqOC+BuYgAWeab7+EEx0sz422vu8j611ZY= github.com/dnsimple/dnsimple-go v1.7.0/go.mod h1:EKpuihlWizqYafSnQHGCd/gyvy3HkEQJ7ODB4KdV8T8= @@ -523,8 +523,8 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= -github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= +github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= +github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= @@ -704,8 +704,8 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linki/instrumented_http v0.3.0 h1:dsN92+mXpfZtjJraartcQ99jnuw7fqsnPDjr85ma2dA= github.com/linki/instrumented_http v0.3.0/go.mod h1:pjYbItoegfuVi2GUOMhEqzvm/SJKuEL3H0tc8QRLRFk= -github.com/linode/linodego v1.39.0 h1:gRsj2PXX+HTO3eYQaXEuQGsLeeLFDSBDontC5JL3Nn8= -github.com/linode/linodego v1.39.0/go.mod h1:da8KzAQKSm5obwa06yXk5CZSDFMP9Wb08GA/O+aR9W0= +github.com/linode/linodego v1.40.0 h1:7ESY0PwK94hoggoCtIroT1Xk6b1flrFBNZ6KwqbTqlI= +github.com/linode/linodego v1.40.0/go.mod h1:NsUw4l8QrLdIofRg1NYFBbW5ZERnmbZykVBszPZLORM= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/lyft/protoc-gen-star v0.4.10/go.mod h1:mE8fbna26u7aEA2QCVvvfBU/ZrPgocG1206xAFPcs94= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= @@ -849,8 +849,8 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/oracle/oci-go-sdk/v65 v65.71.1 h1:t1GpyLYaD/x2OrUoSyxNwBQaDaQP4F084FX8LQMXA/s= -github.com/oracle/oci-go-sdk/v65 v65.71.1/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= +github.com/oracle/oci-go-sdk/v65 v65.73.0 h1:C7uel6CoKk4A1KPkdhFBAyvVyFRTHAmX8m0o64RmfPg= +github.com/oracle/oci-go-sdk/v65 v65.73.0/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= github.com/ovh/go-ovh v1.6.0 h1:ixLOwxQdzYDx296sXcgS35TOPEahJkpjMGtzPadCjQI= github.com/ovh/go-ovh v1.6.0/go.mod h1:cTVDnl94z4tl8pP1uZ/8jlVxntjSIf09bNcQ5TJSC7c= github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2 h1:CXwSGu/LYmbjEab5aMCs5usQRVBGThelUKBNnoSOuso= @@ -894,8 +894,8 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.6.0/go.mod h1:ZLOG9ck3JLRdB5MgO8f+lLTe83AXG6ro35rLTxvnIl4= -github.com/prometheus/client_golang v1.20.0 h1:jBzTZ7B099Rg24tny+qngoynol8LtVYlA2bqx3vEloI= -github.com/prometheus/client_golang v1.20.0/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -944,8 +944,8 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29 h1:BkTk4gynLjguayxrYxZoMZjBnAOh7ntQvUkOFmkMqPU= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30 h1:yoKAVkEVwAqbGbR8n87rHQ1dulL25rKloGadb3vm770= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30/go.mod h1:sH0u6fq6x4R5M7WxkoQFY/o7UaiItec0o1LinLCJNq8= github.com/schollz/progressbar/v3 v3.8.6 h1:QruMUdzZ1TbEP++S1m73OqRJk20ON11m6Wqv4EoGg8c= github.com/schollz/progressbar/v3 v3.8.6/go.mod h1:W5IEwbJecncFGBvuEh4A7HT1nZZ6WNIL2i3qbnI0WKY= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= @@ -974,8 +974,8 @@ github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4k github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/sony/gobreaker v0.5.0 h1:dRCvqm0P490vZPmy7ppEk2qCnCieBooFJ+YoXGYB+yg= github.com/sony/gobreaker v0.5.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/sosodev/duration v1.2.0 h1:pqK/FLSjsAADWY74SyWDCjOcd5l7H8GSnnOGEB9A1Us= -github.com/sosodev/duration v1.2.0/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg= +github.com/sosodev/duration v1.3.1 h1:qtHBDMQ6lvMQsL15g4aopM4HEfOaYuhWBw3NPTtlqq4= +github.com/sosodev/duration v1.3.1/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= @@ -1017,19 +1017,19 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.984 h1:QLSx+ibsV68NXKgzofPuo1gxFwYSWk2++rvxZxNjbVo= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.984/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.984 h1:ABZeSsOOkkBn+gToVp8KkMt4E69hQkBMEFegCD4w15Q= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.984/go.mod h1:r++X8dKvTZWltr4J83TIwqGlyvG5fKaVh7RGC2+BryI= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.984 h1:dD0pLtMCJyRNMTystzaZ9WAK+UBb2ymGcdbkhtAub+8= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.984/go.mod h1:hWQvbAt8kqN3JLfVpgxsn2YNxDBLaiUaXZFtF4ymRjU= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1003 h1:cl6DSa2pWPGS3GFG+UUmMewolR1x7Q7GR04xcjtGl9s= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1003/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1003 h1:0V2mVcFk5t9fDtHU6FAmAgaB3QY44pcgA0JDo0vElE0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1003/go.mod h1:DQJIItbcvoOX27p4pHtRfVt5yrKSJReFVCMLSFdO2ks= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1003 h1:wctJotD/c/sQsHYm9mu8kqMMdWluB+Z8ZNk3Mih72oQ= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1003/go.mod h1:XJ6xN9ZY8TqMguLXlG8Lc6upleS96HHVG2HD1IO6qdw= github.com/terra-farm/udnssdk v1.3.5 h1:MNR3adfuuEK/l04+jzo8WW/0fnorY+nW515qb3vEr6I= github.com/terra-farm/udnssdk v1.3.5/go.mod h1:8RnM56yZTR7mYyUIvrDgXzdRaEyFIzqdEi7+um26Sv8= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/transip/gotransip/v6 v6.25.0 h1:/H+SjMq/9HNZ0/maE1OLhJpxLaCGHsxq0PWaMPJHxK4= -github.com/transip/gotransip/v6 v6.25.0/go.mod h1:x0/RWGRK/zob817O3tfO2xhFoP1vu8YOHORx6Jpk80s= +github.com/transip/gotransip/v6 v6.26.0 h1:Aejfvh8rSp8Mj2GX/RpdBjMCv+Iy/DmgfNgczPDP550= +github.com/transip/gotransip/v6 v6.26.0/go.mod h1:x0/RWGRK/zob817O3tfO2xhFoP1vu8YOHORx6Jpk80s= github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= @@ -1049,8 +1049,8 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= -github.com/vektah/gqlparser/v2 v2.5.14 h1:dzLq75BJe03jjQm6n56PdH1oweB8ana42wj7E4jRy70= -github.com/vektah/gqlparser/v2 v2.5.14/go.mod h1:WQQjFc+I1YIzoPvZBhUQX7waZgg3pMLi0r8KymvAE2w= +github.com/vektah/gqlparser/v2 v2.5.16 h1:1gcmLTvs3JLKXckwCwlUagVn/IlV2bwqle0vJ0vy5p8= +github.com/vektah/gqlparser/v2 v2.5.16/go.mod h1:1lz1OeCqgQbQepsGxPVywrjdBHW2T08PUS3pJqepRww= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= @@ -1075,12 +1075,12 @@ github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wK go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd/api/v3 v3.5.15 h1:3KpLJir1ZEBrYuV2v+Twaa/e2MdDCEZ/70H+lzEiwsk= -go.etcd.io/etcd/api/v3 v3.5.15/go.mod h1:N9EhGzXq58WuMllgH9ZvnEr7SI9pS0k0+DHZezGp7jM= -go.etcd.io/etcd/client/pkg/v3 v3.5.15 h1:fo0HpWz/KlHGMCC+YejpiCmyWDEuIpnTDzpJLB5fWlA= -go.etcd.io/etcd/client/pkg/v3 v3.5.15/go.mod h1:mXDI4NAOwEiszrHCb0aqfAYNCrZP4e9hRca3d1YK8EU= -go.etcd.io/etcd/client/v3 v3.5.15 h1:23M0eY4Fd/inNv1ZfU3AxrbbOdW79r9V9Rl62Nm6ip4= -go.etcd.io/etcd/client/v3 v3.5.15/go.mod h1:CLSJxrYjvLtHsrPKsy7LmZEE+DK2ktfd2bN4RhBMwlU= +go.etcd.io/etcd/api/v3 v3.5.16 h1:WvmyJVbjWqK4R1E+B12RRHz3bRGy9XVfh++MgbN+6n0= +go.etcd.io/etcd/api/v3 v3.5.16/go.mod h1:1P4SlIP/VwkDmGo3OlOD7faPeP8KDIFhqvciH5EfN28= +go.etcd.io/etcd/client/pkg/v3 v3.5.16 h1:ZgY48uH6UvB+/7R9Yf4x574uCO3jIx0TRDyetSfId3Q= +go.etcd.io/etcd/client/pkg/v3 v3.5.16/go.mod h1:V8acl8pcEK0Y2g19YlOV9m9ssUe6MgiDSobSoaBAM0E= +go.etcd.io/etcd/client/v3 v3.5.16 h1:sSmVYOAHeC9doqi0gv7v86oY/BTld0SEFGaxsU9eRhE= +go.etcd.io/etcd/client/v3 v3.5.16/go.mod h1:X+rExSGkyqxvu276cr2OwPLBaeqFu1cIl4vmRjAD/50= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= @@ -1093,14 +1093,14 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= -go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= -go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= -go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= -go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= -go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= -go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= +go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= +go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= +go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= +go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= +go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= +go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1147,8 +1147,8 @@ golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1218,14 +1218,14 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190130055435-99b60b757ec1/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= -golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1295,8 +1295,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1304,8 +1304,8 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= -golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1317,8 +1317,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1376,8 +1376,8 @@ gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZ google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.192.0 h1:PljqpNAfZaaSpS+TnANfnNAXKdzHM/B9bKhwRlo7JP0= -google.golang.org/api v0.192.0/go.mod h1:9VcphjvAxPKLmSxVSzPlSRXy/5ARMEw5bf58WoVXafQ= +google.golang.org/api v0.197.0 h1:x6CwqQLsFiA5JKAiGyGBjc2bNtHtLddhJCE2IKuhhcQ= +google.golang.org/api v0.197.0/go.mod h1:AuOuo20GoQ331nq7DquGHlU6d+2wN2fZ8O0ta60nRNw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1392,10 +1392,10 @@ google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dT google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f h1:b1Ln/PG8orm0SsBbHZWke8dDp2lrCD4jSmfglFpTZbk= -google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f/go.mod h1:AHT0dDg3SoMOgZGnZk29b5xTbPHMoEC8qthmBLJCpys= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf h1:liao9UHurZLtiEwBgT9LMOnKYsHze6eA6w1KQCMVN2Q= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed h1:3RgNmBoI9MZhsj3QxC+AP/qQhNwpCLOvYDYYsFrhFt0= +google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1410,8 +1410,8 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.1 h1:hO5qAXR19+/Z44hmvIM4dQFMSYX9XcWsByfoxutBpAM= +google.golang.org/grpc v1.66.1/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1481,23 +1481,23 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -istio.io/api v1.23.0 h1:yqv3lNW6XSYS5XkbEkxsmFROXIQznp4lFWqj7xKEqCA= -istio.io/api v1.23.0/go.mod h1:QPSTGXuIQdnZFEm3myf9NZ5uBMwCdJWUvfj9ZZ+2oBM= -istio.io/client-go v1.23.0 h1://xojbifr84q29WE3eMx74p36hD4lvcejX1KxE3iJvY= -istio.io/client-go v1.23.0/go.mod h1:3qX/KBS5aR47QV4JhphcZl5ysnZ53x78TBjNQLM2TC4= +istio.io/api v1.23.1 h1:bm2XF0j058FfzWVHUfpmMj4sFDkcD1X609qs5AU97Pc= +istio.io/api v1.23.1/go.mod h1:QPSTGXuIQdnZFEm3myf9NZ5uBMwCdJWUvfj9ZZ+2oBM= +istio.io/client-go v1.23.1 h1:IX2cgUUXnVYo+9H6bFGSp/vuKVLPUkmiN8qk1/mvsYs= +istio.io/client-go v1.23.1/go.mod h1:+fxu+O2GkITM3HEREUWdobvRXqI/UhAAI7hfxqqpRh0= k8s.io/api v0.18.0/go.mod h1:q2HRQkfDzHMBZL9l/y9rH63PkQl4vae0xRT+8prbrK8= k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= k8s.io/api v0.18.4/go.mod h1:lOIQAKYgai1+vz9J7YcDZwC26Z0zQewYOGWdyIPUUQ4= -k8s.io/api v0.31.0 h1:b9LiSjR2ym/SzTOlfMHm1tr7/21aD7fSkqgD/CVJBCo= -k8s.io/api v0.31.0/go.mod h1:0YiFF+JfFxMM6+1hQei8FY8M7s1Mth+z/q7eF1aJkTE= +k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU= +k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI= k8s.io/apiextensions-apiserver v0.18.0/go.mod h1:18Cwn1Xws4xnWQNC00FLq1E350b9lUF+aOdIWDOZxgo= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.18.4/go.mod h1:NYeyeYq4SIpFlPxSAB6jHPIdvu3hL0pc36wuRChybio= k8s.io/apimachinery v0.18.0/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= k8s.io/apimachinery v0.18.4/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= -k8s.io/apimachinery v0.31.0 h1:m9jOiSr3FoSSL5WO9bjm1n6B9KROYYgNZOb4tyZ1lBc= -k8s.io/apimachinery v0.31.0/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= +k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/apiserver v0.18.0/go.mod h1:3S2O6FeBBd6XTo0njUrLxiqk8GNy6wWOftjhJcXYnjw= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.18.4/go.mod h1:q+zoFct5ABNnYkGIaGQ3bcbUNdmPyOCoEBcg51LChY8= @@ -1506,8 +1506,8 @@ k8s.io/cli-runtime v0.18.4/go.mod h1:9/hS/Cuf7NVzWR5F/5tyS6xsnclxoPLVtwhnkJG1Y4g k8s.io/client-go v0.18.0/go.mod h1:uQSYDYs4WhVZ9i6AIoEZuwUggLVEF64HOD37boKAtF8= k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= k8s.io/client-go v0.18.4/go.mod h1:f5sXwL4yAZRkAtzOxRWUhA/N8XzGCb+nPZI8PfobZ9g= -k8s.io/client-go v0.31.0 h1:QqEJzNjbN2Yv1H79SsS+SWnXkBgVu4Pj3CJQgbx0gI8= -k8s.io/client-go v0.31.0/go.mod h1:Y9wvC76g4fLjmU0BA+rV+h2cncoadjvjjkkIGoTLcGU= +k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0= +k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg= k8s.io/code-generator v0.18.0/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.4/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= diff --git a/provider/alibabacloud/alibaba_cloud_test.go b/provider/alibabacloud/alibaba_cloud_test.go index edb6d12a0..8d4b47464 100644 --- a/provider/alibabacloud/alibaba_cloud_test.go +++ b/provider/alibabacloud/alibaba_cloud_test.go @@ -212,16 +212,16 @@ func (m *MockAlibabaCloudPrivateZoneAPI) DescribeZoneInfo(request *pvtz.Describe response = pvtz.CreateDescribeZoneInfoResponse() response.ZoneId = m.zone.ZoneId response.ZoneName = m.zone.ZoneName - response.BindVpcs = pvtz.BindVpcsInDescribeZoneInfo{Vpc: m.zone.Vpcs.Vpc} + response.BindVpcs = pvtz.BindVpcsInDescribeZoneInfo{Vpc: make([]pvtz.VpcInDescribeZoneInfo, len(m.zone.Vpcs.Vpc))} + for idx, vpc := range m.zone.Vpcs.Vpc { + response.BindVpcs.Vpc[idx] = pvtz.VpcInDescribeZoneInfo{VpcName: vpc.VpcName, VpcId: vpc.VpcId, VpcType: vpc.VpcType, RegionName: vpc.RegionName, RegionId: vpc.RegionId} + } return response, nil } func newTestAlibabaCloudProvider(private bool) *AlibabaCloudProvider { cfg := alibabaCloudConfig{ - RegionID: "cn-beijing", - AccessKeyID: "xxxxxx", - AccessKeySecret: "xxxxxx", - VPCID: "vpc-xxxxxx", + VPCID: "vpc-xxxxxx", } // //dnsClient, _ := alidns.NewClientWithAccessKey( diff --git a/provider/cloudflare/cloudflare_test.go b/provider/cloudflare/cloudflare_test.go index 22e0b753c..564fa0461 100644 --- a/provider/cloudflare/cloudflare_test.go +++ b/provider/cloudflare/cloudflare_test.go @@ -54,7 +54,6 @@ type mockCloudFlareClient struct { var ExampleDomain = []cloudflare.DNSRecord{ { ID: "1234567890", - ZoneID: "001", Name: "foobar.bar.com", Type: endpoint.RecordTypeA, TTL: 120, @@ -63,7 +62,6 @@ var ExampleDomain = []cloudflare.DNSRecord{ }, { ID: "2345678901", - ZoneID: "001", Name: "foobar.bar.com", Type: endpoint.RecordTypeA, TTL: 120, @@ -72,7 +70,6 @@ var ExampleDomain = []cloudflare.DNSRecord{ }, { ID: "1231231233", - ZoneID: "002", Name: "bar.foo.com", Type: endpoint.RecordTypeA, TTL: 1, @@ -328,7 +325,6 @@ func AssertActions(t *testing.T, provider *CloudFlareProvider, endpoints []*endp } err = provider.ApplyChanges(context.Background(), changes) - if err != nil { t.Fatalf("cannot apply changes, %s", err) } @@ -1163,7 +1159,6 @@ func TestProviderPropertiesIdempotency(t *testing.T) { "001": { { ID: "1234567890", - ZoneID: "001", Name: "foobar.bar.com", Type: endpoint.RecordTypeA, TTL: 120, @@ -1268,7 +1263,6 @@ func TestCloudflareComplexUpdate(t *testing.T) { planned := plan.Calculate() err = provider.ApplyChanges(context.Background(), planned.Changes) - if err != nil { t.Errorf("should not fail, %s", err) } @@ -1310,7 +1304,6 @@ func TestCustomTTLWithEnabledProxyNotChanged(t *testing.T) { "001": { { ID: "1234567890", - ZoneID: "001", Name: "foobar.bar.com", Type: endpoint.RecordTypeA, TTL: 1, From 1a909b871d145994c0ee3e80e67f3331dcc5b3d9 Mon Sep 17 00:00:00 2001 From: romeroalx Date: Tue, 17 Sep 2024 17:55:48 +0200 Subject: [PATCH 49/82] pdns provider: added optional argument to make server_id configurable --- docs/tutorials/pdns.md | 1 + main.go | 1 + pkg/apis/externaldns/types.go | 3 +++ pkg/apis/externaldns/types_test.go | 4 ++++ provider/pdns/pdns.go | 11 ++++++----- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/tutorials/pdns.md b/docs/tutorials/pdns.md index 365fffb80..7e2ad674a 100644 --- a/docs/tutorials/pdns.md +++ b/docs/tutorials/pdns.md @@ -47,6 +47,7 @@ spec: - --source=service # or ingress or both - --provider=pdns - --pdns-server={{ pdns-api-url }} + - --pdns-server-id={{ pdns-server-id }} - --pdns-api-key={{ pdns-http-api-key }} - --txt-owner-id={{ owner-id-for-this-external-dns }} - --domain-filter=external-dns-test.my-org.com # will make ExternalDNS see only the zones matching provided domain; omit to process all available zones in PowerDNS diff --git a/main.go b/main.go index 985124349..619d25fce 100644 --- a/main.go +++ b/main.go @@ -286,6 +286,7 @@ func main() { DomainFilter: domainFilter, DryRun: cfg.DryRun, Server: cfg.PDNSServer, + ServerID: cfg.PDNSServerID, APIKey: cfg.PDNSAPIKey, TLSConfig: pdns.TLSConfig{ SkipTLSVerify: cfg.PDNSSkipTLSVerify, diff --git a/pkg/apis/externaldns/types.go b/pkg/apis/externaldns/types.go index 02b59a422..9155bccd3 100644 --- a/pkg/apis/externaldns/types.go +++ b/pkg/apis/externaldns/types.go @@ -122,6 +122,7 @@ type Config struct { OVHEndpoint string OVHApiRateLimit int PDNSServer string + PDNSServerID string PDNSAPIKey string `secure:"yes"` PDNSSkipTLSVerify bool TLSCA string @@ -276,6 +277,7 @@ var defaultConfig = &Config{ OVHEndpoint: "ovh-eu", OVHApiRateLimit: 20, PDNSServer: "http://localhost:8081", + PDNSServerID: "localhost", PDNSAPIKey: "", PDNSSkipTLSVerify: false, TLSCA: "", @@ -498,6 +500,7 @@ func (cfg *Config) ParseFlags(args []string) error { app.Flag("ovh-endpoint", "When using the OVH provider, specify the endpoint (default: ovh-eu)").Default(defaultConfig.OVHEndpoint).StringVar(&cfg.OVHEndpoint) app.Flag("ovh-api-rate-limit", "When using the OVH provider, specify the API request rate limit, X operations by seconds (default: 20)").Default(strconv.Itoa(defaultConfig.OVHApiRateLimit)).IntVar(&cfg.OVHApiRateLimit) app.Flag("pdns-server", "When using the PowerDNS/PDNS provider, specify the URL to the pdns server (required when --provider=pdns)").Default(defaultConfig.PDNSServer).StringVar(&cfg.PDNSServer) + app.Flag("pdns-server-id", "When using the PowerDNS/PDNS provider, specify the id of the server to retrieve. Should be `localhost` except when the server is behind a proxy (optional when --provider=pdns) (default: localhost)").Default(defaultConfig.PDNSServerID).StringVar(&cfg.PDNSServerID) app.Flag("pdns-api-key", "When using the PowerDNS/PDNS provider, specify the API key to use to authorize requests (required when --provider=pdns)").Default(defaultConfig.PDNSAPIKey).StringVar(&cfg.PDNSAPIKey) app.Flag("pdns-skip-tls-verify", "When using the PowerDNS/PDNS provider, disable verification of any TLS certificates (optional when --provider=pdns) (default: false)").Default(strconv.FormatBool(defaultConfig.PDNSSkipTLSVerify)).BoolVar(&cfg.PDNSSkipTLSVerify) app.Flag("ns1-endpoint", "When using the NS1 provider, specify the URL of the API endpoint to target (default: https://api.nsone.net/v1/)").Default(defaultConfig.NS1Endpoint).StringVar(&cfg.NS1Endpoint) diff --git a/pkg/apis/externaldns/types_test.go b/pkg/apis/externaldns/types_test.go index e52f87f49..70b959b56 100644 --- a/pkg/apis/externaldns/types_test.go +++ b/pkg/apis/externaldns/types_test.go @@ -88,6 +88,7 @@ var ( OVHEndpoint: "ovh-eu", OVHApiRateLimit: 20, PDNSServer: "http://localhost:8081", + PDNSServerID: "localhost", PDNSAPIKey: "", Policy: "sync", Registry: "txt", @@ -186,6 +187,7 @@ var ( OVHEndpoint: "ovh-ca", OVHApiRateLimit: 42, PDNSServer: "http://ns.example.com:8081", + PDNSServerID: "localhost", PDNSAPIKey: "some-secret-key", PDNSSkipTLSVerify: true, TLSCA: "/path/to/ca.crt", @@ -285,6 +287,7 @@ func TestParseFlags(t *testing.T) { "--ovh-endpoint=ovh-ca", "--ovh-api-rate-limit=42", "--pdns-server=http://ns.example.com:8081", + "--pdns-server-id=localhost", "--pdns-api-key=some-secret-key", "--pdns-skip-tls-verify", "--oci-config-file=oci.yaml", @@ -409,6 +412,7 @@ func TestParseFlags(t *testing.T) { "EXTERNAL_DNS_TARGET_NET_FILTER": "10.0.0.0/9\n10.1.0.0/9", "EXTERNAL_DNS_EXCLUDE_TARGET_NET": "1.0.0.0/9\n1.1.0.0/9", "EXTERNAL_DNS_PDNS_SERVER": "http://ns.example.com:8081", + "EXTERNAL_DNS_PDNS_ID": "localhost", "EXTERNAL_DNS_PDNS_API_KEY": "some-secret-key", "EXTERNAL_DNS_PDNS_SKIP_TLS_VERIFY": "1", "EXTERNAL_DNS_RDNS_ROOT_DOMAIN": "lb.rancher.cloud", diff --git a/provider/pdns/pdns.go b/provider/pdns/pdns.go index fbc7cc22f..f031d09b0 100644 --- a/provider/pdns/pdns.go +++ b/provider/pdns/pdns.go @@ -43,8 +43,6 @@ type pdnsChangeType string const ( apiBase = "/api/v1" - // Unless we use something like pdnsproxy (discontinued upstream), this value will _always_ be localhost - defaultServerID = "localhost" defaultTTL = 300 // PdnsDelete and PdnsReplace are effectively an enum for "pgo.RrSet.changetype" @@ -66,6 +64,7 @@ type PDNSConfig struct { DomainFilter endpoint.DomainFilter DryRun bool Server string + ServerID string APIKey string TLSConfig TLSConfig } @@ -137,6 +136,7 @@ type PDNSAPIProvider interface { // PDNSAPIClient : Struct that encapsulates all the PowerDNS specific implementation details type PDNSAPIClient struct { dryRun bool + serverID string authCtx context.Context client *pgo.APIClient domainFilter endpoint.DomainFilter @@ -146,7 +146,7 @@ type PDNSAPIClient struct { // ref: https://doc.powerdns.com/authoritative/http-api/zone.html#get--servers-server_id-zones func (c *PDNSAPIClient) ListZones() (zones []pgo.Zone, resp *http.Response, err error) { for i := 0; i < retryLimit; i++ { - zones, resp, err = c.client.ZonesApi.ListZones(c.authCtx, defaultServerID) + zones, resp, err = c.client.ZonesApi.ListZones(c.authCtx, c.serverID) if err != nil { log.Debugf("Unable to fetch zones %v", err) log.Debugf("Retrying ListZones() ... %d", i) @@ -180,7 +180,7 @@ func (c *PDNSAPIClient) PartitionZones(zones []pgo.Zone) (filteredZones []pgo.Zo // ref: https://doc.powerdns.com/authoritative/http-api/zone.html#get--servers-server_id-zones-zone_id func (c *PDNSAPIClient) ListZone(zoneID string) (zone pgo.Zone, resp *http.Response, err error) { for i := 0; i < retryLimit; i++ { - zone, resp, err = c.client.ZonesApi.ListZone(c.authCtx, defaultServerID, zoneID) + zone, resp, err = c.client.ZonesApi.ListZone(c.authCtx, c.serverID, zoneID) if err != nil { log.Debugf("Unable to fetch zone %v", err) log.Debugf("Retrying ListZone() ... %d", i) @@ -198,7 +198,7 @@ func (c *PDNSAPIClient) ListZone(zoneID string) (zone pgo.Zone, resp *http.Respo // ref: https://doc.powerdns.com/authoritative/http-api/zone.html#patch--servers-server_id-zones-zone_id func (c *PDNSAPIClient) PatchZone(zoneID string, zoneStruct pgo.Zone) (resp *http.Response, err error) { for i := 0; i < retryLimit; i++ { - resp, err = c.client.ZonesApi.PatchZone(c.authCtx, defaultServerID, zoneID, zoneStruct) + resp, err = c.client.ZonesApi.PatchZone(c.authCtx, c.serverID, zoneID, zoneStruct) if err != nil { log.Debugf("Unable to patch zone %v", err) log.Debugf("Retrying PatchZone() ... %d", i) @@ -245,6 +245,7 @@ func NewPDNSProvider(ctx context.Context, config PDNSConfig) (*PDNSProvider, err provider := &PDNSProvider{ client: &PDNSAPIClient{ dryRun: config.DryRun, + serverID: config.ServerID, authCtx: context.WithValue(ctx, pgo.ContextAPIKey, pgo.APIKey{Key: config.APIKey}), client: pgo.NewAPIClient(pdnsClientConfig), domainFilter: config.DomainFilter, From 2b998901247c44042f6c3c2d19d2a7e8e3054b37 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 04:01:22 +0000 Subject: [PATCH 50/82] chore(deps): bump the dev-dependencies group across 1 directory with 13 updates Bumps the dev-dependencies group with 10 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) | `1.27.34` | `1.27.35` | | [github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue](https://github.com/aws/aws-sdk-go-v2) | `1.15.3` | `1.15.4` | | [github.com/aws/aws-sdk-go-v2/service/route53](https://github.com/aws/aws-sdk-go-v2) | `1.43.2` | `1.43.3` | | [github.com/aws/aws-sdk-go-v2/service/servicediscovery](https://github.com/aws/aws-sdk-go-v2) | `1.31.7` | `1.31.8` | | [github.com/digitalocean/godo](https://github.com/digitalocean/godo) | `1.124.0` | `1.125.0` | | [github.com/oracle/oci-go-sdk/v65](https://github.com/oracle/oci-go-sdk) | `65.73.0` | `65.74.0` | | [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) | `1.20.3` | `1.20.4` | | [github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common](https://github.com/tencentcloud/tencentcloud-sdk-go) | `1.0.1003` | `1.0.1004` | | [github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod](https://github.com/tencentcloud/tencentcloud-sdk-go) | `1.0.1003` | `1.0.1004` | | [github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns](https://github.com/tencentcloud/tencentcloud-sdk-go) | `1.0.1003` | `1.0.1004` | Updates `github.com/aws/aws-sdk-go-v2/config` from 1.27.34 to 1.27.35 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.27.34...config/v1.27.35) Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.17.32 to 1.17.33 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.32...credentials/v1.17.33) Updates `github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue` from 1.15.3 to 1.15.4 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/config/v1.15.4/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.15.3...config/v1.15.4) Updates `github.com/aws/aws-sdk-go-v2/service/dynamodb` from 1.34.9 to 1.34.10 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/sqs/v1.34.9...service/dynamodb/v1.34.10) Updates `github.com/aws/aws-sdk-go-v2/service/route53` from 1.43.2 to 1.43.3 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ssm/v1.43.2...service/fsx/v1.43.3) Updates `github.com/aws/aws-sdk-go-v2/service/servicediscovery` from 1.31.7 to 1.31.8 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/efs/v1.31.7...service/efs/v1.31.8) Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.30.7 to 1.30.8 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/mgn/v1.30.7...service/sts/v1.30.8) Updates `github.com/digitalocean/godo` from 1.124.0 to 1.125.0 - [Release notes](https://github.com/digitalocean/godo/releases) - [Changelog](https://github.com/digitalocean/godo/blob/main/CHANGELOG.md) - [Commits](https://github.com/digitalocean/godo/compare/v1.124.0...v1.125.0) Updates `github.com/oracle/oci-go-sdk/v65` from 65.73.0 to 65.74.0 - [Release notes](https://github.com/oracle/oci-go-sdk/releases) - [Changelog](https://github.com/oracle/oci-go-sdk/blob/master/CHANGELOG.md) - [Commits](https://github.com/oracle/oci-go-sdk/compare/v65.73.0...v65.74.0) Updates `github.com/prometheus/client_golang` from 1.20.3 to 1.20.4 - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.20.3...v1.20.4) Updates `github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common` from 1.0.1003 to 1.0.1004 - [Commits](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.0.1003...v1.0.1004) Updates `github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod` from 1.0.1003 to 1.0.1004 - [Commits](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.0.1003...v1.0.1004) Updates `github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns` from 1.0.1003 to 1.0.1004 - [Commits](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.0.1003...v1.0.1004) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/credentials dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/dynamodb dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/route53 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/servicediscovery dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/sts dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/digitalocean/godo dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/oracle/oci-go-sdk/v65 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] --- go.mod | 32 ++++++++++++++--------------- go.sum | 64 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/go.mod b/go.mod index 2a6f1754c..757c17490 100644 --- a/go.mod +++ b/go.mod @@ -17,13 +17,13 @@ require ( github.com/alecthomas/kingpin/v2 v2.4.0 github.com/aliyun/alibaba-cloud-sdk-go v1.63.16 github.com/aws/aws-sdk-go-v2 v1.30.5 - github.com/aws/aws-sdk-go-v2/config v1.27.34 - github.com/aws/aws-sdk-go-v2/credentials v1.17.32 - github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.3 - github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.9 - github.com/aws/aws-sdk-go-v2/service/route53 v1.43.2 - github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.7 - github.com/aws/aws-sdk-go-v2/service/sts v1.30.7 + github.com/aws/aws-sdk-go-v2/config v1.27.35 + github.com/aws/aws-sdk-go-v2/credentials v1.17.33 + github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.4 + github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.10 + github.com/aws/aws-sdk-go-v2/service/route53 v1.43.3 + github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.8 + github.com/aws/aws-sdk-go-v2/service/sts v1.30.8 github.com/bodgit/tsig v1.2.2 github.com/cenkalti/backoff/v4 v4.3.0 github.com/civo/civogo v0.3.77 @@ -31,7 +31,7 @@ require ( github.com/cloudfoundry-community/go-cfclient v0.0.0-20190201205600-f136f9222381 github.com/datawire/ambassador v1.12.4 github.com/denverdino/aliyungo v0.0.0-20230411124812-ab98a9173ace - github.com/digitalocean/godo v1.124.0 + github.com/digitalocean/godo v1.125.0 github.com/dnsimple/dnsimple-go v1.7.0 github.com/exoscale/egoscale v0.102.3 github.com/ffledgling/pdns-go v0.0.0-20180219074714-524e7daccd99 @@ -47,19 +47,19 @@ require ( github.com/onsi/ginkgo v1.16.5 github.com/openshift/api v0.0.0-20230607130528-611114dca681 github.com/openshift/client-go v0.0.0-20230607134213-3cd0021bbee3 - github.com/oracle/oci-go-sdk/v65 v65.73.0 + github.com/oracle/oci-go-sdk/v65 v65.74.0 github.com/ovh/go-ovh v1.6.0 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pkg/errors v0.9.1 github.com/pluralsh/gqlclient v1.12.2 github.com/projectcontour/contour v1.30.0 - github.com/prometheus/client_golang v1.20.3 + github.com/prometheus/client_golang v1.20.4 github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.9.0 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1003 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1003 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1003 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1004 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1004 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1004 github.com/transip/gotransip/v6 v6.26.0 github.com/ultradns/ultradns-sdk-go v1.3.7 go.etcd.io/etcd/api/v3 v3.5.16 @@ -96,12 +96,12 @@ require ( github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect - github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.7 // indirect + github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.8 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.18 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.22.7 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.22.8 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.8 // indirect github.com/aws/smithy-go v1.20.4 // indirect github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect diff --git a/go.sum b/go.sum index dc5eafdcc..289012c98 100644 --- a/go.sum +++ b/go.sum @@ -119,12 +119,12 @@ github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.30.5 h1:mWSRTwQAb0aLE17dSzztCVJWI9+cRMgqebndjwDyK0g= github.com/aws/aws-sdk-go-v2 v1.30.5/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0= -github.com/aws/aws-sdk-go-v2/config v1.27.34 h1:5sLceuETg/215nLtY/QIVB2O6cosS0iC/Tx5oyqUhbw= -github.com/aws/aws-sdk-go-v2/config v1.27.34/go.mod h1:kEqdYzRb8dd8Sy2pOdEbExTTF5v7ozEXX0McgPE7xks= -github.com/aws/aws-sdk-go-v2/credentials v1.17.32 h1:7Cxhp/BnT2RcGy4VisJ9miUPecY+lyE9I8JvcZofn9I= -github.com/aws/aws-sdk-go-v2/credentials v1.17.32/go.mod h1:P5/QMF3/DCHbXGEGkdbilXHsyTBX5D3HSwcrSc9p20I= -github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.3 h1:/BPXKQ6n1cDWPmc5FWF6fCSaUtK+dWkWd0x9dI4dgaI= -github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.3/go.mod h1:qabLXChRlJREypX5RN/Z47GU+RaMsjotNCZfZ85oD0M= +github.com/aws/aws-sdk-go-v2/config v1.27.35 h1:jeFgiWYNV0vrgdZqB4kZBjYNdy0IKkwrAjr2fwpHIig= +github.com/aws/aws-sdk-go-v2/config v1.27.35/go.mod h1:qnpEvTq8ZfjrCqmJGRfWZuF+lGZ/vG8LK2K0L/TY1gQ= +github.com/aws/aws-sdk-go-v2/credentials v1.17.33 h1:lBHAQQznENv0gLHAZ73ONiTSkCtr8q3pSqWrpbBBZz0= +github.com/aws/aws-sdk-go-v2/credentials v1.17.33/go.mod h1:MBuqCUOT3ChfLuxNDGyra67eskx7ge9e3YKYBce7wpI= +github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.4 h1:m7h6UwsHIyx0L8K7T17aYeDcevwd6hGrbQiAid2XyKA= +github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.4/go.mod h1:Hkre8GbTJ7Y6IKDVMoWRD12pIHQ6GH4JNEwzKiz6xyw= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 h1:pfQ2sqNpMVK6xz2RbqLEL0GH87JOwSxPV2rzm8Zsb74= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13/go.mod h1:NG7RXPUlqfsCLLFfi0+IpKN4sCB9D9fw/qTaSB+xRoU= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 h1:pI7Bzt0BJtYA0N/JEC6B8fJ4RBrEMi1LBrkMdFYNSnQ= @@ -133,26 +133,26 @@ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17 h1:Mqr/V5gvrhA2gvgnF4 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17/go.mod h1:aLJpZlCmjE+V+KtN1q1uyZkfnUWpQGpbsn89XPKyzfU= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.9 h1:jbqgtdKfAXebx2/l2UhDEe/jmmCIhaCO3HFK71M7VzM= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.9/go.mod h1:N3YdUYxyxhiuAelUgCpSVBuBI1klobJxZrDtL+olu10= -github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.7 h1:VTBHXWkSeFgT3sfYB4U92qMgzHl0nz9H1tYNHHutLg0= -github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.7/go.mod h1:F/ybU7YfgFcktSp+biKgiHjyscGhlZxOz4QFFQqHXGw= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.10 h1:ozHHSE9Hflrf2DZmJEoqIO+bK6E6rAfID8PSCv2rgG8= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.10/go.mod h1:N3YdUYxyxhiuAelUgCpSVBuBI1klobJxZrDtL+olu10= +github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.8 h1:lje864O92lma0+TnDNHAMpiehauR02sTo+xfoSsw3DE= +github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.8/go.mod h1:F/ybU7YfgFcktSp+biKgiHjyscGhlZxOz4QFFQqHXGw= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 h1:KypMCbLPPHEmf9DgMGw51jMj77VfGPAN2Kv4cfhlfgI= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4/go.mod h1:Vz1JQXliGcQktFTN/LN6uGppAIRoLBR2bMvIMP0gOjc= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.18 h1:GACdEPdpBE59I7pbfvu0/Mw1wzstlP3QtPHklUxybFE= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.18/go.mod h1:K+xV06+Wni4TSaOOJ1Y35e5tYOCUBYbebLKmJQQa8yY= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 h1:rfprUlsdzgl7ZL2KlXiUAoJnI/VxfHCvDFr2QDFj6u4= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19/go.mod h1:SCWkEdRq8/7EK60NcvvQ6NXKuTcchAD4ROAsC37VEZE= -github.com/aws/aws-sdk-go-v2/service/route53 v1.43.2 h1:957e1/SwXIfPi/0OUJkH9YnPZRe9G6Kisd/xUhF7AUE= -github.com/aws/aws-sdk-go-v2/service/route53 v1.43.2/go.mod h1:343vcjcyOTuHTBBgUrOxPM36/jE96qLZnGL447ldrB0= -github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.7 h1:mHdnEFOQ0JVjsbjHGqkuE0pmEpnk/aWz8YxyyB4e2+E= -github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.7/go.mod h1:JsD+G3R0ZMWqjt7VDggNsc5SFl4hw+Sk8KQaRN1sltI= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.7 h1:pIaGg+08llrP7Q5aiz9ICWbY8cqhTkyy+0SHvfzQpTc= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.7/go.mod h1:eEygMHnTKH/3kNp9Jr1n3PdejuSNcgwLe1dWgQtO0VQ= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7 h1:/Cfdu0XV3mONYKaOt1Gr0k1KvQzkzPyiKUdlWJqy+J4= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7/go.mod h1:bCbAxKDqNvkHxRaIMnyVPXPo+OaPRwvmgzMxbz1VKSA= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.7 h1:NKTa1eqZYw8tiHSRGpP0VtTdub/8KNk8sDkNPFaOKDE= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.7/go.mod h1:NXi1dIAGteSaRLqYgarlhP/Ij0cFT+qmCwiJqWh/U5o= +github.com/aws/aws-sdk-go-v2/service/route53 v1.43.3 h1:hMnlDw1V8y9dKmWxxw3CqMCwx+BVQASeTE02ws+DBWo= +github.com/aws/aws-sdk-go-v2/service/route53 v1.43.3/go.mod h1:343vcjcyOTuHTBBgUrOxPM36/jE96qLZnGL447ldrB0= +github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.8 h1:lR2PZfD1YNEPq0TSljh1Zfxmr53FaKZOTf90hQKmH/4= +github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.8/go.mod h1:JsD+G3R0ZMWqjt7VDggNsc5SFl4hw+Sk8KQaRN1sltI= +github.com/aws/aws-sdk-go-v2/service/sso v1.22.8 h1:JRwuL+S1Qe1owZQoxblV7ORgRf2o0SrtzDVIbaVCdQ0= +github.com/aws/aws-sdk-go-v2/service/sso v1.22.8/go.mod h1:eEygMHnTKH/3kNp9Jr1n3PdejuSNcgwLe1dWgQtO0VQ= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.8 h1:+HpGETD9463PFSj7lX5+eq7aLDs85QUIA+NBkeAsscA= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.8/go.mod h1:bCbAxKDqNvkHxRaIMnyVPXPo+OaPRwvmgzMxbz1VKSA= +github.com/aws/aws-sdk-go-v2/service/sts v1.30.8 h1:bAi+4p5EKnni+jrfcAhb7iHFQ24bthOAV9t0taf3DCE= +github.com/aws/aws-sdk-go-v2/service/sts v1.30.8/go.mod h1:NXi1dIAGteSaRLqYgarlhP/Ij0cFT+qmCwiJqWh/U5o= github.com/aws/smithy-go v1.20.4 h1:2HK1zBdPgRbjFOHlfeQZfpC4r72MOb9bZkiFwggKO+4= github.com/aws/smithy-go v1.20.4/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= @@ -251,8 +251,8 @@ github.com/denverdino/aliyungo v0.0.0-20230411124812-ab98a9173ace/go.mod h1:TK05 github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/digitalocean/godo v1.124.0 h1:qroI1QdtcgnXF/pefq9blZRbXqBw1Ry/aHh2pnu/328= -github.com/digitalocean/godo v1.124.0/go.mod h1:WQVH83OHUy6gC4gXpEVQKtxTd4L5oCp+5OialidkPLY= +github.com/digitalocean/godo v1.125.0 h1:wGPBQRX9Wjo0qCF0o8d25mT3A84Iw8rfHnZOPyvHcMQ= +github.com/digitalocean/godo v1.125.0/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnsimple/dnsimple-go v1.7.0 h1:JKu9xJtZ3SqOC+BuYgAWeab7+EEx0sz422vu8j611ZY= github.com/dnsimple/dnsimple-go v1.7.0/go.mod h1:EKpuihlWizqYafSnQHGCd/gyvy3HkEQJ7ODB4KdV8T8= @@ -849,8 +849,8 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/oracle/oci-go-sdk/v65 v65.73.0 h1:C7uel6CoKk4A1KPkdhFBAyvVyFRTHAmX8m0o64RmfPg= -github.com/oracle/oci-go-sdk/v65 v65.73.0/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= +github.com/oracle/oci-go-sdk/v65 v65.74.0 h1:oA2VXpecSTwc45QJGsKNoxCBwbUMuXLQ2W4pLZZarro= +github.com/oracle/oci-go-sdk/v65 v65.74.0/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= github.com/ovh/go-ovh v1.6.0 h1:ixLOwxQdzYDx296sXcgS35TOPEahJkpjMGtzPadCjQI= github.com/ovh/go-ovh v1.6.0/go.mod h1:cTVDnl94z4tl8pP1uZ/8jlVxntjSIf09bNcQ5TJSC7c= github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2 h1:CXwSGu/LYmbjEab5aMCs5usQRVBGThelUKBNnoSOuso= @@ -894,8 +894,8 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.6.0/go.mod h1:ZLOG9ck3JLRdB5MgO8f+lLTe83AXG6ro35rLTxvnIl4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= +github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -1017,12 +1017,12 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1003 h1:cl6DSa2pWPGS3GFG+UUmMewolR1x7Q7GR04xcjtGl9s= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1003/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1003 h1:0V2mVcFk5t9fDtHU6FAmAgaB3QY44pcgA0JDo0vElE0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1003/go.mod h1:DQJIItbcvoOX27p4pHtRfVt5yrKSJReFVCMLSFdO2ks= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1003 h1:wctJotD/c/sQsHYm9mu8kqMMdWluB+Z8ZNk3Mih72oQ= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1003/go.mod h1:XJ6xN9ZY8TqMguLXlG8Lc6upleS96HHVG2HD1IO6qdw= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1004 h1:ErJuCtb6/7GtunW3N3Ps2IJ9c8KK6zjcrZX/S1Oo8sU= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1004/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1004 h1:Wqhb/hyJ6C3hCqDYh/4/gzuTZMYdXGSBhdyDhz+gdw4= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1004/go.mod h1:LsmUPHN5sqlUHyQaHkLQ5uDA7RJ2sGvbtAyT6wVzi+0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1004 h1:AUls2/TFD2LvKUh8OphqH6PhlOg5P7YN6H3vtsbt42Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1004/go.mod h1:JoGBRhuBZLiuCwwyRWrUlQt6dwpUyZg2uie6aicuxVs= github.com/terra-farm/udnssdk v1.3.5 h1:MNR3adfuuEK/l04+jzo8WW/0fnorY+nW515qb3vEr6I= github.com/terra-farm/udnssdk v1.3.5/go.mod h1:8RnM56yZTR7mYyUIvrDgXzdRaEyFIzqdEi7+um26Sv8= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= From dad4d13a2dc47381c19582df4e657195479431a3 Mon Sep 17 00:00:00 2001 From: romeroalx Date: Thu, 19 Sep 2024 11:31:25 +0200 Subject: [PATCH 51/82] fix for linting issue in provider/pdns/pdns.go --- provider/pdns/pdns.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider/pdns/pdns.go b/provider/pdns/pdns.go index f031d09b0..5a924b58a 100644 --- a/provider/pdns/pdns.go +++ b/provider/pdns/pdns.go @@ -43,7 +43,7 @@ type pdnsChangeType string const ( apiBase = "/api/v1" - defaultTTL = 300 + defaultTTL = 300 // PdnsDelete and PdnsReplace are effectively an enum for "pgo.RrSet.changetype" // TODO: Can we somehow get this from the pgo swagger client library itself? From eb0be37a52a8ba09d8a6797bc57c7cae258ecb26 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 04:35:43 +0000 Subject: [PATCH 52/82] chore(deps): bump the dev-dependencies group across 1 directory with 8 updates Bumps the dev-dependencies group with 8 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/aliyun/alibaba-cloud-sdk-go](https://github.com/aliyun/alibaba-cloud-sdk-go) | `1.63.16` | `1.63.17` | | [github.com/gophercloud/gophercloud](https://github.com/gophercloud/gophercloud) | `1.14.0` | `1.14.1` | | [github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common](https://github.com/tencentcloud/tencentcloud-sdk-go) | `1.0.1004` | `1.0.1006` | | [github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod](https://github.com/tencentcloud/tencentcloud-sdk-go) | `1.0.1004` | `1.0.1006` | | [github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns](https://github.com/tencentcloud/tencentcloud-sdk-go) | `1.0.1004` | `1.0.1006` | | [google.golang.org/api](https://github.com/googleapis/google-api-go-client) | `0.197.0` | `0.198.0` | | [istio.io/api](https://github.com/istio/api) | `1.23.1` | `1.23.2` | | [istio.io/client-go](https://github.com/istio/client-go) | `1.23.1` | `1.23.2` | Updates `github.com/aliyun/alibaba-cloud-sdk-go` from 1.63.16 to 1.63.17 - [Release notes](https://github.com/aliyun/alibaba-cloud-sdk-go/releases) - [Changelog](https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/ChangeLog.txt) - [Commits](https://github.com/aliyun/alibaba-cloud-sdk-go/compare/v1.63.16...v1.63.17) Updates `github.com/gophercloud/gophercloud` from 1.14.0 to 1.14.1 - [Release notes](https://github.com/gophercloud/gophercloud/releases) - [Changelog](https://github.com/gophercloud/gophercloud/blob/v1.14.1/CHANGELOG.md) - [Commits](https://github.com/gophercloud/gophercloud/compare/v1.14.0...v1.14.1) Updates `github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common` from 1.0.1004 to 1.0.1006 - [Commits](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.0.1004...v1.0.1006) Updates `github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod` from 1.0.1004 to 1.0.1006 - [Commits](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.0.1004...v1.0.1006) Updates `github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns` from 1.0.1004 to 1.0.1006 - [Commits](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.0.1004...v1.0.1006) Updates `google.golang.org/api` from 0.197.0 to 0.198.0 - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.197.0...v0.198.0) Updates `istio.io/api` from 1.23.1 to 1.23.2 - [Commits](https://github.com/istio/api/compare/1.23.1...1.23.2) Updates `istio.io/client-go` from 1.23.1 to 1.23.2 - [Commits](https://github.com/istio/client-go/compare/1.23.1...1.23.2) --- updated-dependencies: - dependency-name: github.com/aliyun/alibaba-cloud-sdk-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/gophercloud/gophercloud dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: google.golang.org/api dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: istio.io/api dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: istio.io/client-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] --- go.mod | 20 ++++++++++---------- go.sum | 40 ++++++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/go.mod b/go.mod index 757c17490..0d06ee666 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/Yamashou/gqlgenc v0.25.0 github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2 github.com/alecthomas/kingpin/v2 v2.4.0 - github.com/aliyun/alibaba-cloud-sdk-go v1.63.16 + github.com/aliyun/alibaba-cloud-sdk-go v1.63.17 github.com/aws/aws-sdk-go-v2 v1.30.5 github.com/aws/aws-sdk-go-v2/config v1.27.35 github.com/aws/aws-sdk-go-v2/credentials v1.17.33 @@ -39,7 +39,7 @@ require ( github.com/go-logr/logr v1.4.2 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 - github.com/gophercloud/gophercloud v1.14.0 + github.com/gophercloud/gophercloud v1.14.1 github.com/linki/instrumented_http v0.3.0 github.com/linode/linodego v1.40.0 github.com/maxatome/go-testdeep v1.14.0 @@ -57,9 +57,9 @@ require ( github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.9.0 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1004 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1004 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1004 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1006 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1006 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1006 github.com/transip/gotransip/v6 v6.26.0 github.com/ultradns/ultradns-sdk-go v1.3.7 go.etcd.io/etcd/api/v3 v3.5.16 @@ -69,11 +69,11 @@ require ( golang.org/x/oauth2 v0.23.0 golang.org/x/sync v0.8.0 golang.org/x/time v0.6.0 - google.golang.org/api v0.197.0 + google.golang.org/api v0.198.0 gopkg.in/ns1/ns1-go.v2 v2.12.0 gopkg.in/yaml.v2 v2.4.0 - istio.io/api v1.23.1 - istio.io/client-go v1.23.1 + istio.io/api v1.23.2 + istio.io/client-go v1.23.2 k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 k8s.io/client-go v0.31.1 @@ -82,7 +82,7 @@ require ( ) require ( - cloud.google.com/go/auth v0.9.3 // indirect + cloud.google.com/go/auth v0.9.4 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect code.cloudfoundry.org/gofileutils v0.0.0-20170111115228-4d0c80011a0f // indirect github.com/99designs/gqlgen v0.17.49 // indirect @@ -206,7 +206,7 @@ require ( golang.org/x/tools v0.22.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/grpc v1.66.1 // indirect + google.golang.org/grpc v1.66.2 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index 289012c98..d5091144a 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxo cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go/auth v0.9.3 h1:VOEUIAADkkLtyfr3BLa3R8Ed/j6w1jTBmARx+wb5w5U= -cloud.google.com/go/auth v0.9.3/go.mod h1:7z6VY+7h3KUdRov5F1i8NDP5ZzWKYmEPO842BgCsmTk= +cloud.google.com/go/auth v0.9.4 h1:DxF7imbEbiFu9+zdKC6cKBko1e8XeJnipNqIbWZ+kDI= +cloud.google.com/go/auth v0.9.4/go.mod h1:SHia8n6//Ya940F1rLimhJCjjx7KE17t0ctFEci3HkA= cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= cloud.google.com/go/compute/metadata v0.5.1 h1:NM6oZeZNlYjiwYje+sYFjEpP0Q0zCan1bmQW/KmIrGs= @@ -94,8 +94,8 @@ github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAu github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 h1:P5U+E4x5OkVEKQDklVPmzs71WM56RTTRqV4OrDC//Y4= github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5/go.mod h1:976q2ETgjT2snVCf2ZaBnyBbVoPERGjUz+0sofzEfro= -github.com/aliyun/alibaba-cloud-sdk-go v1.63.16 h1:LNaqt0rxIcqHYarmdIZ3ZM7lqUWaWZ1Sqi1XPV1zMko= -github.com/aliyun/alibaba-cloud-sdk-go v1.63.16/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ= +github.com/aliyun/alibaba-cloud-sdk-go v1.63.17 h1:hdhcJzcnwFg5/aM4kmz9EY8sV6IVYnzJTmtYwNrFjmY= +github.com/aliyun/alibaba-cloud-sdk-go v1.63.17/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6/go.mod h1:+lx6/Aqd1kLJ1GQfkvOnaZ1WGmLpMpbprPuIOOZX30U= @@ -533,8 +533,8 @@ github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTV github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= github.com/gookit/color v1.2.3/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gophercloud/gophercloud v1.14.0 h1:Bt9zQDhPrbd4qX7EILGmy+i7GP35cc+AAL2+wIJpUE8= -github.com/gophercloud/gophercloud v1.14.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= +github.com/gophercloud/gophercloud v1.14.1 h1:DTCNaTVGl8/cFu58O1JwWgis9gtISAFONqpMKNg/Vpw= +github.com/gophercloud/gophercloud v1.14.1/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= @@ -1017,12 +1017,12 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1004 h1:ErJuCtb6/7GtunW3N3Ps2IJ9c8KK6zjcrZX/S1Oo8sU= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1004/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1004 h1:Wqhb/hyJ6C3hCqDYh/4/gzuTZMYdXGSBhdyDhz+gdw4= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1004/go.mod h1:LsmUPHN5sqlUHyQaHkLQ5uDA7RJ2sGvbtAyT6wVzi+0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1004 h1:AUls2/TFD2LvKUh8OphqH6PhlOg5P7YN6H3vtsbt42Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1004/go.mod h1:JoGBRhuBZLiuCwwyRWrUlQt6dwpUyZg2uie6aicuxVs= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1006 h1:WX1KDLeAIhhcYMD5uqrnQ4Fv3Dmg9GPv0shNVBS/6fA= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1006/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1006 h1:ioD2056M1fmZAKHgAxgiorsx/IOU0W8MTmmIpVrN33E= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1006/go.mod h1:CDXEG8dbMdmsFa5TtqfmRL28VJax0Uk1+s+FKLdB8SQ= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1006 h1:tttqKT03S2/yMkfF4f1SwHpgY184OXjkXnj7/MH8kgs= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1006/go.mod h1:OTE5zBNQSAcLBHVaqTDvjgxjOy26fTxetmP5454r40U= github.com/terra-farm/udnssdk v1.3.5 h1:MNR3adfuuEK/l04+jzo8WW/0fnorY+nW515qb3vEr6I= github.com/terra-farm/udnssdk v1.3.5/go.mod h1:8RnM56yZTR7mYyUIvrDgXzdRaEyFIzqdEi7+um26Sv8= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -1376,8 +1376,8 @@ gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZ google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.197.0 h1:x6CwqQLsFiA5JKAiGyGBjc2bNtHtLddhJCE2IKuhhcQ= -google.golang.org/api v0.197.0/go.mod h1:AuOuo20GoQ331nq7DquGHlU6d+2wN2fZ8O0ta60nRNw= +google.golang.org/api v0.198.0 h1:OOH5fZatk57iN0A7tjJQzt6aPfYQ1JiWkt1yGseazks= +google.golang.org/api v0.198.0/go.mod h1:/Lblzl3/Xqqk9hw/yS97TImKTUwnf1bv89v7+OagJzc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1410,8 +1410,8 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.66.1 h1:hO5qAXR19+/Z44hmvIM4dQFMSYX9XcWsByfoxutBpAM= -google.golang.org/grpc v1.66.1/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= +google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo= +google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1481,10 +1481,10 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -istio.io/api v1.23.1 h1:bm2XF0j058FfzWVHUfpmMj4sFDkcD1X609qs5AU97Pc= -istio.io/api v1.23.1/go.mod h1:QPSTGXuIQdnZFEm3myf9NZ5uBMwCdJWUvfj9ZZ+2oBM= -istio.io/client-go v1.23.1 h1:IX2cgUUXnVYo+9H6bFGSp/vuKVLPUkmiN8qk1/mvsYs= -istio.io/client-go v1.23.1/go.mod h1:+fxu+O2GkITM3HEREUWdobvRXqI/UhAAI7hfxqqpRh0= +istio.io/api v1.23.2 h1:FvWi7GC+rWD60/ZFPuulX/h3k+f2Q9qot3dP8CIL8Ss= +istio.io/api v1.23.2/go.mod h1:QPSTGXuIQdnZFEm3myf9NZ5uBMwCdJWUvfj9ZZ+2oBM= +istio.io/client-go v1.23.2 h1:BIt6A+KaUOFin3SzXiDq2Fr/TMBev1+c836R0BfUfhU= +istio.io/client-go v1.23.2/go.mod h1:E08wpMtUulJk2tlWOCUVakjy1bKFxUNm22tM1R1QY0Y= k8s.io/api v0.18.0/go.mod h1:q2HRQkfDzHMBZL9l/y9rH63PkQl4vae0xRT+8prbrK8= k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= k8s.io/api v0.18.4/go.mod h1:lOIQAKYgai1+vz9J7YcDZwC26Z0zQewYOGWdyIPUUQ4= From 326ee0be69492ec5819bca48d872f11a12b25387 Mon Sep 17 00:00:00 2001 From: n-Arno Date: Thu, 19 Sep 2024 17:27:49 +0200 Subject: [PATCH 53/82] source node: Skip unschedulable nodes --- docs/sources/nodes.md | 3 +++ source/node.go | 5 +++++ source/node_test.go | 11 +++++++++++ 3 files changed, 19 insertions(+) diff --git a/docs/sources/nodes.md b/docs/sources/nodes.md index 0db1c99c7..ca88b44f5 100644 --- a/docs/sources/nodes.md +++ b/docs/sources/nodes.md @@ -7,6 +7,9 @@ The node source adds an `A` record per each node `externalIP` (if not found, any It also adds an `AAAA` record per each node IPv6 `internalIP`. The TTL of the records can be set with the `external-dns.alpha.kubernetes.io/ttl` node annotation. +Nodes marked as **Unschedulable** as per [core/v1/NodeSpec](https://pkg.go.dev/k8s.io/api@v0.31.1/core/v1#NodeSpec) are excluded. +This avoid exposing Unhealthy, NotReady or SchedulingDisabled (cordon) nodes. + ## Manifest (for cluster without RBAC enabled) ``` diff --git a/source/node.go b/source/node.go index 81e40755d..c35b3883e 100644 --- a/source/node.go +++ b/source/node.go @@ -102,6 +102,11 @@ func (ns *nodeSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, erro continue } + if node.Spec.Unschedulable { + log.Debugf("Skipping node %s because it is unschedulable", node.Name) + continue + } + log.Debugf("creating endpoint for node %s", node.Name) ttl := getTTLFromAnnotations(node.Annotations, fmt.Sprintf("node/%s", node.Name)) diff --git a/source/node_test.go b/source/node_test.go index 9ce4591df..bf047bae8 100644 --- a/source/node_test.go +++ b/source/node_test.go @@ -101,6 +101,7 @@ func testNodeSourceEndpoints(t *testing.T) { nodeAddresses []v1.NodeAddress labels map[string]string annotations map[string]string + unschedulable bool // default to false expected []*endpoint.Endpoint expectError bool }{ @@ -321,6 +322,13 @@ func testNodeSourceEndpoints(t *testing.T) { {RecordType: "A", DNSName: "node1", Targets: endpoint.Targets{"1.2.3.4"}, RecordTTL: endpoint.TTL(10)}, }, }, + { + title: "unschedulable node return nothing", + nodeName: "node1", + nodeAddresses: []v1.NodeAddress{{Type: v1.NodeExternalIP, Address: "1.2.3.4"}}, + unschedulable: true, + expected: []*endpoint.Endpoint{}, + }, } { tc := tc t.Run(tc.title, func(t *testing.T) { @@ -342,6 +350,9 @@ func testNodeSourceEndpoints(t *testing.T) { Labels: tc.labels, Annotations: tc.annotations, }, + Spec: v1.NodeSpec{ + Unschedulable: tc.unschedulable, + }, Status: v1.NodeStatus{ Addresses: tc.nodeAddresses, }, From 13739fc1ce87687cbaa84f8aeb54a8a9836dcf55 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 03:37:14 +0000 Subject: [PATCH 54/82] chore(deps): bump actions/checkout in the dev-dependencies group Bumps the dev-dependencies group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 4.1.7 to 4.2.0 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/692973e3d937129bcbf40652eb9f2f61becf3332...d632683dd7b4114ad314bca15554477dd762a938) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yaml | 2 +- .github/workflows/codeql-analysis.yaml | 2 +- .github/workflows/docs.yaml | 2 +- .github/workflows/json-yaml-validate.yml | 2 +- .github/workflows/lint-test-chart.yaml | 2 +- .github/workflows/lint.yaml | 2 +- .github/workflows/release-chart.yaml | 2 +- .github/workflows/staging-image-tester.yaml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 48fc93b06..768f0d87a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,7 +21,7 @@ jobs: steps: - name: Check out code into the Go module directory - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Set up Go 1.x uses: actions/setup-go@v5 diff --git a/.github/workflows/codeql-analysis.yaml b/.github/workflows/codeql-analysis.yaml index 0db3d20ff..237c70015 100644 --- a/.github/workflows/codeql-analysis.yaml +++ b/.github/workflows/codeql-analysis.yaml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Install go version uses: actions/setup-go@v5 with: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 9aef40d53..43ccfed34 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -15,7 +15,7 @@ jobs: name: Release Docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: fetch-depth: 0 diff --git a/.github/workflows/json-yaml-validate.yml b/.github/workflows/json-yaml-validate.yml index cca01ea11..356119146 100644 --- a/.github/workflows/json-yaml-validate.yml +++ b/.github/workflows/json-yaml-validate.yml @@ -14,7 +14,7 @@ jobs: json-yaml-validate: runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: json-yaml-validate uses: GrantBirki/json-yaml-validate@v3.2.1 diff --git a/.github/workflows/lint-test-chart.yaml b/.github/workflows/lint-test-chart.yaml index b153ab136..112e40640 100644 --- a/.github/workflows/lint-test-chart.yaml +++ b/.github/workflows/lint-test-chart.yaml @@ -14,7 +14,7 @@ jobs: shell: bash steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: fetch-depth: 0 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index b547756b2..9ef05fcab 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -22,7 +22,7 @@ jobs: steps: - name: Check out code into the Go module directory - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Set up Go 1.x uses: actions/setup-go@v5 diff --git a/.github/workflows/release-chart.yaml b/.github/workflows/release-chart.yaml index 6c3c25b8e..ec326758a 100644 --- a/.github/workflows/release-chart.yaml +++ b/.github/workflows/release-chart.yaml @@ -20,7 +20,7 @@ jobs: shell: bash steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: fetch-depth: 0 diff --git a/.github/workflows/staging-image-tester.yaml b/.github/workflows/staging-image-tester.yaml index dd3d5e450..a42c86e77 100644 --- a/.github/workflows/staging-image-tester.yaml +++ b/.github/workflows/staging-image-tester.yaml @@ -21,7 +21,7 @@ jobs: steps: - name: Check out code into the Go module directory - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Set up Go 1.x uses: actions/setup-go@v5 From 8a7c790befa5f31d1734c8f52cdb8530d3da790c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 03:54:40 +0000 Subject: [PATCH 55/82] chore(deps): bump the dev-dependencies group across 1 directory with 21 updates Bumps the dev-dependencies group with 18 updates in the / directory: | Package | From | To | | --- | --- | --- | | [cloud.google.com/go/compute/metadata](https://github.com/googleapis/google-cloud-go) | `0.5.1` | `0.5.2` | | [github.com/Yamashou/gqlgenc](https://github.com/Yamashou/gqlgenc) | `0.25.0` | `0.25.2` | | [github.com/aliyun/alibaba-cloud-sdk-go](https://github.com/aliyun/alibaba-cloud-sdk-go) | `1.63.17` | `1.63.18` | | [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) | `1.30.5` | `1.31.0` | | [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) | `1.27.35` | `1.27.38` | | [github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue](https://github.com/aws/aws-sdk-go-v2) | `1.15.4` | `1.15.7` | | [github.com/aws/aws-sdk-go-v2/service/route53](https://github.com/aws/aws-sdk-go-v2) | `1.43.3` | `1.44.2` | | [github.com/aws/aws-sdk-go-v2/service/servicediscovery](https://github.com/aws/aws-sdk-go-v2) | `1.31.8` | `1.32.2` | | [github.com/civo/civogo](https://github.com/civo/civogo) | `0.3.77` | `0.3.79` | | [github.com/cloudflare/cloudflare-go](https://github.com/cloudflare/cloudflare-go) | `0.104.0` | `0.105.0` | | [github.com/digitalocean/godo](https://github.com/digitalocean/godo) | `1.125.0` | `1.126.0` | | [github.com/linode/linodego](https://github.com/linode/linodego) | `1.40.0` | `1.41.0` | | [github.com/oracle/oci-go-sdk/v65](https://github.com/oracle/oci-go-sdk) | `65.74.0` | `65.75.0` | | [github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common](https://github.com/tencentcloud/tencentcloud-sdk-go) | `1.0.1006` | `1.0.1011` | | [github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod](https://github.com/tencentcloud/tencentcloud-sdk-go) | `1.0.1006` | `1.0.1011` | | [github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns](https://github.com/tencentcloud/tencentcloud-sdk-go) | `1.0.1006` | `1.0.1011` | | [google.golang.org/api](https://github.com/googleapis/google-api-go-client) | `0.198.0` | `0.199.0` | | gopkg.in/ns1/ns1-go.v2 | `2.12.0` | `2.12.1` | Updates `cloud.google.com/go/compute/metadata` from 0.5.1 to 0.5.2 - [Release notes](https://github.com/googleapis/google-cloud-go/releases) - [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-cloud-go/compare/apps/v0.5.1...auth/v0.5.2) Updates `github.com/Yamashou/gqlgenc` from 0.25.0 to 0.25.2 - [Release notes](https://github.com/Yamashou/gqlgenc/releases) - [Commits](https://github.com/Yamashou/gqlgenc/compare/v0.25.0...v0.25.2) Updates `github.com/aliyun/alibaba-cloud-sdk-go` from 1.63.17 to 1.63.18 - [Release notes](https://github.com/aliyun/alibaba-cloud-sdk-go/releases) - [Changelog](https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/ChangeLog.txt) - [Commits](https://github.com/aliyun/alibaba-cloud-sdk-go/compare/v1.63.17...v1.63.18) Updates `github.com/aws/aws-sdk-go-v2` from 1.30.5 to 1.31.0 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.30.5...v1.31.0) Updates `github.com/aws/aws-sdk-go-v2/config` from 1.27.35 to 1.27.38 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.27.35...config/v1.27.38) Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.17.33 to 1.17.36 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.33...credentials/v1.17.36) Updates `github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue` from 1.15.4 to 1.15.7 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/config/v1.15.7/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.15.4...config/v1.15.7) Updates `github.com/aws/aws-sdk-go-v2/service/dynamodb` from 1.34.10 to 1.35.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/dynamodb/v1.34.10...service/iot/v1.35.2) Updates `github.com/aws/aws-sdk-go-v2/service/route53` from 1.43.3 to 1.44.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/fsx/v1.43.3...service/ssm/v1.44.2) Updates `github.com/aws/aws-sdk-go-v2/service/servicediscovery` from 1.31.8 to 1.32.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/efs/v1.31.8...service/efs/v1.32.2) Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.30.8 to 1.31.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/service/s3/v1.31.2/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/sts/v1.30.8...service/s3/v1.31.2) Updates `github.com/civo/civogo` from 0.3.77 to 0.3.79 - [Release notes](https://github.com/civo/civogo/releases) - [Changelog](https://github.com/civo/civogo/blob/master/changelog.yml) - [Commits](https://github.com/civo/civogo/compare/v0.3.77...v0.3.79) Updates `github.com/cloudflare/cloudflare-go` from 0.104.0 to 0.105.0 - [Release notes](https://github.com/cloudflare/cloudflare-go/releases) - [Changelog](https://github.com/cloudflare/cloudflare-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/cloudflare/cloudflare-go/compare/v0.104.0...v0.105.0) Updates `github.com/digitalocean/godo` from 1.125.0 to 1.126.0 - [Release notes](https://github.com/digitalocean/godo/releases) - [Changelog](https://github.com/digitalocean/godo/blob/main/CHANGELOG.md) - [Commits](https://github.com/digitalocean/godo/compare/v1.125.0...v1.126.0) Updates `github.com/linode/linodego` from 1.40.0 to 1.41.0 - [Release notes](https://github.com/linode/linodego/releases) - [Commits](https://github.com/linode/linodego/compare/v1.40.0...v1.41.0) Updates `github.com/oracle/oci-go-sdk/v65` from 65.74.0 to 65.75.0 - [Release notes](https://github.com/oracle/oci-go-sdk/releases) - [Changelog](https://github.com/oracle/oci-go-sdk/blob/master/CHANGELOG.md) - [Commits](https://github.com/oracle/oci-go-sdk/compare/v65.74.0...v65.75.0) Updates `github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common` from 1.0.1006 to 1.0.1011 - [Commits](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.0.1006...v1.0.1011) Updates `github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod` from 1.0.1006 to 1.0.1011 - [Commits](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.0.1006...v1.0.1011) Updates `github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns` from 1.0.1006 to 1.0.1011 - [Commits](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.0.1006...v1.0.1011) Updates `google.golang.org/api` from 0.198.0 to 0.199.0 - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.198.0...v0.199.0) Updates `gopkg.in/ns1/ns1-go.v2` from 2.12.0 to 2.12.1 --- updated-dependencies: - dependency-name: cloud.google.com/go/compute/metadata dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/Yamashou/gqlgenc dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aliyun/alibaba-cloud-sdk-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/credentials dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/dynamodb dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/route53 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/servicediscovery dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/sts dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/civo/civogo dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/cloudflare/cloudflare-go dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/digitalocean/godo dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/linode/linodego dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/oracle/oci-go-sdk/v65 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: google.golang.org/api dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: gopkg.in/ns1/ns1-go.v2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] --- go.mod | 72 ++++++++++++++--------------- go.sum | 144 ++++++++++++++++++++++++++++----------------------------- 2 files changed, 108 insertions(+), 108 deletions(-) diff --git a/go.mod b/go.mod index 0d06ee666..92badfe27 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module sigs.k8s.io/external-dns go 1.23 require ( - cloud.google.com/go/compute/metadata v0.5.1 + cloud.google.com/go/compute/metadata v0.5.2 github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 @@ -12,26 +12,26 @@ require ( github.com/IBM-Cloud/ibm-cloud-cli-sdk v1.5.0 github.com/IBM/go-sdk-core/v5 v5.17.5 github.com/IBM/networking-go-sdk v0.49.0 - github.com/Yamashou/gqlgenc v0.25.0 + github.com/Yamashou/gqlgenc v0.25.2 github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2 github.com/alecthomas/kingpin/v2 v2.4.0 - github.com/aliyun/alibaba-cloud-sdk-go v1.63.17 - github.com/aws/aws-sdk-go-v2 v1.30.5 - github.com/aws/aws-sdk-go-v2/config v1.27.35 - github.com/aws/aws-sdk-go-v2/credentials v1.17.33 - github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.4 - github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.10 - github.com/aws/aws-sdk-go-v2/service/route53 v1.43.3 - github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.8 - github.com/aws/aws-sdk-go-v2/service/sts v1.30.8 + github.com/aliyun/alibaba-cloud-sdk-go v1.63.18 + github.com/aws/aws-sdk-go-v2 v1.31.0 + github.com/aws/aws-sdk-go-v2/config v1.27.38 + github.com/aws/aws-sdk-go-v2/credentials v1.17.36 + github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.7 + github.com/aws/aws-sdk-go-v2/service/dynamodb v1.35.2 + github.com/aws/aws-sdk-go-v2/service/route53 v1.44.2 + github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.32.2 + github.com/aws/aws-sdk-go-v2/service/sts v1.31.2 github.com/bodgit/tsig v1.2.2 github.com/cenkalti/backoff/v4 v4.3.0 - github.com/civo/civogo v0.3.77 - github.com/cloudflare/cloudflare-go v0.104.0 + github.com/civo/civogo v0.3.79 + github.com/cloudflare/cloudflare-go v0.105.0 github.com/cloudfoundry-community/go-cfclient v0.0.0-20190201205600-f136f9222381 github.com/datawire/ambassador v1.12.4 github.com/denverdino/aliyungo v0.0.0-20230411124812-ab98a9173ace - github.com/digitalocean/godo v1.125.0 + github.com/digitalocean/godo v1.126.0 github.com/dnsimple/dnsimple-go v1.7.0 github.com/exoscale/egoscale v0.102.3 github.com/ffledgling/pdns-go v0.0.0-20180219074714-524e7daccd99 @@ -41,13 +41,13 @@ require ( github.com/google/uuid v1.6.0 github.com/gophercloud/gophercloud v1.14.1 github.com/linki/instrumented_http v0.3.0 - github.com/linode/linodego v1.40.0 + github.com/linode/linodego v1.41.0 github.com/maxatome/go-testdeep v1.14.0 github.com/miekg/dns v1.1.62 github.com/onsi/ginkgo v1.16.5 github.com/openshift/api v0.0.0-20230607130528-611114dca681 github.com/openshift/client-go v0.0.0-20230607134213-3cd0021bbee3 - github.com/oracle/oci-go-sdk/v65 v65.74.0 + github.com/oracle/oci-go-sdk/v65 v65.75.0 github.com/ovh/go-ovh v1.6.0 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pkg/errors v0.9.1 @@ -57,9 +57,9 @@ require ( github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.9.0 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1006 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1006 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1006 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1011 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1011 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1011 github.com/transip/gotransip/v6 v6.26.0 github.com/ultradns/ultradns-sdk-go v1.3.7 go.etcd.io/etcd/api/v3 v3.5.16 @@ -69,8 +69,8 @@ require ( golang.org/x/oauth2 v0.23.0 golang.org/x/sync v0.8.0 golang.org/x/time v0.6.0 - google.golang.org/api v0.198.0 - gopkg.in/ns1/ns1-go.v2 v2.12.0 + google.golang.org/api v0.199.0 + gopkg.in/ns1/ns1-go.v2 v2.12.1 gopkg.in/yaml.v2 v2.4.0 istio.io/api v1.23.2 istio.io/client-go v1.23.2 @@ -82,27 +82,27 @@ require ( ) require ( - cloud.google.com/go/auth v0.9.4 // indirect + cloud.google.com/go/auth v0.9.5 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect code.cloudfoundry.org/gofileutils v0.0.0-20170111115228-4d0c80011a0f // indirect - github.com/99designs/gqlgen v0.17.49 // indirect + github.com/99designs/gqlgen v0.17.54 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/Masterminds/semver v1.4.2 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect - github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.8 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.18 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.22.8 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.8 // indirect - github.com/aws/smithy-go v1.20.4 // indirect + github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.23.2 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.19 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.23.2 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.2 // indirect + github.com/aws/smithy-go v1.21.0 // indirect github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -199,14 +199,14 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/crypto v0.27.0 // indirect - golang.org/x/mod v0.18.0 // indirect + golang.org/x/mod v0.20.0 // indirect golang.org/x/sys v0.25.0 // indirect golang.org/x/term v0.24.0 // indirect golang.org/x/text v0.18.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/grpc v1.66.2 // indirect + google.golang.org/grpc v1.67.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index d5091144a..0f62732ea 100644 --- a/go.sum +++ b/go.sum @@ -2,18 +2,18 @@ bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxo cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go/auth v0.9.4 h1:DxF7imbEbiFu9+zdKC6cKBko1e8XeJnipNqIbWZ+kDI= -cloud.google.com/go/auth v0.9.4/go.mod h1:SHia8n6//Ya940F1rLimhJCjjx7KE17t0ctFEci3HkA= +cloud.google.com/go/auth v0.9.5 h1:4CTn43Eynw40aFVr3GpPqsQponx2jv0BQpjvajsbbzw= +cloud.google.com/go/auth v0.9.5/go.mod h1:Xo0n7n66eHyOWWCnitop6870Ilwo3PiZyodVkkH1xWM= cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= -cloud.google.com/go/compute/metadata v0.5.1 h1:NM6oZeZNlYjiwYje+sYFjEpP0Q0zCan1bmQW/KmIrGs= -cloud.google.com/go/compute/metadata v0.5.1/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= +cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo= +cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= code.cloudfoundry.org/gofileutils v0.0.0-20170111115228-4d0c80011a0f h1:UrKzEwTgeiff9vxdrfdqxibzpWjxLnuXDI5m6z3GJAk= code.cloudfoundry.org/gofileutils v0.0.0-20170111115228-4d0c80011a0f/go.mod h1:sk5LnIjB/nIEU7yP5sDQExVm62wu0pBh3yrElngUisI= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= git.lukeshu.com/go/libsystemd v0.5.3/go.mod h1:FfDoP0i92r4p5Vn4NCLxvjkd7rCOe6otPa4L6hZg9WM= -github.com/99designs/gqlgen v0.17.49 h1:b3hNGexHd33fBSAd4NDT/c3NCcQzcAVkknhN9ym36YQ= -github.com/99designs/gqlgen v0.17.49/go.mod h1:tC8YFVZMed81x7UJ7ORUwXF4Kn6SXuucFqQBhN8+BU0= +github.com/99designs/gqlgen v0.17.54 h1:AsF49k/7RJlwA00RQYsYN0T8cQuaosnV/7G1dHC3Uh8= +github.com/99designs/gqlgen v0.17.54/go.mod h1:77/+pVe6zlTsz++oUg2m8VLgzdUPHxjoAG3BxI5y8Rc= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible h1:KnPIugL51v3N3WwvaSmZbxukD1WuWXOiE9fRdu32f2I= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= @@ -77,8 +77,8 @@ github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:H github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/Yamashou/gqlgenc v0.25.0 h1:wb4CKKpnklmK9R+RQ68yoSdhqlK+MPflYT/hsMOE1+I= -github.com/Yamashou/gqlgenc v0.25.0/go.mod h1:KheDl3KZUFmnGCLHCHPQ6hodwWbggc889vwwaf0VqH8= +github.com/Yamashou/gqlgenc v0.25.2 h1:4VoeXuI/8M7njUYiOsTSkkEit13rXWOjoK39AG31jPo= +github.com/Yamashou/gqlgenc v0.25.2/go.mod h1:G0g1N81xpIklVdnyboW1zwOHcj/n4hNfhTwfN29Rjig= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -94,8 +94,8 @@ github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAu github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 h1:P5U+E4x5OkVEKQDklVPmzs71WM56RTTRqV4OrDC//Y4= github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5/go.mod h1:976q2ETgjT2snVCf2ZaBnyBbVoPERGjUz+0sofzEfro= -github.com/aliyun/alibaba-cloud-sdk-go v1.63.17 h1:hdhcJzcnwFg5/aM4kmz9EY8sV6IVYnzJTmtYwNrFjmY= -github.com/aliyun/alibaba-cloud-sdk-go v1.63.17/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ= +github.com/aliyun/alibaba-cloud-sdk-go v1.63.18 h1:Q36nROtbIQhLN6VZ4KJzZkISj4SWlq8pEwtqYBNz0is= +github.com/aliyun/alibaba-cloud-sdk-go v1.63.18/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6/go.mod h1:+lx6/Aqd1kLJ1GQfkvOnaZ1WGmLpMpbprPuIOOZX30U= @@ -117,44 +117,44 @@ github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQ github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.30.5 h1:mWSRTwQAb0aLE17dSzztCVJWI9+cRMgqebndjwDyK0g= -github.com/aws/aws-sdk-go-v2 v1.30.5/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0= -github.com/aws/aws-sdk-go-v2/config v1.27.35 h1:jeFgiWYNV0vrgdZqB4kZBjYNdy0IKkwrAjr2fwpHIig= -github.com/aws/aws-sdk-go-v2/config v1.27.35/go.mod h1:qnpEvTq8ZfjrCqmJGRfWZuF+lGZ/vG8LK2K0L/TY1gQ= -github.com/aws/aws-sdk-go-v2/credentials v1.17.33 h1:lBHAQQznENv0gLHAZ73ONiTSkCtr8q3pSqWrpbBBZz0= -github.com/aws/aws-sdk-go-v2/credentials v1.17.33/go.mod h1:MBuqCUOT3ChfLuxNDGyra67eskx7ge9e3YKYBce7wpI= -github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.4 h1:m7h6UwsHIyx0L8K7T17aYeDcevwd6hGrbQiAid2XyKA= -github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.4/go.mod h1:Hkre8GbTJ7Y6IKDVMoWRD12pIHQ6GH4JNEwzKiz6xyw= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 h1:pfQ2sqNpMVK6xz2RbqLEL0GH87JOwSxPV2rzm8Zsb74= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13/go.mod h1:NG7RXPUlqfsCLLFfi0+IpKN4sCB9D9fw/qTaSB+xRoU= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 h1:pI7Bzt0BJtYA0N/JEC6B8fJ4RBrEMi1LBrkMdFYNSnQ= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17/go.mod h1:Dh5zzJYMtxfIjYW+/evjQ8uj2OyR/ve2KROHGHlSFqE= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17 h1:Mqr/V5gvrhA2gvgnF42Zh5iMiQNcOYthFYwCyrnuWlc= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17/go.mod h1:aLJpZlCmjE+V+KtN1q1uyZkfnUWpQGpbsn89XPKyzfU= +github.com/aws/aws-sdk-go-v2 v1.31.0 h1:3V05LbxTSItI5kUqNwhJrrrY1BAXxXt0sN0l72QmG5U= +github.com/aws/aws-sdk-go-v2 v1.31.0/go.mod h1:ztolYtaEUtdpf9Wftr31CJfLVjOnD/CVRkKOOYgF8hA= +github.com/aws/aws-sdk-go-v2/config v1.27.38 h1:mMVyJJuSUdbD4zKXoxDgWrgM60QwlFEg+JhihCq6wCw= +github.com/aws/aws-sdk-go-v2/config v1.27.38/go.mod h1:6xOiNEn58bj/64MPKx89r6G/el9JZn8pvVbquSqTKK4= +github.com/aws/aws-sdk-go-v2/credentials v1.17.36 h1:zwI5WrT+oWWfzSKoTNmSyeBKQhsFRJRv+PGW/UZW+Yk= +github.com/aws/aws-sdk-go-v2/credentials v1.17.36/go.mod h1:3AG/sY1rc9NJrNWcN/3KPU4SIDPGTrd/qegKB0TnFdE= +github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.7 h1:ZzyrqQfMX4lagelhV90h7QKiKyoVfV7eXTPS3dOX5GY= +github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.7/go.mod h1:YYffpxyQJqvscSWs4Sh3h0rALEiCePKbaJlw6N+pPy0= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 h1:C/d03NAmh8C4BZXhuRNboF/DqhBkBCeDiJDcaqIT5pA= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14/go.mod h1:7I0Ju7p9mCIdlrfS+JCgqcYD0VXz/N4yozsox+0o078= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18 h1:kYQ3H1u0ANr9KEKlGs/jTLrBFPo8P8NaH/w7A01NeeM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18/go.mod h1:r506HmK5JDUh9+Mw4CfGJGSSoqIiLCndAuqXuhbv67Y= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18 h1:Z7IdFUONvTcvS7YuhtVxN99v2cCoHRXOS4mTr0B/pUc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18/go.mod h1:DkKMmksZVVyat+Y+r1dEOgJEfUeA7UngIHWeKsi0yNc= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.10 h1:ozHHSE9Hflrf2DZmJEoqIO+bK6E6rAfID8PSCv2rgG8= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.10/go.mod h1:N3YdUYxyxhiuAelUgCpSVBuBI1klobJxZrDtL+olu10= -github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.8 h1:lje864O92lma0+TnDNHAMpiehauR02sTo+xfoSsw3DE= -github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.8/go.mod h1:F/ybU7YfgFcktSp+biKgiHjyscGhlZxOz4QFFQqHXGw= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 h1:KypMCbLPPHEmf9DgMGw51jMj77VfGPAN2Kv4cfhlfgI= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4/go.mod h1:Vz1JQXliGcQktFTN/LN6uGppAIRoLBR2bMvIMP0gOjc= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.18 h1:GACdEPdpBE59I7pbfvu0/Mw1wzstlP3QtPHklUxybFE= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.18/go.mod h1:K+xV06+Wni4TSaOOJ1Y35e5tYOCUBYbebLKmJQQa8yY= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 h1:rfprUlsdzgl7ZL2KlXiUAoJnI/VxfHCvDFr2QDFj6u4= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19/go.mod h1:SCWkEdRq8/7EK60NcvvQ6NXKuTcchAD4ROAsC37VEZE= -github.com/aws/aws-sdk-go-v2/service/route53 v1.43.3 h1:hMnlDw1V8y9dKmWxxw3CqMCwx+BVQASeTE02ws+DBWo= -github.com/aws/aws-sdk-go-v2/service/route53 v1.43.3/go.mod h1:343vcjcyOTuHTBBgUrOxPM36/jE96qLZnGL447ldrB0= -github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.8 h1:lR2PZfD1YNEPq0TSljh1Zfxmr53FaKZOTf90hQKmH/4= -github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.8/go.mod h1:JsD+G3R0ZMWqjt7VDggNsc5SFl4hw+Sk8KQaRN1sltI= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.8 h1:JRwuL+S1Qe1owZQoxblV7ORgRf2o0SrtzDVIbaVCdQ0= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.8/go.mod h1:eEygMHnTKH/3kNp9Jr1n3PdejuSNcgwLe1dWgQtO0VQ= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.8 h1:+HpGETD9463PFSj7lX5+eq7aLDs85QUIA+NBkeAsscA= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.8/go.mod h1:bCbAxKDqNvkHxRaIMnyVPXPo+OaPRwvmgzMxbz1VKSA= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.8 h1:bAi+4p5EKnni+jrfcAhb7iHFQ24bthOAV9t0taf3DCE= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.8/go.mod h1:NXi1dIAGteSaRLqYgarlhP/Ij0cFT+qmCwiJqWh/U5o= -github.com/aws/smithy-go v1.20.4 h1:2HK1zBdPgRbjFOHlfeQZfpC4r72MOb9bZkiFwggKO+4= -github.com/aws/smithy-go v1.20.4/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.35.2 h1:EGvR8KwbxUXEUCS4HAgSRcxeFT1/0bqvS5tRR0WZSbM= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.35.2/go.mod h1:k5XW8MoMxsNZ20RJmsokakvENUwQyjv69R9GqrI4xdQ= +github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.23.2 h1:h4sDZaE8OcfPdR5C2m8MEkmQ0PXKYj9BQcYZH6Kc0GQ= +github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.23.2/go.mod h1:NZQWaOwOszI7jnQ7s1i5kN/FUAglaaJIm2htZG7BJKw= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5 h1:QFASJGfT8wMXtuP3D5CRmMjARHv9ZmzFUMJznHDOY3w= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5/go.mod h1:QdZ3OmoIjSX+8D1OPAzPxDfjXASbBMDsz9qvtyIhtik= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.19 h1:dOxqOlOEa2e2heC/74+ZzcJOa27+F1aXFZpYgY/4QfA= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.19/go.mod h1:aV6U1beLFvk3qAgognjS3wnGGoDId8hlPEiBsLHXVZE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 h1:Xbwbmk44URTiHNx6PNo0ujDE6ERlsCKJD3u1zfnzAPg= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20/go.mod h1:oAfOFzUB14ltPZj1rWwRc3d/6OgD76R8KlvU3EqM9Fg= +github.com/aws/aws-sdk-go-v2/service/route53 v1.44.2 h1:ssvjp8LJrv7x/sPr15E5igCARw00MoIWl54SXZ1FIr0= +github.com/aws/aws-sdk-go-v2/service/route53 v1.44.2/go.mod h1:l2ABSKg3AibEJeR/l60cfeGU54UqF3VTgd51pq+vYhU= +github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.32.2 h1:29YTjasLjpAjb9RMacMkwWJ2PgDipZqzDS3TOkqUsl4= +github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.32.2/go.mod h1:hbMVfSdZneCht4UmPOsejDt93QnetQPFuLOOqbuybqs= +github.com/aws/aws-sdk-go-v2/service/sso v1.23.2 h1:yzi/y/vKlLyzOfG7pSu5ONNGRxHIgLeDrV4w2AMRCo0= +github.com/aws/aws-sdk-go-v2/service/sso v1.23.2/go.mod h1:XRlMvmad0ZNL+75C5FYdMvbbLkd6qiqz6foR1nA1PXY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.2 h1:3gb6pYhYLjo8rB1h2Tqs61wpjRd3rQymYcVq/pp0yxI= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.2/go.mod h1:FnvDM4sfa+isJ3kDXIzAB9GAwVSzFzSy97uZ3IsHo4E= +github.com/aws/aws-sdk-go-v2/service/sts v1.31.2 h1:O6tyji8mXmBGsHvTCB0VIhrDw19lGTUSbKIyjnw79s8= +github.com/aws/aws-sdk-go-v2/service/sts v1.31.2/go.mod h1:yMWe0F+XG0DkRZK5ODZhG7BEFYhLXi2dqGsv6tX0cgI= +github.com/aws/smithy-go v1.21.0 h1:H7L8dtDRk0P1Qm6y0ji7MCYMQObJ5R9CRpyPhRUkLYA= +github.com/aws/smithy-go v1.21.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -183,12 +183,12 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= -github.com/civo/civogo v0.3.77 h1:1rl5cpQruPhh+w8BBMpGQsaovjDvA44udPoDTAa45rk= -github.com/civo/civogo v0.3.77/go.mod h1:7UCYX+qeeJbrG55E1huv+0ySxcHTqq/26FcHLVelQJM= +github.com/civo/civogo v0.3.79 h1:Z1MbEG9CsGqSZV7UFBA0xsjk7TBGUPHjW9sM7cS5yZM= +github.com/civo/civogo v0.3.79/go.mod h1:7UCYX+qeeJbrG55E1huv+0ySxcHTqq/26FcHLVelQJM= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.104.0 h1:R/lB0dZupaZbOgibAH/BRrkFbZ6Acn/WsKg2iX2xXuY= -github.com/cloudflare/cloudflare-go v0.104.0/go.mod h1:pfUQ4PIG4ISI0/Mmc21Bp86UnFU0ktmPf3iTgbSL+cM= +github.com/cloudflare/cloudflare-go v0.105.0 h1:yu2IatITLZ4dw7/byzRrlE5DfUvtub0k9CHZ5zBlj90= +github.com/cloudflare/cloudflare-go v0.105.0/go.mod h1:pfUQ4PIG4ISI0/Mmc21Bp86UnFU0ktmPf3iTgbSL+cM= github.com/cloudfoundry-community/go-cfclient v0.0.0-20190201205600-f136f9222381 h1:rdRS5BT13Iae9ssvcslol66gfOOXjaLYwqerEn/cl9s= github.com/cloudfoundry-community/go-cfclient v0.0.0-20190201205600-f136f9222381/go.mod h1:e5+USP2j8Le2M0Jo3qKPFnNhuo1wueU4nWHCXBOfQ14= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -251,8 +251,8 @@ github.com/denverdino/aliyungo v0.0.0-20230411124812-ab98a9173ace/go.mod h1:TK05 github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/digitalocean/godo v1.125.0 h1:wGPBQRX9Wjo0qCF0o8d25mT3A84Iw8rfHnZOPyvHcMQ= -github.com/digitalocean/godo v1.125.0/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc= +github.com/digitalocean/godo v1.126.0 h1:+Znh7VMQj/E8ArbjWnc7OKGjWfzC+I8OCSRp7r1MdD8= +github.com/digitalocean/godo v1.126.0/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnsimple/dnsimple-go v1.7.0 h1:JKu9xJtZ3SqOC+BuYgAWeab7+EEx0sz422vu8j611ZY= github.com/dnsimple/dnsimple-go v1.7.0/go.mod h1:EKpuihlWizqYafSnQHGCd/gyvy3HkEQJ7ODB4KdV8T8= @@ -704,8 +704,8 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linki/instrumented_http v0.3.0 h1:dsN92+mXpfZtjJraartcQ99jnuw7fqsnPDjr85ma2dA= github.com/linki/instrumented_http v0.3.0/go.mod h1:pjYbItoegfuVi2GUOMhEqzvm/SJKuEL3H0tc8QRLRFk= -github.com/linode/linodego v1.40.0 h1:7ESY0PwK94hoggoCtIroT1Xk6b1flrFBNZ6KwqbTqlI= -github.com/linode/linodego v1.40.0/go.mod h1:NsUw4l8QrLdIofRg1NYFBbW5ZERnmbZykVBszPZLORM= +github.com/linode/linodego v1.41.0 h1:GcP7JIBr9iLRJ9FwAtb9/WCT1DuPJS/xUApapfdjtiY= +github.com/linode/linodego v1.41.0/go.mod h1:Ow4/XZ0yvWBzt3iAHwchvhSx30AyLintsSMvvQ2/SJY= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/lyft/protoc-gen-star v0.4.10/go.mod h1:mE8fbna26u7aEA2QCVvvfBU/ZrPgocG1206xAFPcs94= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= @@ -849,8 +849,8 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/oracle/oci-go-sdk/v65 v65.74.0 h1:oA2VXpecSTwc45QJGsKNoxCBwbUMuXLQ2W4pLZZarro= -github.com/oracle/oci-go-sdk/v65 v65.74.0/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= +github.com/oracle/oci-go-sdk/v65 v65.75.0 h1:tifYRSqCjxANJb0xnMSZ6N2bF2xGyqcCIMg7xihgk+s= +github.com/oracle/oci-go-sdk/v65 v65.75.0/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= github.com/ovh/go-ovh v1.6.0 h1:ixLOwxQdzYDx296sXcgS35TOPEahJkpjMGtzPadCjQI= github.com/ovh/go-ovh v1.6.0/go.mod h1:cTVDnl94z4tl8pP1uZ/8jlVxntjSIf09bNcQ5TJSC7c= github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2 h1:CXwSGu/LYmbjEab5aMCs5usQRVBGThelUKBNnoSOuso= @@ -1017,12 +1017,12 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1006 h1:WX1KDLeAIhhcYMD5uqrnQ4Fv3Dmg9GPv0shNVBS/6fA= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1006/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1006 h1:ioD2056M1fmZAKHgAxgiorsx/IOU0W8MTmmIpVrN33E= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1006/go.mod h1:CDXEG8dbMdmsFa5TtqfmRL28VJax0Uk1+s+FKLdB8SQ= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1006 h1:tttqKT03S2/yMkfF4f1SwHpgY184OXjkXnj7/MH8kgs= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1006/go.mod h1:OTE5zBNQSAcLBHVaqTDvjgxjOy26fTxetmP5454r40U= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1011 h1:cjqeXTwKKtGVqrf6luwunUnA77buzmzbk+G42US1Sns= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1011/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1011 h1:O3QK5t7HIWhzo9ZtQcWjq+voOL2Anko8ON6bikKTcl0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1011/go.mod h1:HbdUWIghvwUPfIhgFkKZqwaoyALK6GxBzayhflN9wY8= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1011 h1:Ak4EA3TtzcFtqY+2E9z+mYBC8gjlw4X8WXlVPoRVtQU= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1011/go.mod h1:FYFEkG/OCQ4vDPiuV7LijHSNq+kr14ABC1IswVtHNmM= github.com/terra-farm/udnssdk v1.3.5 h1:MNR3adfuuEK/l04+jzo8WW/0fnorY+nW515qb3vEr6I= github.com/terra-farm/udnssdk v1.3.5/go.mod h1:8RnM56yZTR7mYyUIvrDgXzdRaEyFIzqdEi7+um26Sv8= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -1174,8 +1174,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1362,8 +1362,8 @@ golang.org/x/tools v0.0.0-20210114065538-d78b04bdf963/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1376,8 +1376,8 @@ gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZ google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.198.0 h1:OOH5fZatk57iN0A7tjJQzt6aPfYQ1JiWkt1yGseazks= -google.golang.org/api v0.198.0/go.mod h1:/Lblzl3/Xqqk9hw/yS97TImKTUwnf1bv89v7+OagJzc= +google.golang.org/api v0.199.0 h1:aWUXClp+VFJmqE0JPvpZOK3LDQMyFKYIow4etYd9qxs= +google.golang.org/api v0.199.0/go.mod h1:ohG4qSztDJmZdjK/Ar6MhbAmb/Rpi4JHOqagsh90K28= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1410,8 +1410,8 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo= -google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= +google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw= +google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1452,8 +1452,8 @@ gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/ns1/ns1-go.v2 v2.12.0 h1:cqdqQoTx17JmTusfxh5m3e2b36jfUzFAZedv89pFX18= -gopkg.in/ns1/ns1-go.v2 v2.12.0/go.mod h1:pfaU0vECVP7DIOr453z03HXS6dFJpXdNRwOyRzwmPSc= +gopkg.in/ns1/ns1-go.v2 v2.12.1 h1:GiiZPB8JusUF/ruyUDzddd70b3HZGa5A3njtKUe84jA= +gopkg.in/ns1/ns1-go.v2 v2.12.1/go.mod h1:pfaU0vECVP7DIOr453z03HXS6dFJpXdNRwOyRzwmPSc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= From 69f1c4a664c965c5d2047be7ecc13c54b827f106 Mon Sep 17 00:00:00 2001 From: happytreees Date: Thu, 26 Sep 2024 14:03:02 -0400 Subject: [PATCH 56/82] add Vultr webhook provider reference --- README.md | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 282fa8edc..d702661ed 100644 --- a/README.md +++ b/README.md @@ -74,22 +74,23 @@ See PR #3063 for all the discussions about it. Known providers using webhooks: -| Provider | Repo | -| -------- | ----------- | -| Adguard Home Provider | https://github.com/muhlba91/external-dns-provider-adguard | -| Anexia | https://github.com/ProbstenHias/external-dns-anexia-webhook | -| Bizfly Cloud | https://github.com/bizflycloud/external-dns-bizflycloud-webhook | -| Efficient IP | https://github.com/EfficientIP-Labs/external-dns-efficientip-webhook | -| Gcore | https://github.com/G-Core/external-dns-gcore-webhook | -| GleSYS | https://github.com/glesys/external-dns-glesys | -| Hetzner | https://github.com/mconfalonieri/external-dns-hetzner-webhook | -| IONOS | https://github.com/ionos-cloud/external-dns-ionos-webhook | -| Infoblox | https://github.com/AbsaOSS/external-dns-infoblox-webhook | -| Netcup | https://github.com/mrueg/external-dns-netcup-webhook | -| Netic | https://github.com/neticdk/external-dns-tidydns-webhook | -| RouterOS | https://github.com/benfiola/external-dns-routeros-provider | -| STACKIT | https://github.com/stackitcloud/external-dns-stackit-webhook | -| Unifi | https://github.com/kashalls/external-dns-unifi-webhook | +| Provider | Repo | +|-----------------------|----------------------------------------------------------------------| +| Adguard Home Provider | https://github.com/muhlba91/external-dns-provider-adguard | +| Anexia | https://github.com/ProbstenHias/external-dns-anexia-webhook | +| Bizfly Cloud | https://github.com/bizflycloud/external-dns-bizflycloud-webhook | +| Efficient IP | https://github.com/EfficientIP-Labs/external-dns-efficientip-webhook | +| Gcore | https://github.com/G-Core/external-dns-gcore-webhook | +| GleSYS | https://github.com/glesys/external-dns-glesys | +| Hetzner | https://github.com/mconfalonieri/external-dns-hetzner-webhook | +| IONOS | https://github.com/ionos-cloud/external-dns-ionos-webhook | +| Infoblox | https://github.com/AbsaOSS/external-dns-infoblox-webhook | +| Netcup | https://github.com/mrueg/external-dns-netcup-webhook | +| Netic | https://github.com/neticdk/external-dns-tidydns-webhook | +| RouterOS | https://github.com/benfiola/external-dns-routeros-provider | +| STACKIT | https://github.com/stackitcloud/external-dns-stackit-webhook | +| Unifi | https://github.com/kashalls/external-dns-unifi-webhook | +| Vultr | https://github.com/vultr/external-dns-vultr-webhook | ## Status of in-tree providers From 59fe374d79d88d37bd3889e2c22595078b9743ec Mon Sep 17 00:00:00 2001 From: Raffaele Di Fazio Date: Thu, 3 Oct 2024 18:48:29 +0200 Subject: [PATCH 57/82] removes deprecated rdns provider Signed-off-by: Raffaele Di Fazio --- README.md | 2 - docs/tutorials/rdns.md | 173 ----------- main.go | 8 - pkg/apis/externaldns/types.go | 2 +- provider/rdns/rdns.go | 551 ---------------------------------- provider/rdns/rdns_test.go | 355 ---------------------- 6 files changed, 1 insertion(+), 1090 deletions(-) delete mode 100644 docs/tutorials/rdns.md delete mode 100644 provider/rdns/rdns.go delete mode 100644 provider/rdns/rdns_test.go diff --git a/README.md b/README.md index 6ef0eeb14..6ab5602b3 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,6 @@ The following table clarifies the current status of the providers according to t | RFC2136 | Alpha | | | NS1 | Alpha | | | TransIP | Alpha | | -| RancherDNS | Alpha | | | OVH | Alpha | | | Scaleway DNS | Alpha | @Sh4d1 | | UltraDNS | Alpha | | @@ -188,7 +187,6 @@ The following tutorials are provided: * [OpenStack Designate](docs/tutorials/designate.md) * [Oracle Cloud Infrastructure (OCI) DNS](docs/tutorials/oracle.md) * [PowerDNS](docs/tutorials/pdns.md) -* [RancherDNS (RDNS)](docs/tutorials/rdns.md) * [RFC2136](docs/tutorials/rfc2136.md) * [TransIP](docs/tutorials/transip.md) * [OVH](docs/tutorials/ovh.md) diff --git a/docs/tutorials/rdns.md b/docs/tutorials/rdns.md deleted file mode 100644 index 7e10403c1..000000000 --- a/docs/tutorials/rdns.md +++ /dev/null @@ -1,173 +0,0 @@ -# RancherDNS - -This tutorial describes how to setup ExternalDNS for usage within a kubernetes cluster that makes use of [RDNS](https://github.com/rancher/rdns-server) and [nginx ingress controller](https://github.com/kubernetes/ingress-nginx). - -You need to: - -* install RDNS with [etcd](https://github.com/etcd-io/etcd) enabled -* install external-dns with rdns as a provider - -## Installing RDNS with etcdv3 backend - -### Clone RDNS -``` -git clone https://github.com/rancher/rdns-server.git -``` - -### Installing ETCD -``` -cd rdns-server -docker-compose -f deploy/etcdv3/etcd-compose.yaml up -d -``` - -> ETCD was successfully deployed on `http://172.31.35.77:2379` - -### Installing RDNS -``` -export ETCD_ENDPOINTS="http://172.31.35.77:2379" -export DOMAIN="lb.rancher.cloud" -./scripts/start etcdv3 -``` - -> RDNS was successfully deployed on `172.31.35.77` - -## Installing ExternalDNS -### Install external ExternalDNS -ETCD_URLS is configured to etcd client service address. -RDNS_ROOT_DOMAIN is configured to the same with RDNS DOMAIN environment. e.g. lb.rancher.cloud. - -#### Manifest (for clusters without RBAC enabled) -```yaml -apiVersion: apps/v1 -kind: Deployment -metadata: - name: external-dns - namespace: kube-system -spec: - strategy: - type: Recreate - selector: - matchLabels: - app: external-dns - template: - metadata: - labels: - app: external-dns - spec: - serviceAccountName: external-dns - containers: - - name: external-dns - image: registry.k8s.io/external-dns/external-dns:v0.15.0 - args: - - --source=ingress - - --provider=rdns - - --log-level=debug # debug only - env: - - name: ETCD_URLS - value: http://172.31.35.77:2379 - - name: RDNS_ROOT_DOMAIN - value: lb.rancher.cloud -``` - -#### Manifest (for clusters with RBAC enabled) -```yaml - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: external-dns -rules: -- apiGroups: [""] - resources: ["services","endpoints","pods"] - verbs: ["get","watch","list"] -- apiGroups: ["extensions","networking.k8s.io"] - resources: ["ingresses"] - verbs: ["get","watch","list"] -- apiGroups: [""] - resources: ["nodes"] - verbs: ["list"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: external-dns-viewer -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: external-dns -subjects: -- kind: ServiceAccount - name: external-dns - namespace: kube-system ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: external-dns - namespace: kube-system ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: external-dns - namespace: kube-system -spec: - strategy: - type: Recreate - selector: - matchLabels: - app: external-dns - template: - metadata: - labels: - app: external-dns - spec: - serviceAccountName: external-dns - containers: - - name: external-dns - image: registry.k8s.io/external-dns/external-dns:v0.15.0 - args: - - --source=ingress - - --provider=rdns - - --log-level=debug # debug only - env: - - name: ETCD_URLS - value: http://172.31.35.77:2379 - - name: RDNS_ROOT_DOMAIN - value: lb.rancher.cloud -``` - -## Testing ingress example -``` -$ cat ingress.yaml -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: nginx -spec: - ingressClassName: nginx - rules: - - host: nginx.lb.rancher.cloud - http: - paths: - - backend: - serviceName: nginx - servicePort: 80 - -$ kubectl apply -f ingress.yaml -ingress.extensions "nginx" created -``` - -Wait a moment until DNS has the ingress IP. The RDNS IP in this example is "172.31.35.77". -``` -$ kubectl get ingress -NAME HOSTS ADDRESS PORTS AGE -nginx nginx.lb.rancher.cloud 172.31.42.211 80 2m - -$ kubectl run -it --rm --restart=Never --image=infoblox/dnstools:latest dnstools -If you don't see a command prompt, try pressing enter. -dnstools# dig @172.31.35.77 nginx.lb.rancher.cloud +short -172.31.42.211 -dnstools# -``` diff --git a/main.go b/main.go index 619d25fce..d5112ccd1 100644 --- a/main.go +++ b/main.go @@ -65,7 +65,6 @@ import ( "sigs.k8s.io/external-dns/provider/pdns" "sigs.k8s.io/external-dns/provider/pihole" "sigs.k8s.io/external-dns/provider/plural" - "sigs.k8s.io/external-dns/provider/rdns" "sigs.k8s.io/external-dns/provider/rfc2136" "sigs.k8s.io/external-dns/provider/scaleway" "sigs.k8s.io/external-dns/provider/tencentcloud" @@ -258,13 +257,6 @@ func main() { p, err = dnsimple.NewDnsimpleProvider(domainFilter, zoneIDFilter, cfg.DryRun) case "coredns", "skydns": p, err = coredns.NewCoreDNSProvider(domainFilter, cfg.CoreDNSPrefix, cfg.DryRun) - case "rdns": - p, err = rdns.NewRDNSProvider( - rdns.RDNSConfig{ - DomainFilter: domainFilter, - DryRun: cfg.DryRun, - }, - ) case "exoscale": p, err = exoscale.NewExoscaleProvider( cfg.ExoscaleAPIEnvironment, diff --git a/pkg/apis/externaldns/types.go b/pkg/apis/externaldns/types.go index 9155bccd3..af4b87de3 100644 --- a/pkg/apis/externaldns/types.go +++ b/pkg/apis/externaldns/types.go @@ -445,7 +445,7 @@ func (cfg *Config) ParseFlags(args []string) error { app.Flag("nat64-networks", "Adding an A record for each AAAA record in NAT64-enabled networks; specify multiple times for multiple possible nets (optional)").StringsVar(&cfg.NAT64Networks) // Flags related to providers - providers := []string{"akamai", "alibabacloud", "aws", "aws-sd", "azure", "azure-dns", "azure-private-dns", "civo", "cloudflare", "coredns", "designate", "digitalocean", "dnsimple", "exoscale", "gandi", "godaddy", "google", "ibmcloud", "inmemory", "linode", "ns1", "oci", "ovh", "pdns", "pihole", "plural", "rdns", "rfc2136", "scaleway", "skydns", "tencentcloud", "transip", "ultradns", "webhook"} + providers := []string{"akamai", "alibabacloud", "aws", "aws-sd", "azure", "azure-dns", "azure-private-dns", "civo", "cloudflare", "coredns", "designate", "digitalocean", "dnsimple", "exoscale", "gandi", "godaddy", "google", "ibmcloud", "inmemory", "linode", "ns1", "oci", "ovh", "pdns", "pihole", "plural", "rfc2136", "scaleway", "skydns", "tencentcloud", "transip", "ultradns", "webhook"} app.Flag("provider", "The DNS provider where the DNS records will be created (required, options: "+strings.Join(providers, ", ")+")").Required().PlaceHolder("provider").EnumVar(&cfg.Provider, providers...) app.Flag("provider-cache-time", "The time to cache the DNS provider record list requests.").Default(defaultConfig.ProviderCacheTime.String()).DurationVar(&cfg.ProviderCacheTime) app.Flag("domain-filter", "Limit possible target zones by a domain suffix; specify multiple times for multiple domains (optional)").Default("").StringsVar(&cfg.DomainFilter) diff --git a/provider/rdns/rdns.go b/provider/rdns/rdns.go deleted file mode 100644 index 10766c876..000000000 --- a/provider/rdns/rdns.go +++ /dev/null @@ -1,551 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rdns - -import ( - "context" - "crypto/tls" - "crypto/x509" - "encoding/json" - "fmt" - "math/rand" - "os" - "regexp" - "strings" - "time" - - "github.com/pkg/errors" - log "github.com/sirupsen/logrus" - clientv3 "go.etcd.io/etcd/client/v3" - - "sigs.k8s.io/external-dns/endpoint" - "sigs.k8s.io/external-dns/plan" - "sigs.k8s.io/external-dns/provider" -) - -const ( - etcdTimeout = 5 * time.Second - rdnsMaxHosts = 10 - rdnsOriginalLabel = "originalText" - rdnsPrefix = "/rdnsv3" - rdnsTimeout = 5 * time.Second -) - -func init() { - rand.New(rand.NewSource(time.Now().UnixNano())) -} - -// RDNSClient is an interface to work with Rancher DNS(RDNS) records in etcdv3 backend. -type RDNSClient interface { - Get(key string) ([]RDNSRecord, error) - List(rootDomain string) ([]RDNSRecord, error) - Set(value RDNSRecord) error - Delete(key string) error -} - -// RDNSConfig contains configuration to create a new Rancher DNS(RDNS) provider. -type RDNSConfig struct { - DryRun bool - DomainFilter endpoint.DomainFilter - RootDomain string -} - -// RDNSProvider is an implementation of Provider for Rancher DNS(RDNS). -type RDNSProvider struct { - provider.BaseProvider - client RDNSClient - dryRun bool - domainFilter endpoint.DomainFilter - rootDomain string -} - -// RDNSRecord represents Rancher DNS(RDNS) etcdv3 record. -type RDNSRecord struct { - AggregationHosts []string `json:"aggregation_hosts,omitempty"` - Host string `json:"host,omitempty"` - Text string `json:"text,omitempty"` - TTL uint32 `json:"ttl,omitempty"` - Key string `json:"-"` -} - -// RDNSRecordType represents Rancher DNS(RDNS) etcdv3 record type. -type RDNSRecordType struct { - Type string `json:"type,omitempty"` - Domain string `json:"domain,omitempty"` -} - -type etcdv3Client struct { - client *clientv3.Client - ctx context.Context -} - -var _ RDNSClient = etcdv3Client{} - -// NewRDNSProvider initializes a new Rancher DNS(RDNS) based Provider. -func NewRDNSProvider(config RDNSConfig) (*RDNSProvider, error) { - client, err := newEtcdv3Client() - if err != nil { - return nil, err - } - domain := os.Getenv("RDNS_ROOT_DOMAIN") - if domain == "" { - return nil, errors.New("needed root domain environment") - } - return &RDNSProvider{ - client: client, - dryRun: config.DryRun, - domainFilter: config.DomainFilter, - rootDomain: domain, - }, nil -} - -// Records returns all DNS records found in Rancher DNS(RDNS) etcdv3 backend. Depending on the record fields -// it may be mapped to one or two records of type A, TXT, A+TXT. -func (p RDNSProvider) Records(ctx context.Context) ([]*endpoint.Endpoint, error) { - var result []*endpoint.Endpoint - - rs, err := p.client.List(p.rootDomain) - if err != nil { - return nil, err - } - - for _, r := range rs { - domains := strings.Split(strings.TrimPrefix(r.Key, rdnsPrefix+"/"), "/") - keyToDNSNameSplits(domains) - dnsName := strings.Join(domains, ".") - if !p.domainFilter.Match(dnsName) { - continue - } - - // only return rdnsMaxHosts at most - if len(r.AggregationHosts) > 0 { - if len(r.AggregationHosts) > rdnsMaxHosts { - r.AggregationHosts = r.AggregationHosts[:rdnsMaxHosts] - } - ep := endpoint.NewEndpointWithTTL( - dnsName, - endpoint.RecordTypeA, - endpoint.TTL(r.TTL), - r.AggregationHosts..., - ) - ep.Labels[rdnsOriginalLabel] = r.Text - result = append(result, ep) - } - if r.Text != "" { - ep := endpoint.NewEndpoint( - dnsName, - endpoint.RecordTypeTXT, - r.Text, - ) - result = append(result, ep) - } - } - - return result, nil -} - -// ApplyChanges stores changes back to etcdv3 converting them to Rancher DNS(RDNS) format and aggregating A and TXT records. -func (p RDNSProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error { - grouped := map[string][]*endpoint.Endpoint{} - - for _, ep := range changes.Create { - grouped[ep.DNSName] = append(grouped[ep.DNSName], ep) - } - - for _, ep := range changes.UpdateNew { - if ep.RecordType == endpoint.RecordTypeA { - // append useless domain records to the changes.Delete - if err := p.filterAndRemoveUseless(ep, changes); err != nil { - return err - } - } - grouped[ep.DNSName] = append(grouped[ep.DNSName], ep) - } - - for dnsName, group := range grouped { - if !p.domainFilter.Match(dnsName) { - log.Debugf("Skipping record %s because it was filtered out by the specified --domain-filter", dnsName) - continue - } - - var rs []RDNSRecord - - for _, ep := range group { - if ep.RecordType == endpoint.RecordTypeTXT { - continue - } - for _, target := range ep.Targets { - rs = append(rs, RDNSRecord{ - Host: target, - Text: ep.Labels[rdnsOriginalLabel], - Key: keyFor(ep.DNSName) + "/" + formatKey(target), - TTL: uint32(ep.RecordTTL), - }) - } - } - - // Add the TXT attribute to the existing A record - for _, ep := range group { - if ep.RecordType != endpoint.RecordTypeTXT { - continue - } - for i, r := range rs { - if strings.Contains(r.Key, keyFor(ep.DNSName)) { - r.Text = ep.Targets[0] - rs[i] = r - } - } - } - - for _, r := range rs { - log.Infof("Add/set key %s to Host=%s, Text=%s, TTL=%d", r.Key, r.Host, r.Text, r.TTL) - if !p.dryRun { - err := p.client.Set(r) - if err != nil { - return err - } - } - } - } - - for _, ep := range changes.Delete { - key := keyFor(ep.DNSName) - log.Infof("Delete key %s", key) - if !p.dryRun { - err := p.client.Delete(key) - if err != nil { - return err - } - } - } - - return nil -} - -// filterAndRemoveUseless filter and remove useless records. -func (p *RDNSProvider) filterAndRemoveUseless(ep *endpoint.Endpoint, changes *plan.Changes) error { - rs, err := p.client.Get(keyFor(ep.DNSName)) - if err != nil { - return err - } - for _, r := range rs { - exist := false - for _, target := range ep.Targets { - if strings.Contains(r.Key, formatKey(target)) { - exist = true - continue - } - } - if !exist { - ds := strings.Split(strings.TrimPrefix(r.Key, rdnsPrefix+"/"), "/") - keyToDNSNameSplits(ds) - changes.Delete = append(changes.Delete, &endpoint.Endpoint{ - DNSName: strings.Join(ds, "."), - }) - } - } - return nil -} - -// newEtcdv3Client is an etcdv3 client constructor. -func newEtcdv3Client() (RDNSClient, error) { - cfg := &clientv3.Config{} - - endpoints := os.Getenv("ETCD_URLS") - ca := os.Getenv("ETCD_CA_FILE") - cert := os.Getenv("ETCD_CERT_FILE") - key := os.Getenv("ETCD_KEY_FILE") - name := os.Getenv("ETCD_TLS_SERVER_NAME") - insecure := os.Getenv("ETCD_TLS_INSECURE") - - if endpoints == "" { - endpoints = "http://localhost:2379" - } - - urls := strings.Split(endpoints, ",") - scheme := strings.ToLower(urls[0])[0:strings.Index(strings.ToLower(urls[0]), "://")] - - switch scheme { - case "http": - cfg.Endpoints = urls - case "https": - var certificates []tls.Certificate - - insecure = strings.ToLower(insecure) - isInsecure := insecure == "true" || insecure == "yes" || insecure == "1" - - if ca != "" && key == "" || cert == "" && key != "" { - return nil, errors.New("either both cert and key or none must be provided") - } - - if cert != "" { - cert, err := tls.LoadX509KeyPair(cert, key) - if err != nil { - return nil, fmt.Errorf("could not load TLS cert: %w", err) - } - certificates = append(certificates, cert) - } - - config := &tls.Config{ - Certificates: certificates, - InsecureSkipVerify: isInsecure, - ServerName: name, - } - - if ca != "" { - roots := x509.NewCertPool() - pem, err := os.ReadFile(ca) - if err != nil { - return nil, fmt.Errorf("error reading %s: %w", ca, err) - } - ok := roots.AppendCertsFromPEM(pem) - if !ok { - return nil, fmt.Errorf("could not read root certs: %w", err) - } - config.RootCAs = roots - } - - cfg.Endpoints = urls - cfg.TLS = config - default: - return nil, errors.New("etcdv3 URLs must start with either http:// or https://") - } - - c, err := clientv3.New(*cfg) - if err != nil { - return nil, err - } - - return etcdv3Client{c, context.Background()}, nil -} - -// Get return A records stored in etcdv3 stored anywhere under the given key (recursively). -func (c etcdv3Client) Get(key string) ([]RDNSRecord, error) { - ctx, cancel := context.WithTimeout(c.ctx, rdnsTimeout) - defer cancel() - - result, err := c.client.Get(ctx, key, clientv3.WithPrefix()) - if err != nil { - return nil, err - } - - rs := make([]RDNSRecord, 0) - for _, v := range result.Kvs { - r := new(RDNSRecord) - if err := json.Unmarshal(v.Value, r); err != nil { - return nil, fmt.Errorf("%s: %w", v.Key, err) - } - r.Key = string(v.Key) - rs = append(rs, *r) - } - - return rs, nil -} - -// List return all records stored in etcdv3 stored anywhere under the given rootDomain (recursively). -func (c etcdv3Client) List(rootDomain string) ([]RDNSRecord, error) { - ctx, cancel := context.WithTimeout(c.ctx, rdnsTimeout) - defer cancel() - - path := keyFor(rootDomain) - - result, err := c.client.Get(ctx, path, clientv3.WithPrefix()) - if err != nil { - return nil, err - } - - return c.aggregationRecords(result) -} - -// Set persists records data into etcdv3. -func (c etcdv3Client) Set(r RDNSRecord) error { - ctx, cancel := context.WithTimeout(c.ctx, etcdTimeout) - defer cancel() - - v, err := json.Marshal(&r) - if err != nil { - return err - } - - if r.Text == "" && r.Host == "" { - return nil - } - - _, err = c.client.Put(ctx, r.Key, string(v)) - if err != nil { - return err - } - - return nil -} - -// Delete deletes record from etcdv3. -func (c etcdv3Client) Delete(key string) error { - ctx, cancel := context.WithTimeout(c.ctx, etcdTimeout) - defer cancel() - - _, err := c.client.Delete(ctx, key, clientv3.WithPrefix()) - return err -} - -// aggregationRecords will aggregation multi A records under the given path. -// e.g. A: 1_1_1_1.xxx.lb.rancher.cloud & 2_2_2_2.sample.lb.rancher.cloud => sample.lb.rancher.cloud {"aggregation_hosts": ["1.1.1.1", "2.2.2.2"]} -// e.g. TXT: sample.lb.rancher.cloud => sample.lb.rancher.cloud => {"text": "xxx"} -func (c etcdv3Client) aggregationRecords(result *clientv3.GetResponse) ([]RDNSRecord, error) { - var rs []RDNSRecord - bx := make(map[RDNSRecordType]RDNSRecord) - - for _, n := range result.Kvs { - r := new(RDNSRecord) - if err := json.Unmarshal(n.Value, r); err != nil { - return nil, fmt.Errorf("%s: %w", n.Key, err) - } - - r.Key = string(n.Key) - - if r.Host == "" && r.Text == "" { - continue - } - - if r.Host != "" { - c := RDNSRecord{ - AggregationHosts: r.AggregationHosts, - Host: r.Host, - Text: r.Text, - TTL: r.TTL, - Key: r.Key, - } - n, isContinue := appendRecords(c, endpoint.RecordTypeA, bx, rs) - if isContinue { - continue - } - rs = n - } - - if r.Text != "" && r.Host == "" { - c := RDNSRecord{ - AggregationHosts: []string{}, - Host: r.Host, - Text: r.Text, - TTL: r.TTL, - Key: r.Key, - } - n, isContinue := appendRecords(c, endpoint.RecordTypeTXT, bx, rs) - if isContinue { - continue - } - rs = n - } - } - - return rs, nil -} - -// appendRecords append record to an array -func appendRecords(r RDNSRecord, dnsType string, bx map[RDNSRecordType]RDNSRecord, rs []RDNSRecord) ([]RDNSRecord, bool) { - dnsName := keyToParentDNSName(r.Key) - bt := RDNSRecordType{Domain: dnsName, Type: dnsType} - if v, ok := bx[bt]; ok { - // skip the TXT records if already added to record list. - // append A record if dnsName already added to record list but not found the value. - // the same record might be found in multiple etcdv3 nodes. - if bt.Type == endpoint.RecordTypeA { - exist := false - for _, h := range v.AggregationHosts { - if h == r.Host { - exist = true - break - } - } - if !exist { - for i, t := range rs { - if !strings.HasPrefix(r.Key, t.Key) { - continue - } - t.Host = "" - t.AggregationHosts = append(t.AggregationHosts, r.Host) - bx[bt] = t - rs[i] = t - } - } - } - return rs, true - } - - if bt.Type == endpoint.RecordTypeA { - r.AggregationHosts = append(r.AggregationHosts, r.Host) - } - - r.Key = rdnsPrefix + dnsNameToKey(dnsName) - r.Host = "" - bx[bt] = r - rs = append(rs, r) - return rs, false -} - -// keyFor used to get a path as etcdv3 preferred. -// e.g. sample.lb.rancher.cloud => /rdnsv3/cloud/rancher/lb/sample -func keyFor(fqdn string) string { - return rdnsPrefix + dnsNameToKey(fqdn) -} - -// keyToParentDNSName used to get dnsName. -// e.g. /rdnsv3/cloud/rancher/lb/sample/xxx => xxx.sample.lb.rancher.cloud -// e.g. /rdnsv3/cloud/rancher/lb/sample/xxx/1_1_1_1 => xxx.sample.lb.rancher.cloud -func keyToParentDNSName(key string) string { - ds := strings.Split(strings.TrimPrefix(key, rdnsPrefix+"/"), "/") - keyToDNSNameSplits(ds) - - dns := strings.Join(ds, ".") - prefix := strings.Split(dns, ".")[0] - - p := `^\d{1,3}_\d{1,3}_\d{1,3}_\d{1,3}$` - m, _ := regexp.MatchString(p, prefix) - if prefix != "" && strings.Contains(prefix, "_") && m { - // 1_1_1_1.xxx.sample.lb.rancher.cloud => xxx.sample.lb.rancher.cloud - return strings.Join(strings.Split(dns, ".")[1:], ".") - } - - return dns -} - -// dnsNameToKey used to convert domain to a path as etcdv3 preferred. -// e.g. sample.lb.rancher.cloud => /cloud/rancher/lb/sample -func dnsNameToKey(domain string) string { - ss := strings.Split(domain, ".") - last := len(ss) - 1 - for i := 0; i < len(ss)/2; i++ { - ss[i], ss[last-i] = ss[last-i], ss[i] - } - return "/" + strings.Join(ss, "/") -} - -// keyToDNSNameSplits used to reverse etcdv3 path to domain splits. -// e.g. /cloud/rancher/lb/sample => [sample lb rancher cloud] -func keyToDNSNameSplits(ss []string) { - for i := 0; i < len(ss)/2; i++ { - j := len(ss) - i - 1 - ss[i], ss[j] = ss[j], ss[i] - } -} - -// formatKey used to format a key as etcdv3 preferred -// e.g. 1.1.1.1 => 1_1_1_1 -// e.g. sample.lb.rancher.cloud => sample_lb_rancher_cloud -func formatKey(key string) string { - return strings.Replace(key, ".", "_", -1) -} diff --git a/provider/rdns/rdns_test.go b/provider/rdns/rdns_test.go deleted file mode 100644 index 99358f4ce..000000000 --- a/provider/rdns/rdns_test.go +++ /dev/null @@ -1,355 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rdns - -import ( - "context" - "encoding/json" - "fmt" - "strings" - "testing" - - "github.com/stretchr/testify/assert" - "go.etcd.io/etcd/api/v3/mvccpb" - clientv3 "go.etcd.io/etcd/client/v3" - - "sigs.k8s.io/external-dns/endpoint" - "sigs.k8s.io/external-dns/plan" -) - -type fakeEtcdv3Client struct { - rs map[string]RDNSRecord -} - -func (c fakeEtcdv3Client) Get(key string) ([]RDNSRecord, error) { - rs := make([]RDNSRecord, 0) - for k, v := range c.rs { - if strings.Contains(k, key) { - rs = append(rs, v) - } - } - return rs, nil -} - -func (c fakeEtcdv3Client) List(rootDomain string) ([]RDNSRecord, error) { - var result []RDNSRecord - for key, value := range c.rs { - rootPath := rdnsPrefix + dnsNameToKey(rootDomain) - if strings.HasPrefix(key, rootPath) { - value.Key = key - result = append(result, value) - } - } - - r := &clientv3.GetResponse{} - - for _, v := range result { - b, err := json.Marshal(v) - if err != nil { - return nil, err - } - - k := &mvccpb.KeyValue{ - Key: []byte(v.Key), - Value: b, - } - - r.Kvs = append(r.Kvs, k) - } - - return c.aggregationRecords(r) -} - -func (c fakeEtcdv3Client) Set(r RDNSRecord) error { - c.rs[r.Key] = r - return nil -} - -func (c fakeEtcdv3Client) Delete(key string) error { - ks := make([]string, 0) - for k := range c.rs { - if strings.Contains(k, key) { - ks = append(ks, k) - } - } - - for _, v := range ks { - delete(c.rs, v) - } - - return nil -} - -func TestARecordTranslation(t *testing.T) { - expectedTarget1 := "1.2.3.4" - expectedTarget2 := "2.3.4.5" - expectedTargets := []string{expectedTarget1, expectedTarget2} - expectedDNSName := "p1xaf1.lb.rancher.cloud" - expectedRecordType := endpoint.RecordTypeA - - client := fakeEtcdv3Client{ - map[string]RDNSRecord{ - "/rdnsv3/cloud/rancher/lb/p1xaf1/1_2_3_4": {Host: expectedTarget1}, - "/rdnsv3/cloud/rancher/lb/p1xaf1/2_3_4_5": {Host: expectedTarget2}, - }, - } - - provider := RDNSProvider{ - client: client, - rootDomain: "lb.rancher.cloud", - } - - endpoints, err := provider.Records(context.Background()) - if err != nil { - t.Fatal(err) - } - if len(endpoints) != 1 { - t.Fatalf("got unexpected number of endpoints: %d", len(endpoints)) - } - - ep := endpoints[0] - if ep.DNSName != expectedDNSName { - t.Errorf("got unexpected DNS name: %s != %s", ep.DNSName, expectedDNSName) - } - assert.Contains(t, expectedTargets, ep.Targets[0]) - assert.Contains(t, expectedTargets, ep.Targets[1]) - if ep.RecordType != expectedRecordType { - t.Errorf("got unexpected DNS record type: %s != %s", ep.RecordType, expectedRecordType) - } -} - -func TestTXTRecordTranslation(t *testing.T) { - expectedTarget := "string" - expectedDNSName := "p1xaf1.lb.rancher.cloud" - expectedRecordType := endpoint.RecordTypeTXT - - client := fakeEtcdv3Client{ - map[string]RDNSRecord{ - "/rdnsv3/cloud/rancher/lb/p1xaf1": {Text: expectedTarget}, - }, - } - - provider := RDNSProvider{ - client: client, - rootDomain: "lb.rancher.cloud", - } - - endpoints, err := provider.Records(context.Background()) - if err != nil { - t.Fatal(err) - } - if len(endpoints) != 1 { - t.Fatalf("got unexpected number of endpoints: %d", len(endpoints)) - } - if endpoints[0].DNSName != expectedDNSName { - t.Errorf("got unexpected DNS name: %s != %s", endpoints[0].DNSName, expectedDNSName) - } - if endpoints[0].Targets[0] != expectedTarget { - t.Errorf("got unexpected DNS target: %s != %s", endpoints[0].Targets[0], expectedTarget) - } - if endpoints[0].RecordType != expectedRecordType { - t.Errorf("got unexpected DNS record type: %s != %s", endpoints[0].RecordType, expectedRecordType) - } -} - -func TestAWithTXTRecordTranslation(t *testing.T) { - expectedTargets := map[string]string{ - endpoint.RecordTypeA: "1.2.3.4", - endpoint.RecordTypeTXT: "string", - } - expectedDNSName := "p1xaf1.lb.rancher.cloud" - - client := fakeEtcdv3Client{ - map[string]RDNSRecord{ - "/rdnsv3/cloud/rancher/lb/p1xaf1": {Host: "1.2.3.4", Text: "string"}, - }, - } - - provider := RDNSProvider{ - client: client, - rootDomain: "lb.rancher.cloud", - } - - endpoints, err := provider.Records(context.Background()) - if err != nil { - t.Fatal(err) - } - - if len(endpoints) != len(expectedTargets) { - t.Fatalf("got unexpected number of endpoints: %d", len(endpoints)) - } - - for _, ep := range endpoints { - expectedTarget := expectedTargets[ep.RecordType] - if expectedTarget == "" { - t.Errorf("got unexpected DNS record type: %s", ep.RecordType) - continue - } - delete(expectedTargets, ep.RecordType) - - if ep.DNSName != expectedDNSName { - t.Errorf("got unexpected DNS name: %s != %s", ep.DNSName, expectedDNSName) - } - - if ep.Targets[0] != expectedTarget { - t.Errorf("got unexpected DNS target: %s != %s", ep.Targets[0], expectedTarget) - } - } -} - -func TestRDNSApplyChanges(t *testing.T) { - client := fakeEtcdv3Client{ - map[string]RDNSRecord{}, - } - - provider := RDNSProvider{ - client: client, - rootDomain: "lb.rancher.cloud", - } - - changes1 := &plan.Changes{ - Create: []*endpoint.Endpoint{ - endpoint.NewEndpoint("p1xaf1.lb.rancher.cloud", endpoint.RecordTypeA, "5.5.5.5", "6.6.6.6"), - endpoint.NewEndpoint("p1xaf1.lb.rancher.cloud", endpoint.RecordTypeTXT, "string1"), - }, - } - - if err := provider.ApplyChanges(context.Background(), changes1); err != nil { - t.Error(err) - } - - expectedRecords1 := map[string]RDNSRecord{ - "/rdnsv3/cloud/rancher/lb/p1xaf1/5_5_5_5": {Host: "5.5.5.5", Text: "string1"}, - "/rdnsv3/cloud/rancher/lb/p1xaf1/6_6_6_6": {Host: "6.6.6.6", Text: "string1"}, - } - - client.validateRecords(client.rs, expectedRecords1, t) - - changes2 := &plan.Changes{ - Create: []*endpoint.Endpoint{ - endpoint.NewEndpoint("abx1v1.lb.rancher.cloud", endpoint.RecordTypeA, "7.7.7.7"), - }, - UpdateNew: []*endpoint.Endpoint{ - endpoint.NewEndpoint("p1xaf1.lb.rancher.cloud", endpoint.RecordTypeA, "8.8.8.8", "9.9.9.9"), - }, - } - - records, _ := provider.Records(context.Background()) - for _, ep := range records { - if ep.DNSName == "p1xaf1.lb.rancher.cloud" { - changes2.UpdateOld = append(changes2.UpdateOld, ep) - } - } - - if err := provider.ApplyChanges(context.Background(), changes2); err != nil { - t.Error(err) - } - - expectedRecords2 := map[string]RDNSRecord{ - "/rdnsv3/cloud/rancher/lb/p1xaf1/8_8_8_8": {Host: "8.8.8.8"}, - "/rdnsv3/cloud/rancher/lb/p1xaf1/9_9_9_9": {Host: "9.9.9.9"}, - "/rdnsv3/cloud/rancher/lb/abx1v1/7_7_7_7": {Host: "7.7.7.7"}, - } - - client.validateRecords(client.rs, expectedRecords2, t) - - changes3 := &plan.Changes{ - Delete: []*endpoint.Endpoint{ - endpoint.NewEndpoint("p1xaf1.lb.rancher.cloud", endpoint.RecordTypeA, "8.8.8.8", "9.9.9.9"), - }, - } - - if err := provider.ApplyChanges(context.Background(), changes3); err != nil { - t.Error(err) - } - - expectedRecords3 := map[string]RDNSRecord{ - "/rdnsv3/cloud/rancher/lb/abx1v1/7_7_7_7": {Host: "7.7.7.7"}, - } - - client.validateRecords(client.rs, expectedRecords3, t) -} - -func (c fakeEtcdv3Client) aggregationRecords(result *clientv3.GetResponse) ([]RDNSRecord, error) { - var rs []RDNSRecord - bx := make(map[RDNSRecordType]RDNSRecord) - - for _, n := range result.Kvs { - r := new(RDNSRecord) - if err := json.Unmarshal(n.Value, r); err != nil { - return nil, fmt.Errorf("%s: %s", n.Key, err.Error()) - } - - r.Key = string(n.Key) - - if r.Host == "" && r.Text == "" { - continue - } - - if r.Host != "" { - c := RDNSRecord{ - AggregationHosts: r.AggregationHosts, - Host: r.Host, - Text: r.Text, - TTL: r.TTL, - Key: r.Key, - } - n, isContinue := appendRecords(c, endpoint.RecordTypeA, bx, rs) - if isContinue { - continue - } - rs = n - } - - if r.Text != "" && r.Host == "" { - c := RDNSRecord{ - AggregationHosts: []string{}, - Host: r.Host, - Text: r.Text, - TTL: r.TTL, - Key: r.Key, - } - n, isContinue := appendRecords(c, endpoint.RecordTypeTXT, bx, rs) - if isContinue { - continue - } - rs = n - } - } - - return rs, nil -} - -func (c fakeEtcdv3Client) validateRecords(rs, expectedRs map[string]RDNSRecord, t *testing.T) { - if len(rs) != len(expectedRs) { - t.Errorf("wrong number of records: %d != %d", len(rs), len(expectedRs)) - } - for key, value := range rs { - if _, ok := expectedRs[key]; !ok { - t.Errorf("unexpected record %s", key) - continue - } - expected := expectedRs[key] - delete(expectedRs, key) - if value.Host != expected.Host { - t.Errorf("wrong host for record %s: %s != %s", key, value.Host, expected.Host) - } - if value.Text != expected.Text { - t.Errorf("wrong text for record %s: %s != %s", key, value.Text, expected.Text) - } - } -} From f2c376c6e8281d70a7b8efe62787ae20ae4f1852 Mon Sep 17 00:00:00 2001 From: Vincent Miszczak <35925003+github-vincent-miszczak@users.noreply.github.com> Date: Fri, 4 Oct 2024 18:51:02 +0200 Subject: [PATCH 58/82] Update docs/tutorials/aws-sd.md Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com> --- docs/tutorials/aws-sd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorials/aws-sd.md b/docs/tutorials/aws-sd.md index 2e69d9073..00a429b9e 100644 --- a/docs/tutorials/aws-sd.md +++ b/docs/tutorials/aws-sd.md @@ -12,7 +12,7 @@ Learn more about the API in the [AWS Cloud Map API Reference](https://docs.aws.a ## IAM Permissions -To use the AWS Cloud Map API, a user must have permissions to create the DNS namespace. For simple deployments, you need to make sure that your nodes (on which External DNS runs) have an IAM instance profile with the `AWSCloudMapFullAccess` managed policy attached, that provides following permissions: +To use the AWS Cloud Map API, a user must have permissions to create the DNS namespace. You need to make sure that your nodes (on which External DNS runs) have an IAM instance profile with the `AWSCloudMapFullAccess` managed policy attached, that provides following permissions: ``` { From 5ac7afa50cf28a3dbc7459ed97ce3c1b7ed156f5 Mon Sep 17 00:00:00 2001 From: Vincent Miszczak <35925003+github-vincent-miszczak@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:17:26 +0200 Subject: [PATCH 59/82] Update docs/tutorials/aws-sd.md Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com> --- docs/tutorials/aws-sd.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/docs/tutorials/aws-sd.md b/docs/tutorials/aws-sd.md index 00a429b9e..c3e0e8814 100644 --- a/docs/tutorials/aws-sd.md +++ b/docs/tutorials/aws-sd.md @@ -48,16 +48,12 @@ You can use Attribute-based access control(ABAC) for advanced deployments. You can define AWS tags that are applied to services created by the controller. By doing so, you can have precise control over your IAM policy to limit the scope of the permissions to services managed by the controller, rather than having to grant full permissions on your entire AWS account. To pass tags to service creation, use either CLI flags or environment variables: -*cli:* -``` ---aws-sd-create-tag=key1=value1 --aws-sd-create-tag=key2=value2 -``` +*cli:* `--aws-sd-create-tag=key1=value1 --aws-sd-create-tag=key2=value2` + +*environment:* `EXTERNAL_DNS_AWS_SD_CREATE_TAG=key1=value1\nkey2=value2` -*environment:* -``` -EXTERNAL_DNS_AWS_SD_CREATE_TAG=key1=value1\nkey2=value2 -``` Using tags, your `servicediscovery` policy can become: + ``` { "Version": "2012-10-17", From af23142cf86567a818b6b4fd2a0af5750bb4050a Mon Sep 17 00:00:00 2001 From: Vincent Miszczak Date: Mon, 7 Oct 2024 10:18:48 +0200 Subject: [PATCH 60/82] add test for tag conversion --- provider/awssd/aws_sd.go | 17 ++++++++++------- provider/awssd/aws_sd_test.go | 36 +++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/provider/awssd/aws_sd.go b/provider/awssd/aws_sd.go index 33f131162..bd1ec496c 100644 --- a/provider/awssd/aws_sd.go +++ b/provider/awssd/aws_sd.go @@ -92,13 +92,7 @@ func NewAWSSDProvider(domainFilter endpoint.DomainFilter, namespaceType string, namespaceTypeFilter: newSdNamespaceFilter(namespaceType), cleanEmptyService: cleanEmptyService, ownerID: ownerID, - tags: func() []sdtypes.Tag { - awsTags := make([]sdtypes.Tag, 0, len(tags)) - for k, v := range tags { - awsTags = append(awsTags, sdtypes.Tag{Key: aws.String(k), Value: aws.String(v)}) - } - return awsTags - }(), + tags: awsTags(tags), } return p, nil @@ -122,6 +116,15 @@ func newSdNamespaceFilter(namespaceTypeConfig string) sdtypes.NamespaceFilter { } } +// awsTags converts user supplied tags to AWS format +func awsTags(tags map[string]string) []sdtypes.Tag { + awsTags := make([]sdtypes.Tag, 0, len(tags)) + for k, v := range tags { + awsTags = append(awsTags, sdtypes.Tag{Key: aws.String(k), Value: aws.String(v)}) + } + return awsTags +} + // Records returns list of all endpoints. func (p *AWSSDProvider) Records(ctx context.Context) (endpoints []*endpoint.Endpoint, err error) { namespaces, err := p.ListNamespaces(ctx) diff --git a/provider/awssd/aws_sd_test.go b/provider/awssd/aws_sd_test.go index 2cc543143..4481b0927 100644 --- a/provider/awssd/aws_sd_test.go +++ b/provider/awssd/aws_sd_test.go @@ -900,3 +900,39 @@ func TestAWSSDProvider_DeregisterInstance(t *testing.T) { assert.Len(t, instances["srv1"], 0) } + +func TestAWSSDProvider_awsTags(t *testing.T) { + tests := []struct { + Expectation []sdtypes.Tag + Input map[string]string + }{ + { + Expectation: []sdtypes.Tag{ + { + Key: aws.String("key1"), + Value: aws.String("value1"), + }, + { + Key: aws.String("key2"), + Value: aws.String("value2"), + }, + }, + Input: map[string]string{ + "key1": "value1", + "key2": "value2", + }, + }, + { + Expectation: []sdtypes.Tag{}, + Input: map[string]string{}, + }, + { + Expectation: []sdtypes.Tag{}, + Input: nil, + }, + } + + for _, test := range tests { + assert.EqualValues(t, test.Expectation, awsTags(test.Input)) + } +} From aab109aa81937d69bc628f188e4682f93d38d824 Mon Sep 17 00:00:00 2001 From: claycooper Date: Mon, 7 Oct 2024 19:35:21 -0400 Subject: [PATCH 61/82] Update godaddy.md spelling and reference to NS1 Standardized spellings of GoDaddy. Replaced instance of NS1 from copying NS1 docs to GoDaddy. --- docs/tutorials/godaddy.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/godaddy.md b/docs/tutorials/godaddy.md index bd97dce9e..d55d310b4 100644 --- a/docs/tutorials/godaddy.md +++ b/docs/tutorials/godaddy.md @@ -1,6 +1,6 @@ # GoDaddy -This tutorial describes how to setup ExternalDNS for use within a +This tutorial describes how to set up ExternalDNS for use within a Kubernetes cluster using GoDaddy DNS. Make sure to use **>=0.6** version of ExternalDNS for this tutorial. @@ -26,7 +26,7 @@ Connect your `kubectl` client to the cluster with which you want to test Externa ## Using Helm -Create a values.yaml file to configure ExternalDNS to use NS1 as the DNS provider. This file should include the necessary environment variables: +Create a values.yaml file to configure ExternalDNS to use GoDaddy as the DNS provider. This file should include the necessary environment variables: ```shell provider: @@ -36,7 +36,7 @@ extraArgs: - --godaddy-api-secret=YOUR_API_SECRET ``` -Ensure to replace YOUR_API_KEY and YOUR_API_SECRET with your actual godaddy API key and godaddy API secret. +Be sure to replace YOUR_API_KEY and YOUR_API_SECRET with your actual GoDaddy API key and GoDaddy API secret. Finally, install the ExternalDNS chart with Helm using the configuration specified in your values.yaml file: From e48fabc1b8a3ce16fb8cc58ca089de63c96f4340 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 03:30:56 +0000 Subject: [PATCH 62/82] chore(deps): bump actions/checkout in the dev-dependencies group Bumps the dev-dependencies group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 4.2.0 to 4.2.1 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/d632683dd7b4114ad314bca15554477dd762a938...eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yaml | 2 +- .github/workflows/codeql-analysis.yaml | 2 +- .github/workflows/docs.yaml | 2 +- .github/workflows/json-yaml-validate.yml | 2 +- .github/workflows/lint-test-chart.yaml | 2 +- .github/workflows/lint.yaml | 2 +- .github/workflows/release-chart.yaml | 2 +- .github/workflows/staging-image-tester.yaml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 768f0d87a..03afbeafc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,7 +21,7 @@ jobs: steps: - name: Check out code into the Go module directory - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up Go 1.x uses: actions/setup-go@v5 diff --git a/.github/workflows/codeql-analysis.yaml b/.github/workflows/codeql-analysis.yaml index 237c70015..53b28c411 100644 --- a/.github/workflows/codeql-analysis.yaml +++ b/.github/workflows/codeql-analysis.yaml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install go version uses: actions/setup-go@v5 with: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 43ccfed34..ba1535181 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -15,7 +15,7 @@ jobs: name: Release Docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 diff --git a/.github/workflows/json-yaml-validate.yml b/.github/workflows/json-yaml-validate.yml index 356119146..87d40dd2d 100644 --- a/.github/workflows/json-yaml-validate.yml +++ b/.github/workflows/json-yaml-validate.yml @@ -14,7 +14,7 @@ jobs: json-yaml-validate: runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: json-yaml-validate uses: GrantBirki/json-yaml-validate@v3.2.1 diff --git a/.github/workflows/lint-test-chart.yaml b/.github/workflows/lint-test-chart.yaml index 112e40640..9c7d47deb 100644 --- a/.github/workflows/lint-test-chart.yaml +++ b/.github/workflows/lint-test-chart.yaml @@ -14,7 +14,7 @@ jobs: shell: bash steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 9ef05fcab..7f4ef20bf 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -22,7 +22,7 @@ jobs: steps: - name: Check out code into the Go module directory - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up Go 1.x uses: actions/setup-go@v5 diff --git a/.github/workflows/release-chart.yaml b/.github/workflows/release-chart.yaml index ec326758a..db2fc7d29 100644 --- a/.github/workflows/release-chart.yaml +++ b/.github/workflows/release-chart.yaml @@ -20,7 +20,7 @@ jobs: shell: bash steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 diff --git a/.github/workflows/staging-image-tester.yaml b/.github/workflows/staging-image-tester.yaml index a42c86e77..148620133 100644 --- a/.github/workflows/staging-image-tester.yaml +++ b/.github/workflows/staging-image-tester.yaml @@ -21,7 +21,7 @@ jobs: steps: - name: Check out code into the Go module directory - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up Go 1.x uses: actions/setup-go@v5 From 73cd5112ad35d90bc741f215a9cc7d457974e9d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 04:53:49 +0000 Subject: [PATCH 63/82] chore(deps): bump the dev-dependencies group across 1 directory with 20 updates Bumps the dev-dependencies group with 15 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://github.com/Azure/azure-sdk-for-go) | `1.7.0` | `1.8.0` | | [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns](https://github.com/Azure/azure-sdk-for-go) | `1.2.0` | `1.3.0` | | [github.com/aliyun/alibaba-cloud-sdk-go](https://github.com/aliyun/alibaba-cloud-sdk-go) | `1.63.18` | `1.63.24` | | [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) | `1.31.0` | `1.32.2` | | [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) | `1.27.38` | `1.27.43` | | [github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue](https://github.com/aws/aws-sdk-go-v2) | `1.15.7` | `1.15.12` | | [github.com/aws/aws-sdk-go-v2/service/route53](https://github.com/aws/aws-sdk-go-v2) | `1.44.2` | `1.45.2` | | [github.com/aws/aws-sdk-go-v2/service/servicediscovery](https://github.com/aws/aws-sdk-go-v2) | `1.32.2` | `1.33.2` | | [github.com/civo/civogo](https://github.com/civo/civogo) | `0.3.79` | `0.3.84` | | [github.com/cloudflare/cloudflare-go](https://github.com/cloudflare/cloudflare-go) | `0.105.0` | `0.107.0` | | [github.com/oracle/oci-go-sdk/v65](https://github.com/oracle/oci-go-sdk) | `65.75.0` | `65.75.2` | | [github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common](https://github.com/tencentcloud/tencentcloud-sdk-go) | `1.0.1011` | `1.0.1016` | | [github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod](https://github.com/tencentcloud/tencentcloud-sdk-go) | `1.0.1011` | `1.0.1016` | | [github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns](https://github.com/tencentcloud/tencentcloud-sdk-go) | `1.0.1011` | `1.0.1016` | | [sigs.k8s.io/gateway-api](https://github.com/kubernetes-sigs/gateway-api) | `1.1.0` | `1.2.0` | Updates `github.com/Azure/azure-sdk-for-go/sdk/azidentity` from 1.7.0 to 1.8.0 - [Release notes](https://github.com/Azure/azure-sdk-for-go/releases) - [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md) - [Commits](https://github.com/Azure/azure-sdk-for-go/compare/sdk/azcore/v1.7.0...sdk/azcore/v1.8.0) Updates `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns` from 1.2.0 to 1.3.0 - [Release notes](https://github.com/Azure/azure-sdk-for-go/releases) - [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md) - [Commits](https://github.com/Azure/azure-sdk-for-go/compare/v1.2...sdk/azcore/v1.3.0) Updates `github.com/aliyun/alibaba-cloud-sdk-go` from 1.63.18 to 1.63.24 - [Release notes](https://github.com/aliyun/alibaba-cloud-sdk-go/releases) - [Changelog](https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/ChangeLog.txt) - [Commits](https://github.com/aliyun/alibaba-cloud-sdk-go/compare/v1.63.18...v1.63.24) Updates `github.com/aws/aws-sdk-go-v2` from 1.31.0 to 1.32.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.31.0...v1.32.2) Updates `github.com/aws/aws-sdk-go-v2/config` from 1.27.38 to 1.27.43 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.27.38...config/v1.27.43) Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.17.36 to 1.17.41 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.36...credentials/v1.17.41) Updates `github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue` from 1.15.7 to 1.15.12 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.15.7...config/v1.15.12) Updates `github.com/aws/aws-sdk-go-v2/service/dynamodb` from 1.35.2 to 1.36.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/iot/v1.35.2...service/iam/v1.36.2) Updates `github.com/aws/aws-sdk-go-v2/service/route53` from 1.44.2 to 1.45.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ssm/v1.44.2...service/rds/v1.45.2) Updates `github.com/aws/aws-sdk-go-v2/service/servicediscovery` from 1.32.2 to 1.33.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.32.2...service/ecs/v1.33.2) Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.31.2 to 1.32.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.31.2...v1.32.2) Updates `github.com/civo/civogo` from 0.3.79 to 0.3.84 - [Release notes](https://github.com/civo/civogo/releases) - [Changelog](https://github.com/civo/civogo/blob/master/changelog.yml) - [Commits](https://github.com/civo/civogo/compare/v0.3.79...v0.3.84) Updates `github.com/cloudflare/cloudflare-go` from 0.105.0 to 0.107.0 - [Release notes](https://github.com/cloudflare/cloudflare-go/releases) - [Changelog](https://github.com/cloudflare/cloudflare-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/cloudflare/cloudflare-go/compare/v0.105.0...v0.107.0) Updates `github.com/oracle/oci-go-sdk/v65` from 65.75.0 to 65.75.2 - [Release notes](https://github.com/oracle/oci-go-sdk/releases) - [Changelog](https://github.com/oracle/oci-go-sdk/blob/master/CHANGELOG.md) - [Commits](https://github.com/oracle/oci-go-sdk/compare/v65.75.0...v65.75.2) Updates `github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common` from 1.0.1011 to 1.0.1016 - [Commits](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.0.1011...v1.0.1016) Updates `github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod` from 1.0.1011 to 1.0.1016 - [Commits](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.0.1011...v1.0.1016) Updates `github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns` from 1.0.1011 to 1.0.1016 - [Commits](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.0.1011...v1.0.1016) Updates `golang.org/x/net` from 0.29.0 to 0.30.0 - [Commits](https://github.com/golang/net/compare/v0.29.0...v0.30.0) Updates `golang.org/x/time` from 0.6.0 to 0.7.0 - [Commits](https://github.com/golang/time/compare/v0.6.0...v0.7.0) Updates `sigs.k8s.io/gateway-api` from 1.1.0 to 1.2.0 - [Release notes](https://github.com/kubernetes-sigs/gateway-api/releases) - [Changelog](https://github.com/kubernetes-sigs/gateway-api/blob/main/RELEASE.md) - [Commits](https://github.com/kubernetes-sigs/gateway-api/compare/v1.1.0...v1.2.0) --- updated-dependencies: - dependency-name: github.com/Azure/azure-sdk-for-go/sdk/azidentity dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/aliyun/alibaba-cloud-sdk-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/credentials dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/dynamodb dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/route53 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/servicediscovery dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/sts dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/civo/civogo dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/cloudflare/cloudflare-go dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/oracle/oci-go-sdk/v65 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: golang.org/x/time dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: sigs.k8s.io/gateway-api dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] --- go.mod | 70 ++++++++++++------------- go.sum | 158 ++++++++++++++++++++++++++++++--------------------------- 2 files changed, 119 insertions(+), 109 deletions(-) diff --git a/go.mod b/go.mod index 92badfe27..1308b4b95 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ go 1.23 require ( cloud.google.com/go/compute/metadata v0.5.2 github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.2.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.3.0 github.com/F5Networks/k8s-bigip-ctlr/v2 v2.18.0 github.com/IBM-Cloud/ibm-cloud-cli-sdk v1.5.0 github.com/IBM/go-sdk-core/v5 v5.17.5 @@ -15,19 +15,19 @@ require ( github.com/Yamashou/gqlgenc v0.25.2 github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2 github.com/alecthomas/kingpin/v2 v2.4.0 - github.com/aliyun/alibaba-cloud-sdk-go v1.63.18 - github.com/aws/aws-sdk-go-v2 v1.31.0 - github.com/aws/aws-sdk-go-v2/config v1.27.38 - github.com/aws/aws-sdk-go-v2/credentials v1.17.36 - github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.7 - github.com/aws/aws-sdk-go-v2/service/dynamodb v1.35.2 - github.com/aws/aws-sdk-go-v2/service/route53 v1.44.2 - github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.32.2 - github.com/aws/aws-sdk-go-v2/service/sts v1.31.2 + github.com/aliyun/alibaba-cloud-sdk-go v1.63.24 + github.com/aws/aws-sdk-go-v2 v1.32.2 + github.com/aws/aws-sdk-go-v2/config v1.27.43 + github.com/aws/aws-sdk-go-v2/credentials v1.17.41 + github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.12 + github.com/aws/aws-sdk-go-v2/service/dynamodb v1.36.2 + github.com/aws/aws-sdk-go-v2/service/route53 v1.45.2 + github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.33.2 + github.com/aws/aws-sdk-go-v2/service/sts v1.32.2 github.com/bodgit/tsig v1.2.2 github.com/cenkalti/backoff/v4 v4.3.0 - github.com/civo/civogo v0.3.79 - github.com/cloudflare/cloudflare-go v0.105.0 + github.com/civo/civogo v0.3.84 + github.com/cloudflare/cloudflare-go v0.107.0 github.com/cloudfoundry-community/go-cfclient v0.0.0-20190201205600-f136f9222381 github.com/datawire/ambassador v1.12.4 github.com/denverdino/aliyungo v0.0.0-20230411124812-ab98a9173ace @@ -47,7 +47,7 @@ require ( github.com/onsi/ginkgo v1.16.5 github.com/openshift/api v0.0.0-20230607130528-611114dca681 github.com/openshift/client-go v0.0.0-20230607134213-3cd0021bbee3 - github.com/oracle/oci-go-sdk/v65 v65.75.0 + github.com/oracle/oci-go-sdk/v65 v65.75.2 github.com/ovh/go-ovh v1.6.0 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pkg/errors v0.9.1 @@ -57,18 +57,17 @@ require ( github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.9.0 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1011 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1011 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1011 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1016 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1016 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1016 github.com/transip/gotransip/v6 v6.26.0 github.com/ultradns/ultradns-sdk-go v1.3.7 - go.etcd.io/etcd/api/v3 v3.5.16 go.etcd.io/etcd/client/v3 v3.5.16 go.uber.org/ratelimit v0.3.1 - golang.org/x/net v0.29.0 + golang.org/x/net v0.30.0 golang.org/x/oauth2 v0.23.0 golang.org/x/sync v0.8.0 - golang.org/x/time v0.6.0 + golang.org/x/time v0.7.0 google.golang.org/api v0.199.0 gopkg.in/ns1/ns1-go.v2 v2.12.1 gopkg.in/yaml.v2 v2.4.0 @@ -78,7 +77,7 @@ require ( k8s.io/apimachinery v0.31.1 k8s.io/client-go v0.31.1 k8s.io/klog/v2 v2.130.1 - sigs.k8s.io/gateway-api v1.1.0 + sigs.k8s.io/gateway-api v1.2.0 ) require ( @@ -92,17 +91,17 @@ require ( github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect - github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.23.2 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.19 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.23.2 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.2 // indirect - github.com/aws/smithy-go v1.21.0 // indirect + github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.24.2 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.2 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.24.2 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2 // indirect + github.com/aws/smithy-go v1.22.0 // indirect github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -188,6 +187,7 @@ require ( github.com/vektah/gqlparser/v2 v2.5.16 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xhit/go-str2duration/v2 v2.1.0 // indirect + go.etcd.io/etcd/api/v3 v3.5.16 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect go.mongodb.org/mongo-driver v1.14.0 // indirect go.opencensus.io v0.24.0 // indirect @@ -198,11 +198,11 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.27.0 // indirect + golang.org/x/crypto v0.28.0 // indirect golang.org/x/mod v0.20.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/term v0.24.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect diff --git a/go.sum b/go.sum index 0f62732ea..c79656afa 100644 --- a/go.sum +++ b/go.sum @@ -18,18 +18,20 @@ github.com/Azure/azure-sdk-for-go v16.2.1+incompatible h1:KnPIugL51v3N3WwvaSmZbx github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 h1:B/dfvscEQtew9dVuoxqxrUKKv8Ih2f55PydknDamU+g= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0/go.mod h1:fiPSssYvltE08HJchL04dOy+RD4hgrjph0cwGGMntdI= +github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0 h1:+m0M/LFxN43KvULkDNfdXOgrjtg6UYJPFBJyuEcRCAw= +github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0/go.mod h1:PwOyop78lveYMRs6oCxjiVyBdyCgIYH6XHIVZO9/SFQ= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 h1:lpOxwrQ919lCZoNCd69rVt8u1eLZuMORrGXqy8sNf3c= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0/go.mod h1:fSvRkb8d26z9dbL40Uf/OO6Vo9iExtZK3D0ulRV+8M0= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0/go.mod h1:LRr2FzBTQlONPPa5HREE5+RjSCTXl7BwOvYOaWTqCaI= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.2.0 h1:9Eih8XcEeQnFD0ntMlUDleKMzfeCeUfa+VbnDCI4AZs= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.2.0/go.mod h1:wGPyTi+aURdqPAGMZDQqnNs9IrShADF8w2WZb6bKeq0= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1 h1:7CBQ+Ei8SP2c6ydQTGCCrS35bDxgTMfoP2miAwK++OU= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1/go.mod h1:c/wcGeGx5FUPbM/JltUYHZcKmigwyVLJlDq+4HdtXaw= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 h1:2qsIIvxVT+uE6yrNldntJKlLRgxGbZ85kgtz5SNBhMw= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0/go.mod h1:AW8VEadnhw9xox+VaVd9sP7NjzOAnaZBLRH6Tq3cJ38= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.3.0 h1:yzrctSl9GMIQ5lHu7jc8olOsGjWDCsBpJhWqfGa/YIM= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.3.0/go.mod h1:GE4m0rnnfwLGX0Y9A9A25Zx5N/90jneT5ABevqzhuFQ= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= @@ -39,6 +41,8 @@ github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxB github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= +github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -94,8 +98,8 @@ github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAu github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 h1:P5U+E4x5OkVEKQDklVPmzs71WM56RTTRqV4OrDC//Y4= github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5/go.mod h1:976q2ETgjT2snVCf2ZaBnyBbVoPERGjUz+0sofzEfro= -github.com/aliyun/alibaba-cloud-sdk-go v1.63.18 h1:Q36nROtbIQhLN6VZ4KJzZkISj4SWlq8pEwtqYBNz0is= -github.com/aliyun/alibaba-cloud-sdk-go v1.63.18/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ= +github.com/aliyun/alibaba-cloud-sdk-go v1.63.24 h1:2MRgfP+VtLeJJNKyQ0xyMzQaepvOfmdNf3op6hbBrWA= +github.com/aliyun/alibaba-cloud-sdk-go v1.63.24/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6/go.mod h1:+lx6/Aqd1kLJ1GQfkvOnaZ1WGmLpMpbprPuIOOZX30U= @@ -117,44 +121,44 @@ github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQ github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.31.0 h1:3V05LbxTSItI5kUqNwhJrrrY1BAXxXt0sN0l72QmG5U= -github.com/aws/aws-sdk-go-v2 v1.31.0/go.mod h1:ztolYtaEUtdpf9Wftr31CJfLVjOnD/CVRkKOOYgF8hA= -github.com/aws/aws-sdk-go-v2/config v1.27.38 h1:mMVyJJuSUdbD4zKXoxDgWrgM60QwlFEg+JhihCq6wCw= -github.com/aws/aws-sdk-go-v2/config v1.27.38/go.mod h1:6xOiNEn58bj/64MPKx89r6G/el9JZn8pvVbquSqTKK4= -github.com/aws/aws-sdk-go-v2/credentials v1.17.36 h1:zwI5WrT+oWWfzSKoTNmSyeBKQhsFRJRv+PGW/UZW+Yk= -github.com/aws/aws-sdk-go-v2/credentials v1.17.36/go.mod h1:3AG/sY1rc9NJrNWcN/3KPU4SIDPGTrd/qegKB0TnFdE= -github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.7 h1:ZzyrqQfMX4lagelhV90h7QKiKyoVfV7eXTPS3dOX5GY= -github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.7/go.mod h1:YYffpxyQJqvscSWs4Sh3h0rALEiCePKbaJlw6N+pPy0= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 h1:C/d03NAmh8C4BZXhuRNboF/DqhBkBCeDiJDcaqIT5pA= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14/go.mod h1:7I0Ju7p9mCIdlrfS+JCgqcYD0VXz/N4yozsox+0o078= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18 h1:kYQ3H1u0ANr9KEKlGs/jTLrBFPo8P8NaH/w7A01NeeM= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18/go.mod h1:r506HmK5JDUh9+Mw4CfGJGSSoqIiLCndAuqXuhbv67Y= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18 h1:Z7IdFUONvTcvS7YuhtVxN99v2cCoHRXOS4mTr0B/pUc= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18/go.mod h1:DkKMmksZVVyat+Y+r1dEOgJEfUeA7UngIHWeKsi0yNc= +github.com/aws/aws-sdk-go-v2 v1.32.2 h1:AkNLZEyYMLnx/Q/mSKkcMqwNFXMAvFto9bNsHqcTduI= +github.com/aws/aws-sdk-go-v2 v1.32.2/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo= +github.com/aws/aws-sdk-go-v2/config v1.27.43 h1:p33fDDihFC390dhhuv8nOmX419wjOSDQRb+USt20RrU= +github.com/aws/aws-sdk-go-v2/config v1.27.43/go.mod h1:pYhbtvg1siOOg8h5an77rXle9tVG8T+BWLWAo7cOukc= +github.com/aws/aws-sdk-go-v2/credentials v1.17.41 h1:7gXo+Axmp+R4Z+AK8YFQO0ZV3L0gizGINCOWxSLY9W8= +github.com/aws/aws-sdk-go-v2/credentials v1.17.41/go.mod h1:u4Eb8d3394YLubphT4jLEwN1rLNq2wFOlT6OuxFwPzU= +github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.12 h1:zYf8E8zaqolHA5nQ+VmX2r3wc4K6xw5i6xKvvMjZBL0= +github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.12/go.mod h1:vYGIVLASk19Gb0FGwAcwES+qQF/aekD7m2G/X6mBOdQ= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17 h1:TMH3f/SCAWdNtXXVPPu5D6wrr4G5hI1rAxbcocKfC7Q= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17/go.mod h1:1ZRXLdTpzdJb9fwTMXiLipENRxkGMTn1sfKexGllQCw= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 h1:UAsR3xA31QGf79WzpG/ixT9FZvQlh5HY1NRqSHBNOCk= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21/go.mod h1:JNr43NFf5L9YaG3eKTm7HQzls9J+A9YYcGI5Quh1r2Y= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 h1:6jZVETqmYCadGFvrYEQfC5fAQmlo80CeL5psbno6r0s= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21/go.mod h1:1SR0GbLlnN3QUmYaflZNiH1ql+1qrSiB2vwcJ+4UM60= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.35.2 h1:EGvR8KwbxUXEUCS4HAgSRcxeFT1/0bqvS5tRR0WZSbM= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.35.2/go.mod h1:k5XW8MoMxsNZ20RJmsokakvENUwQyjv69R9GqrI4xdQ= -github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.23.2 h1:h4sDZaE8OcfPdR5C2m8MEkmQ0PXKYj9BQcYZH6Kc0GQ= -github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.23.2/go.mod h1:NZQWaOwOszI7jnQ7s1i5kN/FUAglaaJIm2htZG7BJKw= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5 h1:QFASJGfT8wMXtuP3D5CRmMjARHv9ZmzFUMJznHDOY3w= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5/go.mod h1:QdZ3OmoIjSX+8D1OPAzPxDfjXASbBMDsz9qvtyIhtik= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.19 h1:dOxqOlOEa2e2heC/74+ZzcJOa27+F1aXFZpYgY/4QfA= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.19/go.mod h1:aV6U1beLFvk3qAgognjS3wnGGoDId8hlPEiBsLHXVZE= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 h1:Xbwbmk44URTiHNx6PNo0ujDE6ERlsCKJD3u1zfnzAPg= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20/go.mod h1:oAfOFzUB14ltPZj1rWwRc3d/6OgD76R8KlvU3EqM9Fg= -github.com/aws/aws-sdk-go-v2/service/route53 v1.44.2 h1:ssvjp8LJrv7x/sPr15E5igCARw00MoIWl54SXZ1FIr0= -github.com/aws/aws-sdk-go-v2/service/route53 v1.44.2/go.mod h1:l2ABSKg3AibEJeR/l60cfeGU54UqF3VTgd51pq+vYhU= -github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.32.2 h1:29YTjasLjpAjb9RMacMkwWJ2PgDipZqzDS3TOkqUsl4= -github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.32.2/go.mod h1:hbMVfSdZneCht4UmPOsejDt93QnetQPFuLOOqbuybqs= -github.com/aws/aws-sdk-go-v2/service/sso v1.23.2 h1:yzi/y/vKlLyzOfG7pSu5ONNGRxHIgLeDrV4w2AMRCo0= -github.com/aws/aws-sdk-go-v2/service/sso v1.23.2/go.mod h1:XRlMvmad0ZNL+75C5FYdMvbbLkd6qiqz6foR1nA1PXY= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.2 h1:3gb6pYhYLjo8rB1h2Tqs61wpjRd3rQymYcVq/pp0yxI= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.2/go.mod h1:FnvDM4sfa+isJ3kDXIzAB9GAwVSzFzSy97uZ3IsHo4E= -github.com/aws/aws-sdk-go-v2/service/sts v1.31.2 h1:O6tyji8mXmBGsHvTCB0VIhrDw19lGTUSbKIyjnw79s8= -github.com/aws/aws-sdk-go-v2/service/sts v1.31.2/go.mod h1:yMWe0F+XG0DkRZK5ODZhG7BEFYhLXi2dqGsv6tX0cgI= -github.com/aws/smithy-go v1.21.0 h1:H7L8dtDRk0P1Qm6y0ji7MCYMQObJ5R9CRpyPhRUkLYA= -github.com/aws/smithy-go v1.21.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.36.2 h1:kJqyYcGqhWFmXqjRrtFFD4Oc9FXiskhsll2xnlpe8Do= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.36.2/go.mod h1:+t2Zc5VNOzhaWzpGE+cEYZADsgAAQT5v55AO+fhU+2s= +github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.24.2 h1:E7Tuo0ipWpBl0f3uThz8cZsuyD5H8jLCnbtbKR4YL2s= +github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.24.2/go.mod h1:txOfweuNPBLhHodsV+C2lvPPRTommVTWbts9SZV6Myc= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 h1:TToQNkvGguu209puTojY/ozlqy2d/SFNcoLIqTFi42g= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0/go.mod h1:0jp+ltwkf+SwG2fm/PKo8t4y8pJSgOCO4D8Lz3k0aHQ= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.2 h1:1G7TTQNPNv5fhCyIQGYk8FOggLgkzKq6c4Y1nOGzAOE= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.2/go.mod h1:+ybYGLXoF7bcD7wIcMcklxyABZQmuBf1cHUhvY6FGIo= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 h1:s7NA1SOw8q/5c0wr8477yOPp0z+uBaXBnLE0XYb0POA= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2/go.mod h1:fnjjWyAW/Pj5HYOxl9LJqWtEwS7W2qgcRLWP+uWbss0= +github.com/aws/aws-sdk-go-v2/service/route53 v1.45.2 h1:P4ElvGTPph12a87YpxPDIqCvVICeYJFV32UMMS/TIPc= +github.com/aws/aws-sdk-go-v2/service/route53 v1.45.2/go.mod h1:zLKE53MjadFH0VYrDerAx25brxLYiSg4Vk3C+qPY4BQ= +github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.33.2 h1:TVfX2jnpYDxgORh5ozbSBpFa/D0B82Iq28a2+bY62uQ= +github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.33.2/go.mod h1:Qy6c/ZAKohV1Ikot1ZOMm9be4bazUs27RLQjnERG4/U= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.2 h1:bSYXVyUzoTHoKalBmwaZxs97HU9DWWI3ehHSAMa7xOk= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.2/go.mod h1:skMqY7JElusiOUjMJMOv1jJsP7YUg7DrhgqZZWuzu1U= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2 h1:AhmO1fHINP9vFYUE0LHzCWg/LfUWUF+zFPEcY9QXb7o= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2/go.mod h1:o8aQygT2+MVP0NaV6kbdE1YnnIM8RRVQzoeUH45GOdI= +github.com/aws/aws-sdk-go-v2/service/sts v1.32.2 h1:CiS7i0+FUe+/YY1GvIBLLrR/XNGZ4CtM1Ll0XavNuVo= +github.com/aws/aws-sdk-go-v2/service/sts v1.32.2/go.mod h1:HtaiBI8CjYoNVde8arShXb94UbQQi9L4EMr6D+xGBwo= +github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= +github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -183,12 +187,12 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= -github.com/civo/civogo v0.3.79 h1:Z1MbEG9CsGqSZV7UFBA0xsjk7TBGUPHjW9sM7cS5yZM= -github.com/civo/civogo v0.3.79/go.mod h1:7UCYX+qeeJbrG55E1huv+0ySxcHTqq/26FcHLVelQJM= +github.com/civo/civogo v0.3.84 h1:jf5IT7VJFPaReO6g8B0zqKhsYCIizaGo4PjDLY7Sl6Y= +github.com/civo/civogo v0.3.84/go.mod h1:7UCYX+qeeJbrG55E1huv+0ySxcHTqq/26FcHLVelQJM= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.105.0 h1:yu2IatITLZ4dw7/byzRrlE5DfUvtub0k9CHZ5zBlj90= -github.com/cloudflare/cloudflare-go v0.105.0/go.mod h1:pfUQ4PIG4ISI0/Mmc21Bp86UnFU0ktmPf3iTgbSL+cM= +github.com/cloudflare/cloudflare-go v0.107.0 h1:cMDIw2tzt6TXCJyMFVyP+BPOVkIfMvcKjhMNSNvuEPc= +github.com/cloudflare/cloudflare-go v0.107.0/go.mod h1:5cYGzVBqNTLxMYSLdVjuSs5LJL517wJDSvMPWUrzHzc= github.com/cloudfoundry-community/go-cfclient v0.0.0-20190201205600-f136f9222381 h1:rdRS5BT13Iae9ssvcslol66gfOOXjaLYwqerEn/cl9s= github.com/cloudfoundry-community/go-cfclient v0.0.0-20190201205600-f136f9222381/go.mod h1:e5+USP2j8Le2M0Jo3qKPFnNhuo1wueU4nWHCXBOfQ14= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -250,6 +254,8 @@ github.com/denverdino/aliyungo v0.0.0-20230411124812-ab98a9173ace h1:1SnCTPFh2AA github.com/denverdino/aliyungo v0.0.0-20230411124812-ab98a9173ace/go.mod h1:TK05uvk4XXfK2kdvRwfcZ1NaxjDxmm7H3aQLko0mJxA= github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/digitalocean/godo v1.126.0 h1:+Znh7VMQj/E8ArbjWnc7OKGjWfzC+I8OCSRp7r1MdD8= github.com/digitalocean/godo v1.126.0/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc= @@ -297,8 +303,8 @@ github.com/exoscale/egoscale v0.102.3/go.mod h1:RPf2Gah6up+6kAEayHTQwqapzXlm93f0 github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= @@ -654,6 +660,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs= +github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6/go.mod h1:3VeWNIJaW+O5xpRQbPp0Ybqu1vJd/pm7s2F473HRrkw= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -849,8 +857,8 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/oracle/oci-go-sdk/v65 v65.75.0 h1:tifYRSqCjxANJb0xnMSZ6N2bF2xGyqcCIMg7xihgk+s= -github.com/oracle/oci-go-sdk/v65 v65.75.0/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= +github.com/oracle/oci-go-sdk/v65 v65.75.2 h1:Qw3Eotrq7SJ5LquOc//Iq6xzcBJSi8AD3cXps9IBN7g= +github.com/oracle/oci-go-sdk/v65 v65.75.2/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= github.com/ovh/go-ovh v1.6.0 h1:ixLOwxQdzYDx296sXcgS35TOPEahJkpjMGtzPadCjQI= github.com/ovh/go-ovh v1.6.0/go.mod h1:cTVDnl94z4tl8pP1uZ/8jlVxntjSIf09bNcQ5TJSC7c= github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2 h1:CXwSGu/LYmbjEab5aMCs5usQRVBGThelUKBNnoSOuso= @@ -926,6 +934,8 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4= +github.com/redis/go-redis/v9 v9.6.1/go.mod h1:0C0c6ycQsdpVNQpxb1njEQIqkx5UcsM8FJCQLgE9+RA= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -1017,12 +1027,12 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1011 h1:cjqeXTwKKtGVqrf6luwunUnA77buzmzbk+G42US1Sns= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1011/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1011 h1:O3QK5t7HIWhzo9ZtQcWjq+voOL2Anko8ON6bikKTcl0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1011/go.mod h1:HbdUWIghvwUPfIhgFkKZqwaoyALK6GxBzayhflN9wY8= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1011 h1:Ak4EA3TtzcFtqY+2E9z+mYBC8gjlw4X8WXlVPoRVtQU= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1011/go.mod h1:FYFEkG/OCQ4vDPiuV7LijHSNq+kr14ABC1IswVtHNmM= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1016 h1:gFA+fJStsfNwOAfVrgpjej4iq1A/YdWW4GB2D6B8fGk= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1016/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1016 h1:13JvFBl1E/FCt4QxwIcjJrtB1jQsUw+WE1vIJACzLI0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1016/go.mod h1:jAMI0j0Q9nR0OMZPiYC7IvAJyojgoP20pvR75N0gwt0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1016 h1:o/19+o8J/gVKsVRanCRBu89RK38jlk1pUIMo6p0pF74= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1016/go.mod h1:cKLgDpmDAMU435/Xq6NdJf5QLRQ6jPq8EOe9LHiJySo= github.com/terra-farm/udnssdk v1.3.5 h1:MNR3adfuuEK/l04+jzo8WW/0fnorY+nW515qb3vEr6I= github.com/terra-farm/udnssdk v1.3.5/go.mod h1:8RnM56yZTR7mYyUIvrDgXzdRaEyFIzqdEi7+um26Sv8= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -1147,8 +1157,8 @@ golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= -golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1218,8 +1228,8 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= -golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190130055435-99b60b757ec1/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1295,8 +1305,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1304,8 +1314,8 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= -golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1317,8 +1327,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1326,8 +1336,8 @@ golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= -golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= -golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= +golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1545,8 +1555,8 @@ sigs.k8s.io/controller-runtime v0.6.1/go.mod h1:XRYBPdbf5XJu9kpS84VJiZ7h/u1hF3gE sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw= sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= sigs.k8s.io/controller-tools v0.3.1-0.20200517180335-820a4a27ea84/go.mod h1:enhtKGfxZD1GFEoMgP8Fdbu+uKQ/cq1/WGJhdVChfvI= -sigs.k8s.io/gateway-api v1.1.0 h1:DsLDXCi6jR+Xz8/xd0Z1PYl2Pn0TyaFMOPPZIj4inDM= -sigs.k8s.io/gateway-api v1.1.0/go.mod h1:ZH4lHrL2sDi0FHZ9jjneb8kKnGzFWyrTya35sWUTrRs= +sigs.k8s.io/gateway-api v1.2.0 h1:LrToiFwtqKTKZcZtoQPTuo3FxhrrhTgzQG0Te+YGSo8= +sigs.k8s.io/gateway-api v1.2.0/go.mod h1:EpNfEXNjiYfUJypf0eZ0P5iXA9ekSGWaS1WgPaM42X0= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= From 2b6bd58037bed012307d2d7a9f26a472c323ea03 Mon Sep 17 00:00:00 2001 From: setoru Date: Sat, 12 Oct 2024 11:21:08 +0800 Subject: [PATCH 64/82] add huaweicloud webhook to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6ab5602b3..f3be91b45 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ Known providers using webhooks: | Gcore | https://github.com/G-Core/external-dns-gcore-webhook | | GleSYS | https://github.com/glesys/external-dns-glesys | | Hetzner | https://github.com/mconfalonieri/external-dns-hetzner-webhook | +| Huawei Cloud | https://github.com/setoru/external-dns-huaweicloud-webhook | | IONOS | https://github.com/ionos-cloud/external-dns-ionos-webhook | | Infoblox | https://github.com/AbsaOSS/external-dns-infoblox-webhook | | Netcup | https://github.com/mrueg/external-dns-netcup-webhook | From 9ef5605c09d6345b103c22fab3a65fd10ae4c552 Mon Sep 17 00:00:00 2001 From: Mircea-Pavel Anton Date: Tue, 15 Oct 2024 22:35:19 +0300 Subject: [PATCH 65/82] add mikrotik provider reference --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f3be91b45..8af394fc0 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,7 @@ Known providers using webhooks: | Huawei Cloud | https://github.com/setoru/external-dns-huaweicloud-webhook | | IONOS | https://github.com/ionos-cloud/external-dns-ionos-webhook | | Infoblox | https://github.com/AbsaOSS/external-dns-infoblox-webhook | +| Mikrotik | https://github.com/mirceanton/external-dns-provider-mikrotik | | Netcup | https://github.com/mrueg/external-dns-netcup-webhook | | Netic | https://github.com/neticdk/external-dns-tidydns-webhook | | RouterOS | https://github.com/benfiola/external-dns-routeros-provider | From faced93ba2980568e89dca62601fdae308412821 Mon Sep 17 00:00:00 2001 From: tanujd11 Date: Wed, 16 Oct 2024 16:08:26 +0530 Subject: [PATCH 66/82] feature: add azure zone list cache Signed-off-by: tanujd11 --- docs/tutorials/azure-private-dns.md | 4 ++ docs/tutorials/azure.md | 4 ++ main.go | 4 +- pkg/apis/externaldns/types.go | 3 + provider/azure/azure.go | 12 +++- provider/azure/azure_private_dns.go | 13 ++++- provider/azure/azure_privatedns_test.go | 1 + provider/azure/azure_test.go | 1 + provider/azure/cache.go | 46 +++++++++++++++ provider/azure/cache_test.go | 78 +++++++++++++++++++++++++ 10 files changed, 159 insertions(+), 7 deletions(-) create mode 100644 provider/azure/cache.go create mode 100644 provider/azure/cache_test.go diff --git a/docs/tutorials/azure-private-dns.md b/docs/tutorials/azure-private-dns.md index d10799583..d59232b0e 100644 --- a/docs/tutorials/azure-private-dns.md +++ b/docs/tutorials/azure-private-dns.md @@ -98,6 +98,10 @@ $ az role assignment create --role "Reader" --assignee --scope --scope ``` +## Throttling + +If the ExternalDNS managed zones list doesn't change frequently, set `--azure-zones-cache-duration` (zones list cache time-to-live) to a larger value. Note that zones list cache can be disabled with `--azure-zones-cache-duration=0s`. + ## Deploy ExternalDNS Configure `kubectl` to be able to communicate and authenticate with your cluster. This is per default done through the file `~/.kube/config`. diff --git a/docs/tutorials/azure.md b/docs/tutorials/azure.md index e6d277e18..25e354af1 100644 --- a/docs/tutorials/azure.md +++ b/docs/tutorials/azure.md @@ -480,6 +480,10 @@ NOTE: it's also possible to specify (or override) ClientID through `userAssigned NOTE: make sure the pod is restarted whenever you make a configuration change. +## Throttling + +If the ExternalDNS managed zones list doesn't change frequently, set `--azure-zones-cache-duration` (zones list cache time-to-live) to a larger value. Note that zones list cache can be disabled with `--azure-zones-cache-duration=0s`. + ## Ingress used with ExternalDNS This deployment assumes that you will be using nginx-ingress. When using nginx-ingress do not deploy it as a Daemon Set. This causes nginx-ingress to write the Cluster IP of the backend pods in the ingress status.loadbalancer.ip property which then has external-dns write the Cluster IP(s) in DNS vs. the nginx-ingress service external IP. diff --git a/main.go b/main.go index d5112ccd1..538faa9bf 100644 --- a/main.go +++ b/main.go @@ -236,9 +236,9 @@ func main() { } p, err = awssd.NewAWSSDProvider(domainFilter, cfg.AWSZoneType, cfg.DryRun, cfg.AWSSDServiceCleanup, cfg.TXTOwnerID, sd.NewFromConfig(aws.CreateDefaultV2Config(cfg))) case "azure-dns", "azure": - p, err = azure.NewAzureProvider(cfg.AzureConfigFile, domainFilter, zoneNameFilter, zoneIDFilter, cfg.AzureSubscriptionID, cfg.AzureResourceGroup, cfg.AzureUserAssignedIdentityClientID, cfg.AzureActiveDirectoryAuthorityHost, cfg.DryRun) + p, err = azure.NewAzureProvider(cfg.AzureConfigFile, domainFilter, zoneNameFilter, zoneIDFilter, cfg.AzureSubscriptionID, cfg.AzureResourceGroup, cfg.AzureUserAssignedIdentityClientID, cfg.AzureActiveDirectoryAuthorityHost, cfg.AzureZonesCacheDuration, cfg.DryRun) case "azure-private-dns": - p, err = azure.NewAzurePrivateDNSProvider(cfg.AzureConfigFile, domainFilter, zoneNameFilter, zoneIDFilter, cfg.AzureSubscriptionID, cfg.AzureResourceGroup, cfg.AzureUserAssignedIdentityClientID, cfg.AzureActiveDirectoryAuthorityHost, cfg.DryRun) + p, err = azure.NewAzurePrivateDNSProvider(cfg.AzureConfigFile, domainFilter, zoneNameFilter, zoneIDFilter, cfg.AzureSubscriptionID, cfg.AzureResourceGroup, cfg.AzureUserAssignedIdentityClientID, cfg.AzureActiveDirectoryAuthorityHost, cfg.AzureZonesCacheDuration, cfg.DryRun) case "ultradns": p, err = ultradns.NewUltraDNSProvider(domainFilter, cfg.DryRun) case "civo": diff --git a/pkg/apis/externaldns/types.go b/pkg/apis/externaldns/types.go index 4b1ea1591..9027fd1a7 100644 --- a/pkg/apis/externaldns/types.go +++ b/pkg/apis/externaldns/types.go @@ -104,6 +104,7 @@ type Config struct { AzureSubscriptionID string AzureUserAssignedIdentityClientID string AzureActiveDirectoryAuthorityHost string + AzureZonesCacheDuration time.Duration CloudflareProxied bool CloudflareDNSRecordsPerPage int CoreDNSPrefix string @@ -261,6 +262,7 @@ var defaultConfig = &Config{ AzureConfigFile: "/etc/kubernetes/azure.json", AzureResourceGroup: "", AzureSubscriptionID: "", + AzureZonesCacheDuration: 0 * time.Second, CloudflareProxied: false, CloudflareDNSRecordsPerPage: 100, CoreDNSPrefix: "/skydns/", @@ -479,6 +481,7 @@ func (cfg *Config) ParseFlags(args []string) error { app.Flag("azure-resource-group", "When using the Azure provider, override the Azure resource group to use (optional)").Default(defaultConfig.AzureResourceGroup).StringVar(&cfg.AzureResourceGroup) app.Flag("azure-subscription-id", "When using the Azure provider, override the Azure subscription to use (optional)").Default(defaultConfig.AzureSubscriptionID).StringVar(&cfg.AzureSubscriptionID) app.Flag("azure-user-assigned-identity-client-id", "When using the Azure provider, override the client id of user assigned identity in config file (optional)").Default("").StringVar(&cfg.AzureUserAssignedIdentityClientID) + app.Flag("azure-zones-cache-duration", "When using the Azure provider, set the zones list cache TTL (0s to disable).").Default(defaultConfig.AzureZonesCacheDuration.String()).DurationVar(&cfg.AzureZonesCacheDuration) app.Flag("tencent-cloud-config-file", "When using the Tencent Cloud provider, specify the Tencent Cloud configuration file (required when --provider=tencentcloud)").Default(defaultConfig.TencentCloudConfigFile).StringVar(&cfg.TencentCloudConfigFile) app.Flag("tencent-cloud-zone-type", "When using the Tencent Cloud provider, filter for zones with visibility (optional, options: public, private)").Default(defaultConfig.TencentCloudZoneType).EnumVar(&cfg.TencentCloudZoneType, "", "public", "private") diff --git a/provider/azure/azure.go b/provider/azure/azure.go index 904fa6223..9eba55b2d 100644 --- a/provider/azure/azure.go +++ b/provider/azure/azure.go @@ -21,6 +21,7 @@ import ( "context" "fmt" "strings" + "time" log "github.com/sirupsen/logrus" @@ -60,13 +61,14 @@ type AzureProvider struct { userAssignedIdentityClientID string activeDirectoryAuthorityHost string zonesClient ZonesClient + zonesCache *zonesCache[dns.Zone] recordSetsClient RecordSetsClient } // NewAzureProvider creates a new Azure provider. // // Returns the provider or an error if a provider could not be created. -func NewAzureProvider(configFile string, domainFilter endpoint.DomainFilter, zoneNameFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, subscriptionID string, resourceGroup string, userAssignedIdentityClientID string, activeDirectoryAuthorityHost string, dryRun bool) (*AzureProvider, error) { +func NewAzureProvider(configFile string, domainFilter endpoint.DomainFilter, zoneNameFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, subscriptionID string, resourceGroup string, userAssignedIdentityClientID string, activeDirectoryAuthorityHost string, zonesCacheDuration time.Duration, dryRun bool) (*AzureProvider, error) { cfg, err := getConfig(configFile, subscriptionID, resourceGroup, userAssignedIdentityClientID, activeDirectoryAuthorityHost) if err != nil { return nil, fmt.Errorf("failed to read Azure config file '%s': %v", configFile, err) @@ -93,6 +95,7 @@ func NewAzureProvider(configFile string, domainFilter endpoint.DomainFilter, zon userAssignedIdentityClientID: cfg.UserAssignedIdentityID, activeDirectoryAuthorityHost: cfg.ActiveDirectoryAuthorityHost, zonesClient: zonesClient, + zonesCache: &zonesCache[dns.Zone]{duration: zonesCacheDuration}, recordSetsClient: recordSetsClient, }, nil } @@ -167,6 +170,10 @@ func (p *AzureProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) func (p *AzureProvider) zones(ctx context.Context) ([]dns.Zone, error) { log.Debugf("Retrieving Azure DNS zones for resource group: %s.", p.resourceGroup) + if !p.zonesCache.Expired() { + log.Debugf("Using cached Azure DNS zones for resource group: %s zone count: %d.", p.resourceGroup, len(p.zonesCache.Get())) + return p.zonesCache.Get(), nil + } var zones []dns.Zone pager := p.zonesClient.NewListByResourceGroupPager(p.resourceGroup, &dns.ZonesClientListByResourceGroupOptions{Top: nil}) for pager.More() { @@ -183,7 +190,8 @@ func (p *AzureProvider) zones(ctx context.Context) ([]dns.Zone, error) { } } } - log.Debugf("Found %d Azure DNS zone(s).", len(zones)) + log.Debugf("Found %d Azure DNS zone(s). Updating zones cache", len(zones)) + p.zonesCache.Reset(zones) return zones, nil } diff --git a/provider/azure/azure_private_dns.go b/provider/azure/azure_private_dns.go index 051b13c87..5ca3f5928 100644 --- a/provider/azure/azure_private_dns.go +++ b/provider/azure/azure_private_dns.go @@ -21,6 +21,7 @@ import ( "context" "fmt" "strings" + "time" azcoreruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" @@ -55,13 +56,14 @@ type AzurePrivateDNSProvider struct { userAssignedIdentityClientID string activeDirectoryAuthorityHost string zonesClient PrivateZonesClient + zonesCache *zonesCache[privatedns.PrivateZone] recordSetsClient PrivateRecordSetsClient } // NewAzurePrivateDNSProvider creates a new Azure Private DNS provider. // // Returns the provider or an error if a provider could not be created. -func NewAzurePrivateDNSProvider(configFile string, domainFilter endpoint.DomainFilter, zoneNameFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, subscriptionID string, resourceGroup string, userAssignedIdentityClientID string, activeDirectoryAuthorityHost string, dryRun bool) (*AzurePrivateDNSProvider, error) { +func NewAzurePrivateDNSProvider(configFile string, domainFilter endpoint.DomainFilter, zoneNameFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, subscriptionID string, resourceGroup string, userAssignedIdentityClientID string, activeDirectoryAuthorityHost string, zonesCacheDuration time.Duration, dryRun bool) (*AzurePrivateDNSProvider, error) { cfg, err := getConfig(configFile, subscriptionID, resourceGroup, userAssignedIdentityClientID, activeDirectoryAuthorityHost) if err != nil { return nil, fmt.Errorf("failed to read Azure config file '%s': %v", configFile, err) @@ -88,6 +90,7 @@ func NewAzurePrivateDNSProvider(configFile string, domainFilter endpoint.DomainF userAssignedIdentityClientID: cfg.UserAssignedIdentityID, activeDirectoryAuthorityHost: cfg.ActiveDirectoryAuthorityHost, zonesClient: zonesClient, + zonesCache: &zonesCache[privatedns.PrivateZone]{duration: zonesCacheDuration}, recordSetsClient: recordSetsClient, }, nil } @@ -177,7 +180,10 @@ func (p *AzurePrivateDNSProvider) ApplyChanges(ctx context.Context, changes *pla func (p *AzurePrivateDNSProvider) zones(ctx context.Context) ([]privatedns.PrivateZone, error) { log.Debugf("Retrieving Azure Private DNS zones for Resource Group '%s'", p.resourceGroup) - + if !p.zonesCache.Expired() { + log.Debugf("Using cached Azure Private DNS zones for resource group: %s zone count: %d.", p.resourceGroup, len(p.zonesCache.Get())) + return p.zonesCache.Get(), nil + } var zones []privatedns.PrivateZone pager := p.zonesClient.NewListByResourceGroupPager(p.resourceGroup, &privatedns.PrivateZonesClientListByResourceGroupOptions{Top: nil}) @@ -198,7 +204,8 @@ func (p *AzurePrivateDNSProvider) zones(ctx context.Context) ([]privatedns.Priva } } - log.Debugf("Found %d Azure Private DNS zone(s).", len(zones)) + log.Debugf("Found %d Azure Private DNS zone(s). Updating zones cache", len(zones)) + p.zonesCache.Reset(zones) return zones, nil } diff --git a/provider/azure/azure_privatedns_test.go b/provider/azure/azure_privatedns_test.go index dea74c10b..bf6f617cb 100644 --- a/provider/azure/azure_privatedns_test.go +++ b/provider/azure/azure_privatedns_test.go @@ -238,6 +238,7 @@ func newAzurePrivateDNSProvider(domainFilter endpoint.DomainFilter, zoneNameFilt dryRun: dryRun, resourceGroup: resourceGroup, zonesClient: privateZonesClient, + zonesCache: &zonesCache[privatedns.PrivateZone]{duration: 0}, recordSetsClient: privateRecordsClient, } } diff --git a/provider/azure/azure_test.go b/provider/azure/azure_test.go index f2031d139..86e4fbf26 100644 --- a/provider/azure/azure_test.go +++ b/provider/azure/azure_test.go @@ -238,6 +238,7 @@ func newAzureProvider(domainFilter endpoint.DomainFilter, zoneNameFilter endpoin userAssignedIdentityClientID: userAssignedIdentityClientID, activeDirectoryAuthorityHost: activeDirectoryAuthorityHost, zonesClient: zonesClient, + zonesCache: &zonesCache[dns.Zone]{duration: 0}, recordSetsClient: recordsClient, } } diff --git a/provider/azure/cache.go b/provider/azure/cache.go new file mode 100644 index 000000000..5f3f0295f --- /dev/null +++ b/provider/azure/cache.go @@ -0,0 +1,46 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package azure + +import ( + "time" +) + +// zonesCache is a cache for Azure zones(private or public) +type zonesCache[T any] struct { + age time.Time + duration time.Duration + zones []T +} + +// Reset method to reset the zones and update the age +func (z *zonesCache[T]) Reset(zones []T) { + if z.duration > time.Duration(0) { + z.age = time.Now() + z.zones = zones + } +} + +// Get method to retrieve the cached zones +func (z *zonesCache[T]) Get() []T { + return z.zones +} + +// Expired method to check if the cache has expired based on duration or if zones are empty +func (z *zonesCache[T]) Expired() bool { + return len(z.zones) < 1 || time.Since(z.age) > z.duration +} diff --git a/provider/azure/cache_test.go b/provider/azure/cache_test.go new file mode 100644 index 000000000..f3df028c9 --- /dev/null +++ b/provider/azure/cache_test.go @@ -0,0 +1,78 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package azure + +import ( + "testing" + "time" + + dns "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" + "github.com/stretchr/testify/assert" +) + +func TestzonesCache(t *testing.T) { + now := time.Now() + zoneName := "example.com" + var testCases = map[string]struct { + z *zonesCache[dns.Zone] + expired bool + }{ + "inactive-zone-cache": { + &zonesCache[dns.Zone]{ + duration: 0 * time.Second, + }, + true, + }, + "empty-active-zone-cache": { + &zonesCache[dns.Zone]{ + duration: 30 * time.Second, + }, + true, + }, + "expired-zone-cache": { + &zonesCache[dns.Zone]{ + age: now.Add(-300 * time.Second), + duration: 30 * time.Second, + }, + true, + }, + "active-zone-cache": { + &zonesCache[dns.Zone]{ + zones: []dns.Zone{{ + Name: &zoneName, + }}, + duration: 30 * time.Second, + age: now, + }, + false, + }, + } + + for name, testCase := range testCases { + t.Run(name, func(t *testing.T) { + assert.Equal(t, testCase.expired, testCase.z.Expired()) + var resetZoneLength = 1 + if testCase.z.duration == 0 { + resetZoneLength = 0 + } + testCase.z.Reset([]dns.Zone{{ + Name: &zoneName, + }}) + assert.Len(t, testCase.z.Get(), resetZoneLength) + }) + } +} From f6bafb14e1cdfaf58fa71dc6c0ec7dc9ca4883c7 Mon Sep 17 00:00:00 2001 From: tanujd11 Date: Thu, 17 Oct 2024 01:48:38 +0530 Subject: [PATCH 67/82] addressed review comments Signed-off-by: tanujd11 --- provider/azure/cache.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/provider/azure/cache.go b/provider/azure/cache.go index 5f3f0295f..9cde58fe2 100644 --- a/provider/azure/cache.go +++ b/provider/azure/cache.go @@ -27,7 +27,8 @@ type zonesCache[T any] struct { zones []T } -// Reset method to reset the zones and update the age +// Reset method to reset the zones and update the age. This will be used to update the cache +// after making a new API call to get the zones. func (z *zonesCache[T]) Reset(zones []T) { if z.duration > time.Duration(0) { z.age = time.Now() @@ -35,12 +36,15 @@ func (z *zonesCache[T]) Reset(zones []T) { } } -// Get method to retrieve the cached zones +// Get method to retrieve the cached zones. If cache is not expired, this will be used +// instead of making a new API call to get the zones. func (z *zonesCache[T]) Get() []T { return z.zones } -// Expired method to check if the cache has expired based on duration or if zones are empty +// Expired method to check if the cache has expired based on duration or if zones are empty. +// If cache is expired, a new API call will be made to get the zones. If zones are empty, a new +// API call will be made to get the zones. This case comes in at the time of initialization. func (z *zonesCache[T]) Expired() bool { return len(z.zones) < 1 || time.Since(z.age) > z.duration } From 45e9ed9a3f0043eaa80aeb520faf74dd6be77ec1 Mon Sep 17 00:00:00 2001 From: Dennis Haney Date: Thu, 17 Oct 2024 08:25:40 +0200 Subject: [PATCH 68/82] feat: log when endpoint ignored due to ownerid not match --- plan/plan.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plan/plan.go b/plan/plan.go index d0ca7f96a..204d616d6 100644 --- a/plan/plan.go +++ b/plan/plan.go @@ -240,6 +240,10 @@ func (p *Plan) Calculate() *Plan { if ownersMatch { changes.Create = append(changes.Create, creates...) + } else { + for _, current := range row.current { + log.Debugf(`Skipping endpoint %v because owner id does not match for one or more items to create, found: "%s", required: "%s"`, current, current.Labels[OwnerLabelKey], p.OwnerID) + } } } } From 55839f5bcbfe1c75ec2c03369632a81dc0aa20a7 Mon Sep 17 00:00:00 2001 From: tanujd11 Date: Fri, 18 Oct 2024 11:59:36 +0530 Subject: [PATCH 69/82] addressed review comments Signed-off-by: tanujd11 --- docs/tutorials/azure-private-dns.md | 2 +- docs/tutorials/azure.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/azure-private-dns.md b/docs/tutorials/azure-private-dns.md index d59232b0e..4c50e11a5 100644 --- a/docs/tutorials/azure-private-dns.md +++ b/docs/tutorials/azure-private-dns.md @@ -100,7 +100,7 @@ $ az role assignment create --role "Private DNS Zone Contributor" --assignee Date: Fri, 18 Oct 2024 09:20:29 +0200 Subject: [PATCH 70/82] fix: missing namespace --- plan/plan.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plan/plan.go b/plan/plan.go index 204d616d6..c63ff7c15 100644 --- a/plan/plan.go +++ b/plan/plan.go @@ -242,7 +242,7 @@ func (p *Plan) Calculate() *Plan { changes.Create = append(changes.Create, creates...) } else { for _, current := range row.current { - log.Debugf(`Skipping endpoint %v because owner id does not match for one or more items to create, found: "%s", required: "%s"`, current, current.Labels[OwnerLabelKey], p.OwnerID) + log.Debugf(`Skipping endpoint %v because owner id does not match for one or more items to create, found: "%s", required: "%s"`, current, current.Labels[endpoint.OwnerLabelKey], p.OwnerID) } } } From 5008b9aa3bbe7fca2e9bea66f7286af4a3ceb7f9 Mon Sep 17 00:00:00 2001 From: Michael Shen Date: Tue, 3 Sep 2024 21:30:59 -0400 Subject: [PATCH 71/82] Add AWS_INSTANCE_IPV6 support to the AWS-SD provider Signed-off-by: Michael Shen --- provider/awssd/aws_sd.go | 29 ++++++++++---- provider/awssd/aws_sd_test.go | 73 ++++++++++++++++++++++++++++++++++- 2 files changed, 93 insertions(+), 9 deletions(-) diff --git a/provider/awssd/aws_sd.go b/provider/awssd/aws_sd.go index bd1ec496c..babe48593 100644 --- a/provider/awssd/aws_sd.go +++ b/provider/awssd/aws_sd.go @@ -41,6 +41,7 @@ const ( sdNamespaceTypePrivate = "private" sdInstanceAttrIPV4 = "AWS_INSTANCE_IPV4" + sdInstanceAttrIPV6 = "AWS_INSTANCE_IPV6" sdInstanceAttrCname = "AWS_INSTANCE_CNAME" sdInstanceAttrAlias = "AWS_ALIAS_DNS_NAME" ) @@ -186,10 +187,15 @@ func (p *AWSSDProvider) instancesToEndpoint(ns *sdtypes.NamespaceSummary, srv *s newEndpoint.RecordType = endpoint.RecordTypeCNAME newEndpoint.Targets = append(newEndpoint.Targets, inst.Attributes[sdInstanceAttrAlias]) - // IP-based target + // IPv4-based target } else if inst.Attributes[sdInstanceAttrIPV4] != "" { newEndpoint.RecordType = endpoint.RecordTypeA newEndpoint.Targets = append(newEndpoint.Targets, inst.Attributes[sdInstanceAttrIPV4]) + + // IPv6-based target + } else if inst.Attributes[sdInstanceAttrIPV6] != "" { + newEndpoint.RecordType = endpoint.RecordTypeAAAA + newEndpoint.Targets = append(newEndpoint.Targets, inst.Attributes[sdInstanceAttrIPV6]) } else { log.Warnf("Invalid instance \"%v\" found in service \"%v\"", inst, srv.Name) } @@ -485,15 +491,18 @@ func (p *AWSSDProvider) RegisterInstance(ctx context.Context, service *sdtypes.S attr := make(map[string]string) - if ep.RecordType == endpoint.RecordTypeCNAME { + switch ep.RecordType { + case endpoint.RecordTypeCNAME: if p.isAWSLoadBalancer(target) { attr[sdInstanceAttrAlias] = target } else { attr[sdInstanceAttrCname] = target } - } else if ep.RecordType == endpoint.RecordTypeA { + case endpoint.RecordTypeA: attr[sdInstanceAttrIPV4] = target - } else { + case endpoint.RecordTypeAAAA: + attr[sdInstanceAttrIPV6] = target + default: return fmt.Errorf("invalid endpoint type (%v)", ep) } @@ -597,16 +606,17 @@ func (p *AWSSDProvider) parseHostname(hostname string) (namespace string, servic // determine service routing policy based on endpoint type func (p *AWSSDProvider) routingPolicyFromEndpoint(ep *endpoint.Endpoint) sdtypes.RoutingPolicy { - if ep.RecordType == endpoint.RecordTypeA { + if ep.RecordType == endpoint.RecordTypeA || ep.RecordType == endpoint.RecordTypeAAAA { return sdtypes.RoutingPolicyMultivalue } return sdtypes.RoutingPolicyWeighted } -// determine service type (A, CNAME) from given endpoint +// determine service type (A, AAAA, CNAME) from given endpoint func (p *AWSSDProvider) serviceTypeFromEndpoint(ep *endpoint.Endpoint) sdtypes.RecordType { - if ep.RecordType == endpoint.RecordTypeCNAME { + switch ep.RecordType { + case endpoint.RecordTypeCNAME: // FIXME service type is derived from the first target only. Theoretically this may be problem. // But I don't see a scenario where one endpoint contains targets of different types. if p.isAWSLoadBalancer(ep.Targets[0]) { @@ -614,8 +624,11 @@ func (p *AWSSDProvider) serviceTypeFromEndpoint(ep *endpoint.Endpoint) sdtypes.R return sdtypes.RecordTypeA } return sdtypes.RecordTypeCname + case endpoint.RecordTypeAAAA: + return sdtypes.RecordTypeAaaa + default: + return sdtypes.RecordTypeA } - return sdtypes.RecordTypeA } // determine if a given hostname belongs to an AWS load balancer diff --git a/provider/awssd/aws_sd_test.go b/provider/awssd/aws_sd_test.go index 4481b0927..2600cd4b7 100644 --- a/provider/awssd/aws_sd_test.go +++ b/provider/awssd/aws_sd_test.go @@ -307,6 +307,19 @@ func TestAWSSDProvider_Records(t *testing.T) { }}, }, }, + "aaaa-srv": { + Id: aws.String("aaaa-srv"), + Name: aws.String("service4"), + Description: aws.String("owner-id"), + DnsConfig: &sdtypes.DnsConfig{ + NamespaceId: aws.String("private"), + RoutingPolicy: sdtypes.RoutingPolicyWeighted, + DnsRecords: []sdtypes.DnsRecord{{ + Type: sdtypes.RecordTypeAaaa, + TTL: aws.Int64(100), + }}, + }, + }, }, } @@ -341,12 +354,21 @@ func TestAWSSDProvider_Records(t *testing.T) { }, }, }, + "aaaa-srv": { + "0000:0000:0000:0000:abcd:abcd:abcd:abcd": { + Id: aws.String("0000:0000:0000:0000:abcd:abcd:abcd:abcd"), + Attributes: map[string]string{ + sdInstanceAttrIPV6: "0000:0000:0000:0000:abcd:abcd:abcd:abcd", + }, + }, + }, } expectedEndpoints := []*endpoint.Endpoint{ {DNSName: "service1.private.com", Targets: endpoint.Targets{"1.2.3.4", "1.2.3.5"}, RecordType: endpoint.RecordTypeA, RecordTTL: 100, Labels: map[string]string{endpoint.AWSSDDescriptionLabel: "owner-id"}}, {DNSName: "service2.private.com", Targets: endpoint.Targets{"load-balancer.us-east-1.elb.amazonaws.com"}, RecordType: endpoint.RecordTypeCNAME, RecordTTL: 100, Labels: map[string]string{endpoint.AWSSDDescriptionLabel: "owner-id"}}, {DNSName: "service3.private.com", Targets: endpoint.Targets{"cname.target.com"}, RecordType: endpoint.RecordTypeCNAME, RecordTTL: 80, Labels: map[string]string{endpoint.AWSSDDescriptionLabel: "owner-id"}}, + {DNSName: "service4.private.com", Targets: endpoint.Targets{"0000:0000:0000:0000:abcd:abcd:abcd:abcd"}, RecordType: endpoint.RecordTypeAAAA, RecordTTL: 100, Labels: map[string]string{endpoint.AWSSDDescriptionLabel: "owner-id"}}, } api := &AWSSDClientStub{ @@ -557,6 +579,28 @@ func TestAWSSDProvider_CreateService(t *testing.T) { NamespaceId: aws.String("private"), } + // AAAA type + provider.CreateService(context.Background(), aws.String("private"), aws.String("AAAA-srv"), &endpoint.Endpoint{ + Labels: map[string]string{ + endpoint.AWSSDDescriptionLabel: "AAAA-srv", + }, + RecordType: endpoint.RecordTypeAAAA, + RecordTTL: 60, + Targets: endpoint.Targets{"::1234:5678:"}, + }) + expectedServices["AAAA-srv"] = &sdtypes.Service{ + Name: aws.String("AAAA-srv"), + Description: aws.String("AAAA-srv"), + DnsConfig: &sdtypes.DnsConfig{ + RoutingPolicy: sdtypes.RoutingPolicyMultivalue, + DnsRecords: []sdtypes.DnsRecord{{ + Type: sdtypes.RecordTypeAaaa, + TTL: aws.Int64(60), + }}, + }, + NamespaceId: aws.String("private"), + } + // CNAME type provider.CreateService(context.Background(), aws.String("private"), aws.String("CNAME-srv"), &endpoint.Endpoint{ Labels: map[string]string{ @@ -768,6 +812,19 @@ func TestAWSSDProvider_RegisterInstance(t *testing.T) { }}, }, }, + "aaaa-srv": { + Id: aws.String("aaaa-srv"), + Name: aws.String("service4"), + Description: aws.String("owner-id"), + DnsConfig: &sdtypes.DnsConfig{ + NamespaceId: aws.String("private"), + RoutingPolicy: sdtypes.RoutingPolicyWeighted, + DnsRecords: []sdtypes.DnsRecord{{ + Type: sdtypes.RecordTypeAaaa, + TTL: aws.Int64(100), + }}, + }, + }, }, } @@ -781,7 +838,7 @@ func TestAWSSDProvider_RegisterInstance(t *testing.T) { expectedInstances := make(map[string]*sdtypes.Instance) - // IP-based instance + // IPv4-based instance provider.RegisterInstance(context.Background(), services["private"]["a-srv"], &endpoint.Endpoint{ RecordType: endpoint.RecordTypeA, DNSName: "service1.private.com.", @@ -849,6 +906,20 @@ func TestAWSSDProvider_RegisterInstance(t *testing.T) { }, } + // IPv6-based instance + provider.RegisterInstance(context.Background(), services["private"]["aaaa-srv"], &endpoint.Endpoint{ + RecordType: endpoint.RecordTypeAAAA, + DNSName: "service4.private.com.", + RecordTTL: 300, + Targets: endpoint.Targets{"0000:0000:0000:0000:abcd:abcd:abcd:abcd"}, + }) + expectedInstances["0000:0000:0000:0000:abcd:abcd:abcd:abcd"] = &sdtypes.Instance{ + Id: aws.String("0000:0000:0000:0000:abcd:abcd:abcd:abcd"), + Attributes: map[string]string{ + sdInstanceAttrIPV6: "0000:0000:0000:0000:abcd:abcd:abcd:abcd", + }, + } + // validate instances for _, srvInst := range api.instances { for id, inst := range srvInst { From 0b4c0e8ecdb702a04bfe491aa7d5f3e58529e105 Mon Sep 17 00:00:00 2001 From: Michael Shen Date: Mon, 21 Oct 2024 21:00:21 -0400 Subject: [PATCH 72/82] Add tutorial for AWS-SD AAAA record support Signed-off-by: Michael Shen --- docs/tutorials/aws-sd.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/tutorials/aws-sd.md b/docs/tutorials/aws-sd.md index c3e0e8814..5e6b753be 100644 --- a/docs/tutorials/aws-sd.md +++ b/docs/tutorials/aws-sd.md @@ -304,6 +304,32 @@ spec: This will set the TTL for the DNS record to 60 seconds. +## IPv6 Support + +If your Kubernetes cluster is configured with IPv6 support, such as an [EKS cluster with IPv6 support](https://docs.aws.amazon.com/eks/latest/userguide/deploy-ipv6-cluster.html), ExternalDNS can +also create AAAA DNS records. + +```yaml +apiVersion: v1 +kind: Service +metadata: + name: nginx + annotations: + external-dns.alpha.kubernetes.io/hostname: nginx.external-dns-test.my-org.com + external-dns.alpha.kubernetes.io/ttl: "60" +spec: + ipFamilies: + - "IPv6" + type: NodePort + ports: + - port: 80 + name: http + targetPort: 80 + selector: + app: nginx +``` + +:information_source: The AWS-SD provider does not currently support dualstack load balancers and will only create A records for these at this time. See the AWS provider and the [AWS Load Balancer Controller Tutorial](./aws-load-balancer-controller.md) for dualstack load balancer support. ## Clean up From ba16809071cb6f08889cbbe8e6efa9dc73cd24ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2024 03:35:30 +0000 Subject: [PATCH 73/82] chore(deps): bump the dev-dependencies group across 1 directory with 2 updates Bumps the dev-dependencies group with 2 updates in the / directory: [actions/checkout](https://github.com/actions/checkout) and [actions/setup-python](https://github.com/actions/setup-python). Updates `actions/checkout` from 4.2.1 to 4.2.2 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871...11bd71901bbe5b1630ceea73d27597364c9af683) Updates `actions/setup-python` from 5.2.0 to 5.3.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/f677139bbe7f9c59b41e40162b753c062f5d49a3...0b93645e9fea7318ecaed2b359559ac225c90a2b) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yaml | 2 +- .github/workflows/codeql-analysis.yaml | 2 +- .github/workflows/docs.yaml | 4 ++-- .github/workflows/json-yaml-validate.yml | 2 +- .github/workflows/lint-test-chart.yaml | 4 ++-- .github/workflows/lint.yaml | 2 +- .github/workflows/release-chart.yaml | 2 +- .github/workflows/staging-image-tester.yaml | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 03afbeafc..030ad5887 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,7 +21,7 @@ jobs: steps: - name: Check out code into the Go module directory - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Go 1.x uses: actions/setup-go@v5 diff --git a/.github/workflows/codeql-analysis.yaml b/.github/workflows/codeql-analysis.yaml index 53b28c411..9feb4f8e7 100644 --- a/.github/workflows/codeql-analysis.yaml +++ b/.github/workflows/codeql-analysis.yaml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Install go version uses: actions/setup-go@v5 with: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index ba1535181..f2e42b84e 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -15,11 +15,11 @@ jobs: name: Release Docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 - - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 with: python-version: "3.12" cache: "pip" diff --git a/.github/workflows/json-yaml-validate.yml b/.github/workflows/json-yaml-validate.yml index 87d40dd2d..5f9a49c96 100644 --- a/.github/workflows/json-yaml-validate.yml +++ b/.github/workflows/json-yaml-validate.yml @@ -14,7 +14,7 @@ jobs: json-yaml-validate: runs-on: ubuntu-latest steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: json-yaml-validate uses: GrantBirki/json-yaml-validate@v3.2.1 diff --git a/.github/workflows/lint-test-chart.yaml b/.github/workflows/lint-test-chart.yaml index 9c7d47deb..123681095 100644 --- a/.github/workflows/lint-test-chart.yaml +++ b/.github/workflows/lint-test-chart.yaml @@ -14,7 +14,7 @@ jobs: shell: bash steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 @@ -59,7 +59,7 @@ jobs: version: latest - name: Install Python - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 with: token: ${{ github.token }} python-version: "3.x" diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 7f4ef20bf..12a1cdbfa 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -22,7 +22,7 @@ jobs: steps: - name: Check out code into the Go module directory - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Go 1.x uses: actions/setup-go@v5 diff --git a/.github/workflows/release-chart.yaml b/.github/workflows/release-chart.yaml index db2fc7d29..a92cf8400 100644 --- a/.github/workflows/release-chart.yaml +++ b/.github/workflows/release-chart.yaml @@ -20,7 +20,7 @@ jobs: shell: bash steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 diff --git a/.github/workflows/staging-image-tester.yaml b/.github/workflows/staging-image-tester.yaml index 148620133..a6950195c 100644 --- a/.github/workflows/staging-image-tester.yaml +++ b/.github/workflows/staging-image-tester.yaml @@ -21,7 +21,7 @@ jobs: steps: - name: Check out code into the Go module directory - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Go 1.x uses: actions/setup-go@v5 From a89d0eed2dd522bcab0d588a8bc34ea23e52abdd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2024 03:48:20 +0000 Subject: [PATCH 74/82] chore(deps): bump the dev-dependencies group across 1 directory with 21 updates Bumps the dev-dependencies group with 20 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/Azure/azure-sdk-for-go/sdk/azcore](https://github.com/Azure/azure-sdk-for-go) | `1.14.0` | `1.16.0` | | [github.com/F5Networks/k8s-bigip-ctlr/v2](https://github.com/F5Networks/k8s-bigip-ctlr) | `2.18.0` | `2.18.1` | | [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) | `5.17.5` | `5.18.1` | | [github.com/Yamashou/gqlgenc](https://github.com/Yamashou/gqlgenc) | `0.25.2` | `0.25.3` | | [github.com/aliyun/alibaba-cloud-sdk-go](https://github.com/aliyun/alibaba-cloud-sdk-go) | `1.63.24` | `1.63.39` | | [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) | `1.27.43` | `1.28.0` | | [github.com/cloudflare/cloudflare-go](https://github.com/cloudflare/cloudflare-go) | `0.107.0` | `0.108.0` | | [github.com/digitalocean/godo](https://github.com/digitalocean/godo) | `1.126.0` | `1.128.0` | | [github.com/linode/linodego](https://github.com/linode/linodego) | `1.41.0` | `1.42.0` | | [github.com/oracle/oci-go-sdk/v65](https://github.com/oracle/oci-go-sdk) | `65.75.2` | `65.77.1` | | [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) | `1.20.4` | `1.20.5` | | [github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common](https://github.com/tencentcloud/tencentcloud-sdk-go) | `1.0.1016` | `1.0.1030` | | [github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod](https://github.com/tencentcloud/tencentcloud-sdk-go) | `1.0.1016` | `1.0.1030` | | [github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns](https://github.com/tencentcloud/tencentcloud-sdk-go) | `1.0.1016` | `1.0.1030` | | [google.golang.org/api](https://github.com/googleapis/google-api-go-client) | `0.199.0` | `0.203.0` | | gopkg.in/ns1/ns1-go.v2 | `2.12.1` | `2.12.2` | | [istio.io/api](https://github.com/istio/api) | `1.23.2` | `1.23.3` | | [istio.io/client-go](https://github.com/istio/client-go) | `1.23.2` | `1.23.3` | | [k8s.io/api](https://github.com/kubernetes/api) | `0.31.1` | `0.31.2` | | [k8s.io/client-go](https://github.com/kubernetes/client-go) | `0.31.1` | `0.31.2` | Updates `github.com/Azure/azure-sdk-for-go/sdk/azcore` from 1.14.0 to 1.16.0 - [Release notes](https://github.com/Azure/azure-sdk-for-go/releases) - [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md) - [Commits](https://github.com/Azure/azure-sdk-for-go/compare/sdk/azcore/v1.14.0...sdk/azcore/v1.16.0) Updates `github.com/F5Networks/k8s-bigip-ctlr/v2` from 2.18.0 to 2.18.1 - [Release notes](https://github.com/F5Networks/k8s-bigip-ctlr/releases) - [Changelog](https://github.com/F5Networks/k8s-bigip-ctlr/blob/v2.18.1/docs/RELEASE-NOTES.rst) - [Commits](https://github.com/F5Networks/k8s-bigip-ctlr/compare/v2.18.0...v2.18.1) Updates `github.com/IBM/go-sdk-core/v5` from 5.17.5 to 5.18.1 - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.17.5...v5.18.1) Updates `github.com/Yamashou/gqlgenc` from 0.25.2 to 0.25.3 - [Release notes](https://github.com/Yamashou/gqlgenc/releases) - [Commits](https://github.com/Yamashou/gqlgenc/compare/v0.25.2...v0.25.3) Updates `github.com/aliyun/alibaba-cloud-sdk-go` from 1.63.24 to 1.63.39 - [Release notes](https://github.com/aliyun/alibaba-cloud-sdk-go/releases) - [Changelog](https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/ChangeLog.txt) - [Commits](https://github.com/aliyun/alibaba-cloud-sdk-go/compare/v1.63.24...v1.63.39) Updates `github.com/aws/aws-sdk-go-v2/config` from 1.27.43 to 1.28.0 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.27.43...v1.28.0) Updates `github.com/cloudflare/cloudflare-go` from 0.107.0 to 0.108.0 - [Release notes](https://github.com/cloudflare/cloudflare-go/releases) - [Changelog](https://github.com/cloudflare/cloudflare-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/cloudflare/cloudflare-go/compare/v0.107.0...v0.108.0) Updates `github.com/digitalocean/godo` from 1.126.0 to 1.128.0 - [Release notes](https://github.com/digitalocean/godo/releases) - [Changelog](https://github.com/digitalocean/godo/blob/main/CHANGELOG.md) - [Commits](https://github.com/digitalocean/godo/compare/v1.126.0...v1.128.0) Updates `github.com/linode/linodego` from 1.41.0 to 1.42.0 - [Release notes](https://github.com/linode/linodego/releases) - [Commits](https://github.com/linode/linodego/compare/v1.41.0...v1.42.0) Updates `github.com/oracle/oci-go-sdk/v65` from 65.75.2 to 65.77.1 - [Release notes](https://github.com/oracle/oci-go-sdk/releases) - [Changelog](https://github.com/oracle/oci-go-sdk/blob/master/CHANGELOG.md) - [Commits](https://github.com/oracle/oci-go-sdk/compare/v65.75.2...v65.77.1) Updates `github.com/prometheus/client_golang` from 1.20.4 to 1.20.5 - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.20.4...v1.20.5) Updates `github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common` from 1.0.1016 to 1.0.1030 - [Commits](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.0.1016...v1.0.1030) Updates `github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod` from 1.0.1016 to 1.0.1030 - [Commits](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.0.1016...v1.0.1030) Updates `github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns` from 1.0.1016 to 1.0.1030 - [Commits](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.0.1016...v1.0.1030) Updates `google.golang.org/api` from 0.199.0 to 0.203.0 - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.199.0...v0.203.0) Updates `gopkg.in/ns1/ns1-go.v2` from 2.12.1 to 2.12.2 Updates `istio.io/api` from 1.23.2 to 1.23.3 - [Commits](https://github.com/istio/api/compare/1.23.2...1.23.3) Updates `istio.io/client-go` from 1.23.2 to 1.23.3 - [Commits](https://github.com/istio/client-go/compare/1.23.2...1.23.3) Updates `k8s.io/api` from 0.31.1 to 0.31.2 - [Commits](https://github.com/kubernetes/api/compare/v0.31.1...v0.31.2) Updates `k8s.io/apimachinery` from 0.31.1 to 0.31.2 - [Commits](https://github.com/kubernetes/apimachinery/compare/v0.31.1...v0.31.2) Updates `k8s.io/client-go` from 0.31.1 to 0.31.2 - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/kubernetes/client-go/compare/v0.31.1...v0.31.2) --- updated-dependencies: - dependency-name: github.com/Azure/azure-sdk-for-go/sdk/azcore dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/F5Networks/k8s-bigip-ctlr/v2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/Yamashou/gqlgenc dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aliyun/alibaba-cloud-sdk-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/cloudflare/cloudflare-go dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/digitalocean/godo dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/linode/linodego dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/oracle/oci-go-sdk/v65 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: google.golang.org/api dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: gopkg.in/ns1/ns1-go.v2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: istio.io/api dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: istio.io/client-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: k8s.io/api dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: k8s.io/apimachinery dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: k8s.io/client-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] --- go.mod | 52 ++++++++++++++--------------- go.sum | 104 ++++++++++++++++++++++++++++----------------------------- 2 files changed, 78 insertions(+), 78 deletions(-) diff --git a/go.mod b/go.mod index 1308b4b95..8d47ae042 100644 --- a/go.mod +++ b/go.mod @@ -4,20 +4,20 @@ go 1.23 require ( cloud.google.com/go/compute/metadata v0.5.2 - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.3.0 - github.com/F5Networks/k8s-bigip-ctlr/v2 v2.18.0 + github.com/F5Networks/k8s-bigip-ctlr/v2 v2.18.1 github.com/IBM-Cloud/ibm-cloud-cli-sdk v1.5.0 - github.com/IBM/go-sdk-core/v5 v5.17.5 + github.com/IBM/go-sdk-core/v5 v5.18.1 github.com/IBM/networking-go-sdk v0.49.0 - github.com/Yamashou/gqlgenc v0.25.2 + github.com/Yamashou/gqlgenc v0.25.3 github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2 github.com/alecthomas/kingpin/v2 v2.4.0 - github.com/aliyun/alibaba-cloud-sdk-go v1.63.24 + github.com/aliyun/alibaba-cloud-sdk-go v1.63.39 github.com/aws/aws-sdk-go-v2 v1.32.2 - github.com/aws/aws-sdk-go-v2/config v1.27.43 + github.com/aws/aws-sdk-go-v2/config v1.28.0 github.com/aws/aws-sdk-go-v2/credentials v1.17.41 github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.12 github.com/aws/aws-sdk-go-v2/service/dynamodb v1.36.2 @@ -27,11 +27,11 @@ require ( github.com/bodgit/tsig v1.2.2 github.com/cenkalti/backoff/v4 v4.3.0 github.com/civo/civogo v0.3.84 - github.com/cloudflare/cloudflare-go v0.107.0 + github.com/cloudflare/cloudflare-go v0.108.0 github.com/cloudfoundry-community/go-cfclient v0.0.0-20190201205600-f136f9222381 github.com/datawire/ambassador v1.12.4 github.com/denverdino/aliyungo v0.0.0-20230411124812-ab98a9173ace - github.com/digitalocean/godo v1.126.0 + github.com/digitalocean/godo v1.128.0 github.com/dnsimple/dnsimple-go v1.7.0 github.com/exoscale/egoscale v0.102.3 github.com/ffledgling/pdns-go v0.0.0-20180219074714-524e7daccd99 @@ -41,25 +41,25 @@ require ( github.com/google/uuid v1.6.0 github.com/gophercloud/gophercloud v1.14.1 github.com/linki/instrumented_http v0.3.0 - github.com/linode/linodego v1.41.0 + github.com/linode/linodego v1.42.0 github.com/maxatome/go-testdeep v1.14.0 github.com/miekg/dns v1.1.62 github.com/onsi/ginkgo v1.16.5 github.com/openshift/api v0.0.0-20230607130528-611114dca681 github.com/openshift/client-go v0.0.0-20230607134213-3cd0021bbee3 - github.com/oracle/oci-go-sdk/v65 v65.75.2 + github.com/oracle/oci-go-sdk/v65 v65.77.1 github.com/ovh/go-ovh v1.6.0 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pkg/errors v0.9.1 github.com/pluralsh/gqlclient v1.12.2 github.com/projectcontour/contour v1.30.0 - github.com/prometheus/client_golang v1.20.4 + github.com/prometheus/client_golang v1.20.5 github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.9.0 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1016 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1016 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1016 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1030 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1030 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1030 github.com/transip/gotransip/v6 v6.26.0 github.com/ultradns/ultradns-sdk-go v1.3.7 go.etcd.io/etcd/client/v3 v3.5.16 @@ -68,20 +68,20 @@ require ( golang.org/x/oauth2 v0.23.0 golang.org/x/sync v0.8.0 golang.org/x/time v0.7.0 - google.golang.org/api v0.199.0 - gopkg.in/ns1/ns1-go.v2 v2.12.1 + google.golang.org/api v0.203.0 + gopkg.in/ns1/ns1-go.v2 v2.12.2 gopkg.in/yaml.v2 v2.4.0 - istio.io/api v1.23.2 - istio.io/client-go v1.23.2 - k8s.io/api v0.31.1 - k8s.io/apimachinery v0.31.1 - k8s.io/client-go v0.31.1 + istio.io/api v1.23.3 + istio.io/client-go v1.23.3 + k8s.io/api v0.31.2 + k8s.io/apimachinery v0.31.2 + k8s.io/client-go v0.31.2 k8s.io/klog/v2 v2.130.1 sigs.k8s.io/gateway-api v1.2.0 ) require ( - cloud.google.com/go/auth v0.9.5 // indirect + cloud.google.com/go/auth v0.9.9 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect code.cloudfoundry.org/gofileutils v0.0.0-20170111115228-4d0c80011a0f // indirect github.com/99designs/gqlgen v0.17.54 // indirect @@ -204,10 +204,10 @@ require ( golang.org/x/term v0.25.0 // indirect golang.org/x/text v0.19.0 // indirect golang.org/x/tools v0.24.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/grpc v1.67.0 // indirect - google.golang.org/protobuf v1.34.2 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect + google.golang.org/grpc v1.67.1 // indirect + google.golang.org/protobuf v1.35.1 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index c79656afa..8f98a0aba 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxo cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go/auth v0.9.5 h1:4CTn43Eynw40aFVr3GpPqsQponx2jv0BQpjvajsbbzw= -cloud.google.com/go/auth v0.9.5/go.mod h1:Xo0n7n66eHyOWWCnitop6870Ilwo3PiZyodVkkH1xWM= +cloud.google.com/go/auth v0.9.9 h1:BmtbpNQozo8ZwW2t7QJjnrQtdganSdmqeIBxHxNkEZQ= +cloud.google.com/go/auth v0.9.9/go.mod h1:xxA5AqpDrvS+Gkmo9RqrGGRh6WSNKKOXhY3zNOr38tI= cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo= @@ -16,8 +16,8 @@ github.com/99designs/gqlgen v0.17.54 h1:AsF49k/7RJlwA00RQYsYN0T8cQuaosnV/7G1dHC3 github.com/99designs/gqlgen v0.17.54/go.mod h1:77/+pVe6zlTsz++oUg2m8VLgzdUPHxjoAG3BxI5y8Rc= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible h1:KnPIugL51v3N3WwvaSmZbxukD1WuWXOiE9fRdu32f2I= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 h1:JZg6HRh6W6U4OLl6lk7BZ7BLisIzM9dG1R50zUk9C/M= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0/go.mod h1:YL1xnZ6QejvQHWJrX/AvhFl4WW4rqHVoKspWNVwFk0M= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 h1:B/dfvscEQtew9dVuoxqxrUKKv8Ih2f55PydknDamU+g= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0/go.mod h1:fiPSssYvltE08HJchL04dOy+RD4hgrjph0cwGGMntdI= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0 h1:+m0M/LFxN43KvULkDNfdXOgrjtg6UYJPFBJyuEcRCAw= @@ -48,13 +48,13 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/F5Networks/k8s-bigip-ctlr/v2 v2.18.0 h1:soCQ+QIHHVk/WFQPOfS2moxtFqLHIQuFJlf1U9773aM= -github.com/F5Networks/k8s-bigip-ctlr/v2 v2.18.0/go.mod h1:m2bDK0Bb/KdhazvWWsQeQFw7R4QpHxX4U/cefZFBtHs= +github.com/F5Networks/k8s-bigip-ctlr/v2 v2.18.1 h1:2JJzYLLONOJR73uudihkDh2ks8jL8/h6AhO7cbYpdIo= +github.com/F5Networks/k8s-bigip-ctlr/v2 v2.18.1/go.mod h1:NZ7znr7KT1/0+MFPA9MHBsa4e0YhVz65ZCioi/m5KiE= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/IBM-Cloud/ibm-cloud-cli-sdk v1.5.0 h1:+a994rHmNFwlSA609Z6SYhn9xt+lhGFF+dsgjMF75hY= github.com/IBM-Cloud/ibm-cloud-cli-sdk v1.5.0/go.mod h1:XxWyb5MQDU4GnRBSDZpGgIFwfbcn+GAUbPKS8CR8Bxc= -github.com/IBM/go-sdk-core/v5 v5.17.5 h1:AjGC7xNee5tgDIjndekBDW5AbypdERHSgib3EZ1KNsA= -github.com/IBM/go-sdk-core/v5 v5.17.5/go.mod h1:KsAAI7eStAWwQa4F96MLy+whYSh39JzNjklZRbN/8ns= +github.com/IBM/go-sdk-core/v5 v5.18.1 h1:wdftQO8xejECTWTKF3FGXyW0McKxxDAopH7MKwA187c= +github.com/IBM/go-sdk-core/v5 v5.18.1/go.mod h1:3ywpylZ41WhWPusqtpJZWopYlt2brebcphV7mA2JncU= github.com/IBM/networking-go-sdk v0.49.0 h1:lPS34u3C0JVrbxH+Ulua76Nwl6Frv8BEfq6LRkyvOv0= github.com/IBM/networking-go-sdk v0.49.0/go.mod h1:G9CKbmPE8gSLjN+ABh4hIZ1bMx076enl5Eekvj6zQnA= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= @@ -81,8 +81,8 @@ github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:H github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/Yamashou/gqlgenc v0.25.2 h1:4VoeXuI/8M7njUYiOsTSkkEit13rXWOjoK39AG31jPo= -github.com/Yamashou/gqlgenc v0.25.2/go.mod h1:G0g1N81xpIklVdnyboW1zwOHcj/n4hNfhTwfN29Rjig= +github.com/Yamashou/gqlgenc v0.25.3 h1:mVV8/Ho8EDZUQKQZbQqqXGNq8jc8aQfPpHhZOnTkMNE= +github.com/Yamashou/gqlgenc v0.25.3/go.mod h1:G0g1N81xpIklVdnyboW1zwOHcj/n4hNfhTwfN29Rjig= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -98,8 +98,8 @@ github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAu github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 h1:P5U+E4x5OkVEKQDklVPmzs71WM56RTTRqV4OrDC//Y4= github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5/go.mod h1:976q2ETgjT2snVCf2ZaBnyBbVoPERGjUz+0sofzEfro= -github.com/aliyun/alibaba-cloud-sdk-go v1.63.24 h1:2MRgfP+VtLeJJNKyQ0xyMzQaepvOfmdNf3op6hbBrWA= -github.com/aliyun/alibaba-cloud-sdk-go v1.63.24/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ= +github.com/aliyun/alibaba-cloud-sdk-go v1.63.39 h1:zlenrBGDiSEu7YnpWiAPscKNolgIo9Z6jvM5pcWAEL4= +github.com/aliyun/alibaba-cloud-sdk-go v1.63.39/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6/go.mod h1:+lx6/Aqd1kLJ1GQfkvOnaZ1WGmLpMpbprPuIOOZX30U= @@ -123,8 +123,8 @@ github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.32.2 h1:AkNLZEyYMLnx/Q/mSKkcMqwNFXMAvFto9bNsHqcTduI= github.com/aws/aws-sdk-go-v2 v1.32.2/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo= -github.com/aws/aws-sdk-go-v2/config v1.27.43 h1:p33fDDihFC390dhhuv8nOmX419wjOSDQRb+USt20RrU= -github.com/aws/aws-sdk-go-v2/config v1.27.43/go.mod h1:pYhbtvg1siOOg8h5an77rXle9tVG8T+BWLWAo7cOukc= +github.com/aws/aws-sdk-go-v2/config v1.28.0 h1:FosVYWcqEtWNxHn8gB/Vs6jOlNwSoyOCA/g/sxyySOQ= +github.com/aws/aws-sdk-go-v2/config v1.28.0/go.mod h1:pYhbtvg1siOOg8h5an77rXle9tVG8T+BWLWAo7cOukc= github.com/aws/aws-sdk-go-v2/credentials v1.17.41 h1:7gXo+Axmp+R4Z+AK8YFQO0ZV3L0gizGINCOWxSLY9W8= github.com/aws/aws-sdk-go-v2/credentials v1.17.41/go.mod h1:u4Eb8d3394YLubphT4jLEwN1rLNq2wFOlT6OuxFwPzU= github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.12 h1:zYf8E8zaqolHA5nQ+VmX2r3wc4K6xw5i6xKvvMjZBL0= @@ -191,8 +191,8 @@ github.com/civo/civogo v0.3.84 h1:jf5IT7VJFPaReO6g8B0zqKhsYCIizaGo4PjDLY7Sl6Y= github.com/civo/civogo v0.3.84/go.mod h1:7UCYX+qeeJbrG55E1huv+0ySxcHTqq/26FcHLVelQJM= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.107.0 h1:cMDIw2tzt6TXCJyMFVyP+BPOVkIfMvcKjhMNSNvuEPc= -github.com/cloudflare/cloudflare-go v0.107.0/go.mod h1:5cYGzVBqNTLxMYSLdVjuSs5LJL517wJDSvMPWUrzHzc= +github.com/cloudflare/cloudflare-go v0.108.0 h1:C4Skfjd8I8X3uEOGmQUT4/iGyZcWdkIU7HwvMoLkEE0= +github.com/cloudflare/cloudflare-go v0.108.0/go.mod h1:m492eNahT/9MsN7Ppnoge8AaI7QhVFtEgVm3I9HJFeU= github.com/cloudfoundry-community/go-cfclient v0.0.0-20190201205600-f136f9222381 h1:rdRS5BT13Iae9ssvcslol66gfOOXjaLYwqerEn/cl9s= github.com/cloudfoundry-community/go-cfclient v0.0.0-20190201205600-f136f9222381/go.mod h1:e5+USP2j8Le2M0Jo3qKPFnNhuo1wueU4nWHCXBOfQ14= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -257,8 +257,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/digitalocean/godo v1.126.0 h1:+Znh7VMQj/E8ArbjWnc7OKGjWfzC+I8OCSRp7r1MdD8= -github.com/digitalocean/godo v1.126.0/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc= +github.com/digitalocean/godo v1.128.0 h1:cGn/ibMSRZ9+8etbzMv2MnnCEPTTGlEnx3HHTPwdk1U= +github.com/digitalocean/godo v1.128.0/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnsimple/dnsimple-go v1.7.0 h1:JKu9xJtZ3SqOC+BuYgAWeab7+EEx0sz422vu8j611ZY= github.com/dnsimple/dnsimple-go v1.7.0/go.mod h1:EKpuihlWizqYafSnQHGCd/gyvy3HkEQJ7ODB4KdV8T8= @@ -712,8 +712,8 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linki/instrumented_http v0.3.0 h1:dsN92+mXpfZtjJraartcQ99jnuw7fqsnPDjr85ma2dA= github.com/linki/instrumented_http v0.3.0/go.mod h1:pjYbItoegfuVi2GUOMhEqzvm/SJKuEL3H0tc8QRLRFk= -github.com/linode/linodego v1.41.0 h1:GcP7JIBr9iLRJ9FwAtb9/WCT1DuPJS/xUApapfdjtiY= -github.com/linode/linodego v1.41.0/go.mod h1:Ow4/XZ0yvWBzt3iAHwchvhSx30AyLintsSMvvQ2/SJY= +github.com/linode/linodego v1.42.0 h1:ZSbi4MtvwrfB9Y6bknesorvvueBGGilcmh2D5dq76RM= +github.com/linode/linodego v1.42.0/go.mod h1:2yzmY6pegPBDgx2HDllmt0eIk2IlzqcgK6NR0wFCFRY= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/lyft/protoc-gen-star v0.4.10/go.mod h1:mE8fbna26u7aEA2QCVvvfBU/ZrPgocG1206xAFPcs94= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= @@ -857,8 +857,8 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/oracle/oci-go-sdk/v65 v65.75.2 h1:Qw3Eotrq7SJ5LquOc//Iq6xzcBJSi8AD3cXps9IBN7g= -github.com/oracle/oci-go-sdk/v65 v65.75.2/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= +github.com/oracle/oci-go-sdk/v65 v65.77.1 h1:gqjTXIUWvTihkn470AclxSAMcR1JecqjD2IUtp+sDIU= +github.com/oracle/oci-go-sdk/v65 v65.77.1/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= github.com/ovh/go-ovh v1.6.0 h1:ixLOwxQdzYDx296sXcgS35TOPEahJkpjMGtzPadCjQI= github.com/ovh/go-ovh v1.6.0/go.mod h1:cTVDnl94z4tl8pP1uZ/8jlVxntjSIf09bNcQ5TJSC7c= github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2 h1:CXwSGu/LYmbjEab5aMCs5usQRVBGThelUKBNnoSOuso= @@ -902,8 +902,8 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.6.0/go.mod h1:ZLOG9ck3JLRdB5MgO8f+lLTe83AXG6ro35rLTxvnIl4= -github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= -github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -1027,12 +1027,12 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1016 h1:gFA+fJStsfNwOAfVrgpjej4iq1A/YdWW4GB2D6B8fGk= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1016/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1016 h1:13JvFBl1E/FCt4QxwIcjJrtB1jQsUw+WE1vIJACzLI0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1016/go.mod h1:jAMI0j0Q9nR0OMZPiYC7IvAJyojgoP20pvR75N0gwt0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1016 h1:o/19+o8J/gVKsVRanCRBu89RK38jlk1pUIMo6p0pF74= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1016/go.mod h1:cKLgDpmDAMU435/Xq6NdJf5QLRQ6jPq8EOe9LHiJySo= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1030 h1:kwiUoCkooUgy7iPyhEEbio7WT21kGJUeZ5JeJfb/dYk= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1030/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1030 h1:U1n/Jr0rpKctFrTOsONkZlkbQeNiLqDbi5+MS7fGMO4= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1030/go.mod h1:erWu7r8lbWSjjVuWOlLFziOEY0K674qAOWHVSvdSvrY= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1030 h1:reuw5wChMq2nXPYrRDrU7XRXU3kDvXh87kk8GMa80no= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.1030/go.mod h1:gPK/7DZzJ0CKMT3Fg8de70rkvg/ClcUUOMvfAkPVZ88= github.com/terra-farm/udnssdk v1.3.5 h1:MNR3adfuuEK/l04+jzo8WW/0fnorY+nW515qb3vEr6I= github.com/terra-farm/udnssdk v1.3.5/go.mod h1:8RnM56yZTR7mYyUIvrDgXzdRaEyFIzqdEi7+um26Sv8= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -1386,8 +1386,8 @@ gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZ google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.199.0 h1:aWUXClp+VFJmqE0JPvpZOK3LDQMyFKYIow4etYd9qxs= -google.golang.org/api v0.199.0/go.mod h1:ohG4qSztDJmZdjK/Ar6MhbAmb/Rpi4JHOqagsh90K28= +google.golang.org/api v0.203.0 h1:SrEeuwU3S11Wlscsn+LA1kb/Y5xT8uggJSkIhD08NAU= +google.golang.org/api v0.203.0/go.mod h1:BuOVyCSYEPwJb3npWvDnNmFI92f3GeRnHNkETneT3SI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1402,10 +1402,10 @@ google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dT google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed h1:3RgNmBoI9MZhsj3QxC+AP/qQhNwpCLOvYDYYsFrhFt0= -google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 h1:T6rh4haD3GVYsgEfWExoCZA2o2FmbNyKpTuAxbEFPTg= +google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:wp2WsuBYj6j8wUdo3ToZsdxxixbvQNAHqVJrTgi5E5M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1420,8 +1420,8 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw= -google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1434,8 +1434,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1462,8 +1462,8 @@ gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/ns1/ns1-go.v2 v2.12.1 h1:GiiZPB8JusUF/ruyUDzddd70b3HZGa5A3njtKUe84jA= -gopkg.in/ns1/ns1-go.v2 v2.12.1/go.mod h1:pfaU0vECVP7DIOr453z03HXS6dFJpXdNRwOyRzwmPSc= +gopkg.in/ns1/ns1-go.v2 v2.12.2 h1:SPM5BTTMJ1zVBhMMiiPFdF7l6Y3fq5o7bKM7jDqsUfM= +gopkg.in/ns1/ns1-go.v2 v2.12.2/go.mod h1:pfaU0vECVP7DIOr453z03HXS6dFJpXdNRwOyRzwmPSc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= @@ -1491,23 +1491,23 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -istio.io/api v1.23.2 h1:FvWi7GC+rWD60/ZFPuulX/h3k+f2Q9qot3dP8CIL8Ss= -istio.io/api v1.23.2/go.mod h1:QPSTGXuIQdnZFEm3myf9NZ5uBMwCdJWUvfj9ZZ+2oBM= -istio.io/client-go v1.23.2 h1:BIt6A+KaUOFin3SzXiDq2Fr/TMBev1+c836R0BfUfhU= -istio.io/client-go v1.23.2/go.mod h1:E08wpMtUulJk2tlWOCUVakjy1bKFxUNm22tM1R1QY0Y= +istio.io/api v1.23.3 h1:+CP0AHz8/+WJ7ZKJLbilHEiqBCi5KLe1Yil9bJI39ow= +istio.io/api v1.23.3/go.mod h1:QPSTGXuIQdnZFEm3myf9NZ5uBMwCdJWUvfj9ZZ+2oBM= +istio.io/client-go v1.23.3 h1:rs+mO4A+NaXVcZgDO0RRZE7KRAlDooq2PSkxl7tevig= +istio.io/client-go v1.23.3/go.mod h1:Lfa3anzx7/kCOpcAciR+JiRMj/SYuzDcbXQDjkThnLg= k8s.io/api v0.18.0/go.mod h1:q2HRQkfDzHMBZL9l/y9rH63PkQl4vae0xRT+8prbrK8= k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= k8s.io/api v0.18.4/go.mod h1:lOIQAKYgai1+vz9J7YcDZwC26Z0zQewYOGWdyIPUUQ4= -k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU= -k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI= +k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0= +k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk= k8s.io/apiextensions-apiserver v0.18.0/go.mod h1:18Cwn1Xws4xnWQNC00FLq1E350b9lUF+aOdIWDOZxgo= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.18.4/go.mod h1:NYeyeYq4SIpFlPxSAB6jHPIdvu3hL0pc36wuRChybio= k8s.io/apimachinery v0.18.0/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= k8s.io/apimachinery v0.18.4/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= -k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= -k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= +k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/apiserver v0.18.0/go.mod h1:3S2O6FeBBd6XTo0njUrLxiqk8GNy6wWOftjhJcXYnjw= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.18.4/go.mod h1:q+zoFct5ABNnYkGIaGQ3bcbUNdmPyOCoEBcg51LChY8= @@ -1516,8 +1516,8 @@ k8s.io/cli-runtime v0.18.4/go.mod h1:9/hS/Cuf7NVzWR5F/5tyS6xsnclxoPLVtwhnkJG1Y4g k8s.io/client-go v0.18.0/go.mod h1:uQSYDYs4WhVZ9i6AIoEZuwUggLVEF64HOD37boKAtF8= k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= k8s.io/client-go v0.18.4/go.mod h1:f5sXwL4yAZRkAtzOxRWUhA/N8XzGCb+nPZI8PfobZ9g= -k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0= -k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg= +k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc= +k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs= k8s.io/code-generator v0.18.0/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.4/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= From 02f9ec5bd0159f7728f22f3f8eb713d71ef8c12a Mon Sep 17 00:00:00 2001 From: Raffaele Di Fazio Date: Sat, 26 Oct 2024 09:55:21 +0200 Subject: [PATCH 75/82] fix flaky aws sd test Signed-off-by: Raffaele Di Fazio --- provider/awssd/aws_sd_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider/awssd/aws_sd_test.go b/provider/awssd/aws_sd_test.go index 2600cd4b7..38cc0711b 100644 --- a/provider/awssd/aws_sd_test.go +++ b/provider/awssd/aws_sd_test.go @@ -1004,6 +1004,6 @@ func TestAWSSDProvider_awsTags(t *testing.T) { } for _, test := range tests { - assert.EqualValues(t, test.Expectation, awsTags(test.Input)) + require.ElementsMatch(t, test.Expectation, awsTags(test.Input)) } } From 98cef7c2f190a50403f92116231417d2aba3fa8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Tue, 29 Oct 2024 15:42:26 +0100 Subject: [PATCH 76/82] Update charts/external-dns/templates/deployment.yaml Co-authored-by: Steve Hipwell --- charts/external-dns/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/external-dns/templates/deployment.yaml b/charts/external-dns/templates/deployment.yaml index e8abbbeb7..8a097c338 100644 --- a/charts/external-dns/templates/deployment.yaml +++ b/charts/external-dns/templates/deployment.yaml @@ -40,7 +40,7 @@ spec: {{- if not (quote .Values.automountServiceAccountToken | empty) }} automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} {{- end }} - {{- with (.Values.global.imagePullSecrets | default .Values.imagePullSecrets) }} + {{- with (default .Values.global.imagePullSecrets .Values.imagePullSecrets) }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} From b91729faf9b8031f9dadc8aaa8e44129c8e7a900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Tue, 29 Oct 2024 16:15:48 +0100 Subject: [PATCH 77/82] [helm] Add global to json schema --- charts/external-dns/values.schema.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/external-dns/values.schema.json b/charts/external-dns/values.schema.json index 614deeaca..80378c724 100644 --- a/charts/external-dns/values.schema.json +++ b/charts/external-dns/values.schema.json @@ -2,6 +2,9 @@ "$schema": "http://json-schema.org/draft-07/schema", "type": "object", "properties": { + "global": { + "type": "object" + }, "provider": { "anyOf": [ { From e77e697f6d92b96b081681496480bf9d2c12fe30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Tue, 29 Oct 2024 16:53:46 +0100 Subject: [PATCH 78/82] [helm] Add docs and changelog --- charts/external-dns/CHANGELOG.md | 4 ++++ charts/external-dns/README.md | 1 + 2 files changed, 5 insertions(+) diff --git a/charts/external-dns/CHANGELOG.md b/charts/external-dns/CHANGELOG.md index 02b467e1d..19863f493 100644 --- a/charts/external-dns/CHANGELOG.md +++ b/charts/external-dns/CHANGELOG.md @@ -18,6 +18,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [UNRELEASED] +### Added + +- Ability to configure `imagePullSecrets` via helm `global` value ([#4667](https://github.com/kubernetes-sigs/external-dns/pull/4667)) _@jkroepke_ + ## [v1.15.0] - 2023-09-10 ### Changed diff --git a/charts/external-dns/README.md b/charts/external-dns/README.md index 9b21ecdec..fd0d4e29b 100644 --- a/charts/external-dns/README.md +++ b/charts/external-dns/README.md @@ -105,6 +105,7 @@ If `namespaced` is set to `true`, please ensure that `sources` my only contains | extraVolumeMounts | list | `[]` | Extra [volume mounts](https://kubernetes.io/docs/concepts/storage/volumes/) for the `external-dns` container. | | extraVolumes | list | `[]` | Extra [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) for the `Pod`. | | fullnameOverride | string | `nil` | Override the full name of the chart. | +| global.imagePullSecrets | list | `[]` | Global image pull secrets. | | image.pullPolicy | string | `"IfNotPresent"` | Image pull policy for the `external-dns` container. | | image.repository | string | `"registry.k8s.io/external-dns/external-dns"` | Image repository for the `external-dns` container. | | image.tag | string | `nil` | Image tag for the `external-dns` container, this will default to `.Chart.AppVersion` if not set. | From 5888e85493561ccdfd37dab982f358a552f7ae36 Mon Sep 17 00:00:00 2001 From: Dennis Haney Date: Wed, 30 Oct 2024 18:37:42 +0700 Subject: [PATCH 79/82] Update plan/plan.go Co-authored-by: Raffaele Di Fazio --- plan/plan.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plan/plan.go b/plan/plan.go index c63ff7c15..4488c9e2f 100644 --- a/plan/plan.go +++ b/plan/plan.go @@ -241,9 +241,11 @@ func (p *Plan) Calculate() *Plan { if ownersMatch { changes.Create = append(changes.Create, creates...) } else { - for _, current := range row.current { - log.Debugf(`Skipping endpoint %v because owner id does not match for one or more items to create, found: "%s", required: "%s"`, current, current.Labels[endpoint.OwnerLabelKey], p.OwnerID) - } +if log.GetLevel() == log.DebugLevel { + for _, current := range row.current { + log.Debugf(`Skipping endpoint %v because owner id does not match for one or more items to create, found: "%s", required: "%s"`, current, current.Labels[endpoint.OwnerLabelKey], p.OwnerID) + } +} } } } From 4238316c473c66ca98296cb38c7847e5bb12851f Mon Sep 17 00:00:00 2001 From: Dennis Haney Date: Wed, 30 Oct 2024 19:45:28 +0700 Subject: [PATCH 80/82] fix: indentation --- plan/plan.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plan/plan.go b/plan/plan.go index 4488c9e2f..bd0ec209e 100644 --- a/plan/plan.go +++ b/plan/plan.go @@ -241,11 +241,11 @@ func (p *Plan) Calculate() *Plan { if ownersMatch { changes.Create = append(changes.Create, creates...) } else { -if log.GetLevel() == log.DebugLevel { - for _, current := range row.current { - log.Debugf(`Skipping endpoint %v because owner id does not match for one or more items to create, found: "%s", required: "%s"`, current, current.Labels[endpoint.OwnerLabelKey], p.OwnerID) - } -} + if log.GetLevel() == log.DebugLevel { + for _, current := range row.current { + log.Debugf(`Skipping endpoint %v because owner id does not match for one or more items to create, found: "%s", required: "%s"`, current, current.Labels[endpoint.OwnerLabelKey], p.OwnerID) + } + } } } } From 2c19f59cf507a011cdb5d37646c412b6a3627cd7 Mon Sep 17 00:00:00 2001 From: Dennis Haney Date: Wed, 30 Oct 2024 19:52:03 +0700 Subject: [PATCH 81/82] fix: lint --- plan/plan.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plan/plan.go b/plan/plan.go index bd0ec209e..6124b7640 100644 --- a/plan/plan.go +++ b/plan/plan.go @@ -240,11 +240,9 @@ func (p *Plan) Calculate() *Plan { if ownersMatch { changes.Create = append(changes.Create, creates...) - } else { - if log.GetLevel() == log.DebugLevel { - for _, current := range row.current { - log.Debugf(`Skipping endpoint %v because owner id does not match for one or more items to create, found: "%s", required: "%s"`, current, current.Labels[endpoint.OwnerLabelKey], p.OwnerID) - } + } else if log.GetLevel() == log.DebugLevel { + for _, current := range row.current { + log.Debugf(`Skipping endpoint %v because owner id does not match for one or more items to create, found: "%s", required: "%s"`, current, current.Labels[endpoint.OwnerLabelKey], p.OwnerID) } } } From 95d7a59941b6570b0cb9394424ebb5bb48aea2bf Mon Sep 17 00:00:00 2001 From: Andrew Hay <39sumer3939@gmail.com> Date: Wed, 30 Oct 2024 15:08:10 +0000 Subject: [PATCH 82/82] fix: change function name to properly reflect crud --- provider/cloudflare/cloudflare.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/provider/cloudflare/cloudflare.go b/provider/cloudflare/cloudflare.go index c693ddd72..760192804 100644 --- a/provider/cloudflare/cloudflare.go +++ b/provider/cloudflare/cloudflare.go @@ -139,8 +139,8 @@ type RecordParamsTypes interface { cloudflare.UpdateDNSRecordParams | cloudflare.CreateDNSRecordParams } -// getUpdateDNSRecordParam is a function that returns the appropriate Record Param based on the cloudFlareChange passed in -func getUpdateDNSRecordParam(cfc cloudFlareChange) cloudflare.UpdateDNSRecordParams { +// updateDNSRecordParam is a function that returns the appropriate Record Param based on the cloudFlareChange passed in +func updateDNSRecordParam(cfc cloudFlareChange) cloudflare.UpdateDNSRecordParams { return cloudflare.UpdateDNSRecordParams{ Name: cfc.ResourceRecord.Name, TTL: cfc.ResourceRecord.TTL, @@ -350,7 +350,7 @@ func (p *CloudFlareProvider) submitChanges(ctx context.Context, changes []*cloud log.WithFields(logFields).Errorf("failed to find previous record: %v", change.ResourceRecord) continue } - recordParam := getUpdateDNSRecordParam(*change) + recordParam := updateDNSRecordParam(*change) recordParam.ID = recordID err := p.Client.UpdateDNSRecord(ctx, resourceContainer, recordParam) if err != nil {