From fb85c0ac0e8dabfea52d7b264f360989e6577e80 Mon Sep 17 00:00:00 2001 From: Seweryn Chlewicki Date: Tue, 27 Jun 2023 17:42:59 +0100 Subject: [PATCH] Unset instead --- provider/aws/aws.go | 4 ++-- provider/aws/aws_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index 89c06bd772..962a93a17c 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -679,14 +679,14 @@ func (p *AWSProvider) AdjustEndpoints(endpoints []*endpoint.Endpoint) []*endpoin } } else { alias = useAlias(ep, p.preferCNAME) - log.Debugf("Modifying endpoint: %v, setting %s=%v", ep, providerSpecificAlias, alias) + log.Debugf("Modifying endpoint: %v, unsetting TTL", ep) ep.SetProviderSpecificProperty(providerSpecificAlias, strconv.FormatBool(alias)) } if alias { if ep.RecordTTL.IsConfigured() { log.Debugf("Modifying endpoint: %v, setting ttl=%v", ep, recordTTL) - ep.RecordTTL = recordTTL + ep.RecordTTL = 0 } if prop, ok := ep.GetProviderSpecificProperty(providerSpecificEvaluateTargetHealth); ok { if prop != "true" && prop != "false" { diff --git a/provider/aws/aws_test.go b/provider/aws/aws_test.go index cce21e66a8..6aaca74ca3 100644 --- a/provider/aws/aws_test.go +++ b/provider/aws/aws_test.go @@ -534,7 +534,7 @@ func TestAWSAdjustEndpoints(t *testing.T) { validateEndpoints(t, provider, records, []*endpoint.Endpoint{ endpoint.NewEndpoint("a-test.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeA, "8.8.8.8"), endpoint.NewEndpoint("cname-test.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeCNAME, "foo.example.com").WithProviderSpecific(providerSpecificAlias, "false"), - endpoint.NewEndpointWithTTL("cname-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeCNAME, 300, "alias-target.zone-2.ext-dns-test-2.teapot.zalan.do").WithProviderSpecific(providerSpecificAlias, "true").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "true"), + endpoint.NewEndpoint("cname-test-alias.zone-1.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeCNAME, "alias-target.zone-2.ext-dns-test-2.teapot.zalan.do").WithProviderSpecific(providerSpecificAlias, "true").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "true"), endpoint.NewEndpoint("cname-test-elb.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeCNAME, "foo.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificAlias, "true").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "true"), endpoint.NewEndpoint("cname-test-elb-no-alias.zone-2.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeCNAME, "foo.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificAlias, "false"), endpoint.NewEndpoint("cname-test-elb-no-eth.ext-dns-test-2.teapot.zalan.do", endpoint.RecordTypeCNAME, "foo.eu-central-1.elb.amazonaws.com").WithProviderSpecific(providerSpecificAlias, "true").WithProviderSpecific(providerSpecificEvaluateTargetHealth, "false"), // eth = evaluate target health