Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete dns records when listener hostname changes #850

Merged

Conversation

mikenairn
Copy link
Member

fixes: #794

The DNSRecord resource does not handle changes made to the rootHost which can cause things to be left around in the provider if it's modified after initial record creation. This change modifies the logic detecting if existing records should be removed to take into account possible hostname changes, removing any that no longer match (qw.listener.hostname != record.spec.rootHost).

related: Kuadrant/dns-operator#219

Copy link
Contributor

@maksymvavilov maksymvavilov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
Would it be a good idea to test for the wildcard records as well? Currently rootHost (dns-record) is identical to hostname (gateway) always but I'm worried that it might change

@mikenairn mikenairn force-pushed the recreate_dnsrecord_on_hostname_updates branch from 97761a8 to 7a61a29 Compare September 6, 2024 16:20
@mikenairn
Copy link
Member Author

Looks good. Would it be a good idea to test for the wildcard records as well? Currently rootHost (dns-record) is identical to hostname (gateway) always but I'm worried that it might change

I'm not really sure why it would change, but that said there is no harm in testing it. Test updated now to ensure that other listeners DNSRecords are not modified due to updates to another listener, and also that the wildcard listener DNSRecord can be updated in the same way.

The DNSRecord resource does not handle changes made to the `rootHost`
which can cause things to be left around in the provider if it is
modified after intial record creation. This change modifies the logic
detecting if existing records should be removed to take into account
possible hostname changes, removing any that no longer match
(qw.listener.hostname != record.spec.rootHost).

Signed-off-by: Michael Nairn <mnairn@redhat.com>
@mikenairn mikenairn force-pushed the recreate_dnsrecord_on_hostname_updates branch from 7a61a29 to aadc472 Compare September 6, 2024 16:27
@mikenairn mikenairn merged commit bbd25fa into Kuadrant:main Sep 6, 2024
21 checks passed
@mikenairn mikenairn deleted the recreate_dnsrecord_on_hostname_updates branch September 6, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changing gateway listener with DNSPolicy attached results in orphaned DNS records
2 participants