conformance: add a conformance test for BackendTLSPolicy#4360
conformance: add a conformance test for BackendTLSPolicy#4360k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
Conversation
|
|
|
Hi @Thealisyed. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
|
/cc |
|
overall the test looks good to me, I was able to test it on envoygateway with almost full success (but the returned reason from resolvedRefs that seems to be wrong). I will leave this for someone else to also review and approve, as me and Ali work for the same company! |
|
/cc @snorwin |
|
@rikatz I have no objection to adding conformance tests that verify that a parent resource is reconciled when a referenced resource is created, updated, or deleted (or when a ReferenceGrant affecting it is created, updated, or deleted). However, I would expect this to be done consistently for all references, not just for BackendTLSPolicy, and in a way that avoids duplicating existing conformance tests. For that reason, I would limit such tests to control-plane behavior, i.e., verifying that updates are reflected in the parent resource’s status. In addition, I would suggest first updating the implementation guide to clearly state that creating, updating, or deleting any referenced resource must trigger a reconcile, and to clarify the semantics around ReferenceGrants. From there, issues could be opened to add conformance tests covering all reference types. In general, this should be considered best practice when writing Kubernetes controllers. If specific implementations do not follow these practices, I would prefer opening issues in those repositories rather than over-complicating the conformance tests. That said, I don’t think the current conformance suite, given its heavy use of shared resources, is ready for the kind of scenario-based tests proposed in this PR. The tests run in parallel and rely on many shared resources, which MUST NOT be modified, as this would interfere with other tests. This would likely lead to significant duplication just to isolate scenarios. |
agreed!
How is this different today from a Service, as a backendRef on a route, that gets a new endpoint added? Or a certificate on a listener that is updated? Is this just a lack of clarification on implementation guide, or do we miss something else? Should we have an extra conditions field for the policies that say that any policy implementation MUST have a condition for any referenced resource, and with observedGeneration instead? Again, my bigger concern here is about behavior. It would sucks to be a user that has everything working, decides upfront to update the certificate on a BTLS Policy CA chain just to figure out that my proxy will never work unless someone restarts the controller. |
This information is usually already reflected in the Just as an inspirtaion, this is how we typically test whether our controllers correctly reconcile resources, using HTTPRoute as an example:
While we could also validate the data plane at each step, we consider this unnecessary for reconciliation tests. Configuration changes and errors are already fully surfaced through the control plane, so verifying the control plane status is sufficient for these tests, without additionally checking the data plane. |
e2d83cf to
7875d43
Compare
Changing a ConfigMap content should be reconciled by the controller.
|
thanks for the validation @snorwin |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rikatz, snorwin, Thealisyed The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
kl52752
left a comment
There was a problem hiding this comment.
Thank for your work :)
/lgtm
Changing a ConfigMap content should be reconciled by the controller.
What type of PR is this?
/kind test
/area conformance-test
What this PR does / why we need it:
This PR adds a conformance test for BackendTLSPolicy so that when a ConfigMap contents are changed, it should be reconciled by the controller.
Which issue(s) this PR fixes:
Fixes #4338
Does this PR introduce a user-facing change?: