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

dnspolicy section name support #961

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

mikenairn
Copy link
Member

Add section name support to DNSPolicy.

image

@maleck13
Copy link
Collaborator

Changes looks very simple. +1

@mikenairn mikenairn marked this pull request as ready for review October 30, 2024 12:39
@mikenairn mikenairn changed the title wip: dnspolicy section name support dnspolicy section name support Oct 30, 2024
Signed-off-by: Michael Nairn <mnairn@redhat.com>
DNSRecords are currently owned by the DNSPolicy that created them. We
can't just update the ownership on policy change since the new policy
may not be compatible with the current DNSRecord, instead we must
re-create the DNSRecord resource.

This is not ideal, issue to look into changing this
Kuadrant/dns-operator#287

Signed-off-by: Michael Nairn <mnairn@redhat.com>
@mikenairn mikenairn force-pushed the dnspolicy_section_name branch 2 times, most recently from 4311467 to 1818be2 Compare October 30, 2024 20:52
Returns true if an existing record can knowingly be updated to a desired
state based on the differences of the specs.

Current known reasons for not being able to update are:

* RootHost updates
* Endpoint record type changes (A -> CNAME etc..)

In both these cases, and any others that may be added to
`canUpdateDNSRecord` the current record should be deleted before doing a
create of the desired record.

Signed-off-by: Michael Nairn <mnairn@redhat.com>
@maleck13
Copy link
Collaborator

Verifiation

  • Created Gateway
  • Created multiple listeners
  • Created section name target dnspolicy and none section name dnspolicy
  • Verified DNS records created as expected
  • Deleted each policy individually and all together
  • verified dns records are removed and all related objects are removed
  • Changed a listener name
  • verified dnsrecords removed as expected.

👍

Copy link
Collaborator

@maleck13 maleck13 left a comment

Choose a reason for hiding this comment

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

/lgtm

}

return true
}
Copy link
Member Author

Choose a reason for hiding this comment

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

@maleck13 fyi, because i had to do this to deal with possible changes in record type when attaching a policy to a listener that already has existing records via policy attached to a gateway, it means we could probably remove this now https://github.com/Kuadrant/kuadrant-operator/blob/main/api/v1alpha1/dnspolicy_types.go#L56 and allow switching from simple to loadbalanced without the need for manual intervention.

Copy link
Collaborator

Choose a reason for hiding this comment

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

nice ok. Lets go for it

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll do it in a different PR, will need some tests

Copy link
Member Author

Choose a reason for hiding this comment

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

@mikenairn mikenairn merged commit daa8473 into Kuadrant:main Oct 31, 2024
24 checks passed
@mikenairn mikenairn deleted the dnspolicy_section_name branch October 31, 2024 11:47
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.

3 participants