98 Commits

Author SHA1 Message Date
Kai Udo
fe753cb8e9
test(cloudflare): clear environment variables before setting test values (#5851)
* test(cloudflare): clear environment variables before setting test values

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>

* refactor(cloudflare): extract environment variable names to package constants

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>

* refactor(cloudflare): use testutils helper for test environment setup

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>

* refactor(cloudflare): simplify token handling and improve test env setup

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>

---------

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>
2025-09-22 05:10:17 -07:00
vflaux
f7793950cc
test(cloudflare): mock provider for cf change tests (#5852) 2025-09-20 02:26:13 -07:00
vflaux
69429a5e47
test(cloudflare): modernize zoneDomainFilter test (#5853) 2025-09-19 10:50:15 -07:00
vflaux
ad3d958e4a
fix(cloudflare): reconciliation loop with default comment (#5828) 2025-09-15 00:24:10 -07:00
vflaux
1c116507b7
chore(cloudflare): migrate UpdateDNSRecord() to new lib (#5781) 2025-09-09 02:57:32 -07:00
vflaux
7b2adbb0ec
chore(cloudflare): add unit tests for zoneService (#5800) 2025-09-04 15:49:15 -07:00
vflaux
4aac6870f5
chore(cloudflare): migrate DeleteDNSRecord() to new lib (#5780) 2025-09-04 13:11:17 -07:00
vflaux
61ca17c0fb
chore(cloudflare): migrate ListRecords() to new lib (#5778)
* chore(cloudflare): migrate ListRecords() to new lib

* chore(cloudflare): test zoneService.ListDNSRecord()
2025-09-04 02:53:15 -07:00
vflaux
e78b38597d
chore(cloudflare): migrate CreateDNSRecord() to new lib (#5779) 2025-08-30 03:07:09 -07:00
vflaux
5181b3f0d0
chore(cloudflare): migrate DNSRecord to new lib struct (#5762) 2025-08-28 06:05:18 -07:00
vflaux
ccb3e6bd2f
chore(cloudflare): upgrade library to v5 (#5734) 2025-08-14 02:23:09 -07:00
Andrew Hay
23e12c1a09
refactor(cloudflare): use lib v4 for zone services (#5654)
* chore: update zone implementation to v4

* chore: update cloudflare zones to v4

* docs: newline around lists

* docs: styling

* style: remove trailing whitespace
2025-07-29 03:44:01 -07:00
vflaux
5c42ed00c7
refactor(provider/cloudflare): use local regionalHostname struct (#5615) 2025-07-06 11:19:25 -07:00
Arthur Le Roux
e17b5ed07b
feat(cloudflare): add support for MX records (#5283)
* feat(cloudflare): add support for MX records

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* test(txt): add additional TXT and MX record test cases

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* feat(endpoint): implement parsing for MX and SRV records with structured targets

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* fix(txt): remove TXT record type from supported types in NewTXTRegistry

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* refactor(digitalocean): streamline MX record handling

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* refactor(cloudflare): improve error handling in change creation

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* fix(endpoint): return all parsed SRV targets instead of a single target

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* test(endpoint): add parsing tests for MX and SRV records

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* fix(endpoint): streamline MX and SRV record validation and parsing

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* fix(digital_ocean): simplify MX record parsing

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* fix(docs): update link to CRD source in MX record documentation

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* fix(cloudflare): improve error handling for MX record parsing

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* fix(cloudflare): improve error message formatting for MX record parsing

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* refactor(endpoint): rename ParseMXRecord to NewMXTarget and update references

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* fix(endpoint): update NewMXTarget to return pointer and adjust tests accordingly

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* refactor(cloudflare): consolidate proxyEnabled and proxyDisabled variable declarations

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* fix(endpoint): update TestNewMXTarget to reflect changes in MXTarget struct fields and add missing test case for host validation

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* fix(digitalocean): improve MX record handling by adjusting error handling and ensuring proper priority and host retrieval

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* refactor(endpoint): change MXTarget fields to unexported and update NewMXTarget to use them

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* refactor(cloudflare): update groupByNameAndTypeWithCustomHostnames to use provider methods and enhance MX record handling in tests

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* test(cloudflare): enhance test cover

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* refactor(endpoint): remove unused SRVTarget struct from endpoint.go

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* refactor(endpoint): rename NewMXTarget to NewMXRecord for clarity and update references

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>

* Update docs/sources/mx-record.md

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>

---------

Signed-off-by: Arthur Le Roux <arthurleroux@protonmail.com>
Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2025-06-23 23:32:28 -07:00
vflaux
7108979df1
improve cloudflare regional hostname implementation (#5309)
- add flag to enable regional hostname feature
- support deletion of regional hostname on annotation edit
- correctly support differences detection with cloudflare state
- increased tests coverage

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2025-06-22 03:22:52 -07:00
vflaux
104157f8b1
chore(cloudflare): remove unused funcs (#5553) 2025-06-22 02:54:59 -07:00
kaikai
a4522f0b76
chore(domainfilter): use pointer receivers for DomainFilter (#5546)
* refactor(domainfilter): use pointer receivers for DomainFilter

* refactor(domainfilter): complete pointer type consistency across providers
2025-06-21 00:38:53 -07:00
Edouard Benauw
0fae060dff
fix(cloudflare): improve handling of rate limiting errors (#5524)
* fix cloudflare

* factorize error conversion

* only log if not a soft error

* add comment for workaround

* Remove debug print

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* Use assert

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* Improve error check

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* fix lint

---------

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>
2025-06-19 15:30:53 -07:00
vflaux
7c0881477a
chore(cloudflare): move regional services logic to dedicated file (#5329)
* cloudflare: move regional logic to dedicated file

* cloudflare: actions as enum type
2025-05-23 07:42:37 -07:00
Ivan Ka
e21607254d
chore(codebase): enable errorlint (#5439)
* chore(codebase): enable errorlint

* chore(codebase): enable errorlint

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-05-21 04:14:34 -07:00
Ivan Ka
bdb51b2d96
chore(codebase): enable testifylint (#5441)
* chore(codebase): enable testifylint

* chore(codebase): enable testifylint

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(codebase): enable testifylint

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-05-21 03:46:34 -07:00
tom
14ea50300e
feat(cloudflare): Suppport DNS record comments (#5411)
* feat(cloudflare): Suppport DNS record comments

* Provide comment flag example
2025-05-19 00:43:15 -07:00
Ivan Ka
de6fb9d385
fix(log testing): re-use logger library testing functionality (#5368)
* fix(log testing): re-use logger library testing functionality

* fix(log testing): re-use logger library testing functionality

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* fix(log testing): re-use logger library testing functionality

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-05-12 01:49:15 -07:00
natitomattis
597a72f193
test: add tests for cloudflare provider (#5248)
* Improve cloudflare code coverage

* refactor TestCloudflareProvider

* go lint

* fix data race
2025-05-04 07:41:57 -07:00
Ivan Ka
a6243cf6bb
chore(providers): rename custom TTL constants to defaultTTL (#5312)
* chore(provider): inline providers

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(provider): inline providers

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(provider): inline providers

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(provider): inline providers

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(provider): inline providers

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-04-27 14:59:25 -07:00
Valentin Flaux
6f65181681
add tests & fixes for dataLocalizationRegionalHostnamesChanges() 2025-04-12 10:59:47 +02:00
Valentin Flaux
c3f0cd668f
fix cloudflare regional hostnames
Implements create & delete of regional hostnames for A, AAAA & CNAME
records.
Implements "external-dns.alpha.kubernetes.io/cloudflare-region-key"
annotation.
2025-04-12 10:59:47 +02:00
Mikhail Rozentsvayg
6808aa3198 add test for logging error when creating endpoint and ignoring too long record name (shouldn't happen) 2025-04-02 10:09:00 -07:00
Mikhail Rozentsvayg
f3f58dd676 [attempt to] improve nested conditions readability for cloudflare tests failures scenarios 2025-04-01 12:01:50 -07:00
Mikhail Rozentsvayg
6da38ba746 feat(cloudflare): multiple custom hostnames support 2025-03-30 22:21:03 -07:00
Mikhail Rozentsvayg
43b218880e fix private names 2025-03-19 12:08:50 -07:00
Mikhail Rozentsvayg
47236fd8bf style/naming 2025-03-19 12:01:43 -07:00
Mikhail Rozentsvayg
2e29a19ab7 tidy up using underlying maps for dns records and custom hostnames 2025-03-19 10:09:37 -07:00
Mikhail Rozentsvayg
e47d83b224 types for records/custom hostnames maps 2025-03-18 12:24:54 -07:00
Mikhail Rozentsvayg
037a10174f use maps for DNS records getRecordID() and custom hostnames getCustomHostname() for faster lookups 2025-03-18 12:12:57 -07:00
Mikhail Rozentsvayg
b1f20511c5 move custom hostnames related submitChanges() implementation to a separate method submitCustomHostnameChanges(); extend truncated logging 2025-03-18 10:07:13 -07:00
Mikhail Rozentsvayg
12cce6fa7f Use %q log fmt for cloudflare provider code 2025-03-17 19:10:35 -07:00
Mikhail Rozentsvayg
2a15aba564 syntax/style 2025-03-17 19:10:35 -07:00
Mikhail Rozentsvayg
8d37820a56 fix(cloudflare): custom hostnames edge-cases causing duplicates 2025-03-17 19:10:35 -07:00
mrozentsvayg
017f7687ca
fix(cloudflare): infinite loop with more than 50 custom hostnames (#5181)
* bugfix - do not reset the resultInfo var, causing infinite loop when number of custom hostnames more than 50

* support paging for custom hostnames tests; update doc
2025-03-14 10:49:48 -07:00
mrozentsvayg
44f1008ee1
cloudflare: bugfix - do not attempt to create unconfigured empty custom hostnames; improve tests; streamline logic (#5146)
improve test coverage

test the edge case when the custom hostname has changed during the record deletion

don't use custom hostnames if Cloudflare for SaaS fails to authenticate

Use new --cloudflare-custom-hostnames flag to enable cloudflare custom hostnames support

custom hostnames flags --cloudflare-custom-hostnames-min-tls-version and --cloudflare-custom-hostnames-certificate-authority support

markdown lint

Update cloudflare.md
2025-03-12 09:59:48 -07:00
Andrew Hay
750f8f40ab style: formatting 2025-02-19 17:06:04 +00:00
Andrew Hay
c9df817f04 fix: remove broken test 2025-02-19 16:47:58 +00:00
Andrew Hay
1da72312a9
Merge branch 'master' into test/submitChanges 2025-02-19 11:00:20 -05:00
Mikhail Rozentsvayg
ec83b4b8d3 nitpick: rename cloudflare custom hostname test function 2025-02-18 15:23:25 -08:00
Mikhail Rozentsvayg
8dc667a2f6 review suggestions based improvements 2025-02-18 15:04:15 -08:00
Mikhail Rozentsvayg
28f5c95f24 rename customHostnamesWithPagination to listCustomHostnamesWithPagination help function to improve the naming consistency 2025-02-12 08:35:37 -08:00
Mikhail Rozentsvayg
e8bda89de6 Revert "fix: add UpdateDataLocalizationRegionalHostname to test framework"
This reverts commit 438b0bccb539511ed73af885a414f10c894c81e6.
2025-02-11 15:30:22 -08:00
Andrew Hay
df0628faa2 feat: add APEX test 2025-02-10 16:52:55 +00:00
Mikhail Rozentsvayg
bd0dfeffea add basic custom hostnames test cases 2025-02-09 14:50:02 -08:00