Changing gateway listener with DNSPolicy attached results in orphaned DNS records
It is the same issue: https://github.com/Kuadrant/multicluster-gateway-controller/issues/601
After changing Gateway listener from domain specified in Managed zone to a domain specified in different Managed zone the previous DNS record wont get cleaned up and stays in DNS provider.
Steps to reproduce
- Have two Managed zones.
- Create correctly Gateway, HttpRoute and DnsPolicy.
- Edit the Gateway listener so the domain is now under different managed zone.
- The DnsPolicy should have status:
'DNSPolicy has encountered some issues: policy is not enforced on any dns record: no routes attached for listeners'
HttpRoute has status:
no hostnames matched parent hostname
DNSRecord CR is deleted and DNS record on provider is NOT deleted. 5. Edit the HttpRoute so it matches the Gateway new listener. 6. Everything reconciles successfully and new hostname works. New DNSRecord CR gets created. 7. Doing DNS lookup on the old hostname will still work.
I found simpler way to reproduce this with just one ManagedZone.
- Create Gateway and HttpPolicy to have same hostname (no wildcards)
- Create DNSPolicy
- Edit Gateway listener to different hostname
- Observe the errors in HttpPolicy and DNSPolicy (same as in first post). Observe the DNSRecord gets deleted.
- Edit HttpPolicy to the new hostname
- Everything reconciles successfuly
- DNS query for old hostname still resturns a result.
This should be fixed as part of the managed zone removal https://github.com/Kuadrant/dns-operator/pull/203
This should be fixed as part of the managed zone removal Kuadrant/dns-operator#203
Will be looked into after Kuadrant/dns-operator#203 as we will probably mark the rootHost filed as immutable and delete and re-create the DNSRecord resource in the kuadrant operator instead of handling rootHost changes in the dnsrecord controller.
Yes I can confirm the managed zone removal did not fix this bug.