* 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>
When AAAA multi-target / dual stack support was
added via #2461 it broke ownership of domains across
different clusters with different ingress records types.
For example if 2 clusters manage the same zone,
1 cluster uses A records and the other uses CNAME
records, when each record type is treated as a separate
planning record, it will cause ownership to bounce back
and forth and records to be constantly created and
deleted.
This change updates the planner to keep track of multiple
current records for a domain. This allows for A and AAAA
records to exist for a domain while allowing record type
changes.
The planner will ignore desired records for a domain that
represent conflicting record types allowed by RFC 1034 3.6.2.
For example if the desired records for a domain contains
a CNAME record plus any other record type no changes for
that domain will be planned.
The planner now contains an owned record filter provided
by the registry. This allows the planner to accurately plan
create updates when there are record type changes between
the current and desired endpoints. Without this filter the
planner could add create changes for domains not owned
by the controller.
Previously there was no distinction between an IP address and any other string
when doing a comparison to determine which is "less" when determining which endpoint to actually create.
This explicitly handles IP addresses and will always prefer
them over non-IP addresses when determining which of two targets is less.
* Endpoint.Target is now Endpoint.Targets. This is its own type representing mutliple targets for a single DNS name while adding some convenience for sorting and comparing
* Made everything compile and tests run through with the new Endpoint.Targets
* The ingress source can now properly handle multiple target ips per host
* Added custom conflict resolver, to better understand how conflict resolution has to work for me
* My custom conflict resolver behaves a bit different than the PerResource resolver, therefore I needed to modify the expected test result
Removed unnecessary FIXME
* The ingress source now creates CNAME endpoints with multiple targets to let the DNS provider decide how to handle multiple CNAME targets. This could be interesting for weighted targets etc.
* Adopted the expected results to the new way we create endpoints for CNAMEs
* Removed Add method from Targets since manipulating the slice through here is unnecessary complicated and doesn't deliver enough convenience
* Reverted ConflictResolver to the original one. There is some discussing to do what the best way is to handle conflicts
* Added missing documenting comment to IsLess of Targets
* Added documenting comments to Targets,Targets.Same and NewTargets to clarify their intention and usage
* Service source now also generates endpoints with multiple targets
* Service and Ingress source now sort all Targets for every Endpoint to make order of Targets predictable
* Endpoints generated by the Google Cloud DNS provider now also have sorted Targets to make order of Targets predictable
* Modified provider dyn to be able to compile with multi target changes
* Fixed small nitpicks, so my code is acceptable
* Fixed merge method after updating to new Targets. Replacing '!=' with .Same of course needs a boolean negation
* Tests for dyn provider now also use the new Targets instead of Target
* Simplified extractServiceIps as implied by linki to make it more readable
* ref: change service ClusterIP retrieval again
* Added entry to CHANGELOG.md describing the new features contained in this PR
* Make suitableType() be Endpoint method
With this change it becomes possible to work with endpoint
of empty type in packages other than "provider". Also
it seems logical for a smart property getter without side effects
to be a method rather than a function in different package
* Make plan computation work correctly with multi-target domains
* fix drawing
* drop comments
* fix boilerplate header
* fix comment
* fix the bug with empty map
* rework registry to support random lables
* serialize->serializeLabel function rename
* golint for err variable naming
* add additional test
* add tests for current case where one resource can generate multiple endpoints
* make labels have its own type, add serialization as a method
* add comment for exported error
* use greater rather than not equal zero
* update changelog
* ref(source): use testify with mocks in test code
* fix: re-introduce NewMockSource for convenience
* fix: avoid circular dependency
* ref: increase usage of testify
* chore: vendor testify as a dependency
* fix(*): cleanup testify expectations
* kickoff txt registry
* fix inmemory dns provider to include recordtype info for validation
* Merge master
* fix ununsed variable in inmemory provider
* add tests for records
* add test for no prefix name formatter
* implement apply changes with tests
* add flag to enable txt registry
* add txt registry to main
* improve sort testing
* filter out non-owned records
* NewEndpoint(...) requires record type
* use newendpoint in aws_test, fix tests
* change suitable type implementation
* fix the test for compatibility component
* change inmemory provider to include recordtype and use suitable type
* fix comments, CNAME should target hostname
* name mapper do not use pointer on struct
* txt prefix - just concatenate, remove spew, fix txt record label
* allow TXT records as result from dns provider
* add changelog
* fix tests
* TXT records need to be enclosed in double quotes
* add labels to endpoints
* reset to first commit fix label key
* compare using sameendpoint, add map initializer to newendpoint
* fix(endpoint): drop superflous comment indicators