-
Notifications
You must be signed in to change notification settings - Fork 33
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
Refactor patrially enforced condition for dnspolicy #722
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #722 +/- ##
==========================================
+ Coverage 80.20% 81.49% +1.28%
==========================================
Files 64 77 +13
Lines 4492 6209 +1717
==========================================
+ Hits 3603 5060 +1457
- Misses 600 780 +180
- Partials 289 369 +80
Flags with carried forward coverage won't be shown. Click here to find out more.
|
tests/common/dnspolicy/dnspolicy_controller_single_cluster_test.go
Outdated
Show resolved
Hide resolved
93bb762
to
e5600d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of comments/questions but i think the states of the enforced condition looks good as i understand it:
Policy + No DNSRecords = Enforced false
Policy + DNSRecords all ready = Enforced true
Policy + DNSRecords none ready = Enforced false
Policy + DNSRecord, some ready = Partially Enforced
It does however look like it's basing these decisions on just listing DNSRecord resources that are owned by the policy, is this enough? Should we not be checking the DNSRecord for a corresponding listener exists and is ready? What would happen in the case where we have two listeners but for some reason a record wasn't being created for one of them? In this case would the Enforced condition be set to true even though there is a record missing?
TLS does something different here, i don't think its fully right either btw as it seems to do it only for one certificate, but it gets the list of expected certificates and then tries to find them, if one is missing it's going to cause it be not enforced.
It is a good point - what do we consider to be an "Enforced" DNS Policy? When initially making the change the idea was that as soon as DNS Record is published to the provider the policy is enforced. Unhealthy listeners will prevent publishing. E.G. if the listener is conflicted with another listener on the gateway it won't be published as it will conflict (what is in the MZ vs what we want) when we validate the plan or will lead to an "awaiting validation" loop on booth records. |
Signed-off-by: Maskym Vavilov <[email protected]>
The current approach wasn't started in this PR so yes we can create a follow on issue to look into changing that behaviour. Can you create that follow on issue before closing this issue out? |
I've created #792 as a follow-up @mikenairn |
Signed-off-by: Maskym Vavilov <[email protected]> Signed-off-by: dlaw4608 <[email protected]>
closes #586
fixes #685
Changing the enforced logic around DNSPolicy.
Now it works as one would expect. Also updated relevant integration tests.
Added a new test to cover all possible
Enforced
conditions. It is arguable if we need such a hefty test, that is, more-less, a copy of an already existent one. My reasoning is that unexpectedEnforced
behaviour caused a few bugs and I'd rather have tests run an extra 20-ish seconds but be confident in the scope of the test.