You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a (sub)reconciler is invalid, because, say, it missing ChildObjectManager, then its (sub)reconciler test suite fails with a panic. Tracing the panic back to the missing ChildObjectManager is possible but tedious.
Wonder if we should call validate() from within init() that way the validation would apply to the first Reconcile() call rather than just setup (which is hard to unit test). The downside is that the logger wouldn't be configured for the reconciler, but I don't see a lot of logging happening within the validation method.
I'd also be ok exporting the validate() method, but I don't think it should be part of the SubReconciler interface. SubReconcilerTestCase could sniff for an exported Validate() method and call it.
Thoughts?
edit: validate() returns an error which is annoying to handle within init() as it's work is wrapped in a sync.Once. Because of that and the logger issue, I opted to export the validate() method and call it explicitly within each (Sub)ReconcilerTestCase.
When a (sub)reconciler is invalid, because, say, it missing
ChildObjectManager
, then its (sub)reconciler test suite fails with a panic. Tracing the panic back to the missingChildObjectManager
is possible but tedious.It would be nice if invalid (sub)reconcilers would be reported with the same error message one sees when running the controller.
Since
validate
is not exported it's not easy for reconciler authors to validate their reconcilers in their tests.The text was updated successfully, but these errors were encountered: