Errors from the tracker or the addressable resolver factory
are discarded which isn't helpful for debugging since the
error is generic `kafkachannels "Lister" not found`.
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
I noticed in a few places downstream that reconcilers were creating both trackers and Addressable resolvers, which seems superfluous. As part of examining the way we use the tracker, I'm experimenting with changing this to just take a tracker.
* bump k8s deps to v1.20.7
* fix migrator test pkg
* dynamicclient now expects List types to be declare either via a scheme or manually
* fix error message comparison
* drop excess vendor licenses
* Using the injection fake dynamic client will preserve pre-1.20 behaviour
This is accomplished by preprocessing the scheme/fixtures and declaring
a custom scheme were we map our types & lists to unstructured.* types
* revert webhook factory changes
* ensure objects to the dynamic client are unstructured
* seed the default dynamic client with k8s scheme
* include duckv1 types in default fake dynamic client scheme
* use default k8s scheme
looks like eventing adds to this scheme but we should import the correct one vs the one from the fake package
* drop duckv1 from default scheme
* set APIVersion/Kind if empty
* refactor ToUnstructured helper to a new package
I was looking at the #923 (it'll be quite some effort to get the
informer there, or create dynamic one for k8s services),
but nonetheless clean the test up.
- Rename the getters to exclude word get (as go style suggests).
- The errors test contains only errors, so stream line it
- Ensure errors are also idempotent, which wasn't.
* Return an apimachinery error if psbinding subject WithContext fails
In the event a subject's `WithContext()` call fails, then
ReconcileSubject fails without catching the proper
error (sinkbinding's WithContext returns its own custom errors). This
can manifest itself in instances where the sinkbinding subject has
been deleted before the sinkbinding itself, and leaves the reconcile
deletion loop stuck before the finalizer can be removed. Leaving the
sinkbinding itself stuck, despite the subject already being deleted.
* Alter URIFromObjectReference to return apierrs
This allows for reconcile deletion to properly remove finalizer and
delete sinkbinding
* Update Tests
* Drop unneeded Sprintf
This augments the injection codegen with the capability to produce a duck.InformerFactory
attached to context for each type that we process.
Now a `duck.InformerFactory` for "Addressable" can be produced by "Get"ing it from the context.
This is triggered by placing `// +genduck` on the type that implements `duck.Implementable`.
Destination sits in a strange versioned directory without a group under APIs. Destination is in fact part of our duck type space, so it belongs under the `duck` group. This moves the definition (previously v1alpha1) to `v1` because it is referenced from source types that have been designated `v1`.
* change Destination api and addressable resolver, fixed unit tests and added more unit tests
* make validateDestination visible
* rename error msg, added comments, added unit tests
* reformat error msg and change positive case order
* modified error msg when ref is not valid
* fixed typo