* Adding a base class to use as strong typed reconciler events.
* fmt, rename.
* support wrapped errors.
* make a custom alias for errors.Is and errors.As, use Event as an interaface.
* add context name (event) to is and as
* update based on feedback.
* fix test fail messages.
* feedback updated.
* cleanup test code.
I'm splitting this off of another change that needed them, the three changes are:
1. Give the PostConditions callbacks in TableRow access to the Reconciler
resource. It turns out this is incredibly useful to have the `TableRow`
program an admission controller and then test that programming by calling
`Admit()`.
1. Surface the test resources in our webhook "listers", and add the testing
scheme.
1. Change the `objKey` to only use reflection as a fallback. The existing logic
doesn't work properly when a mix of real resources and unstructured.Unstructured
is used for the same resource.
`TrackReference` is the same as `Track`, but takes a `tracker.Reference` instead. This type has been seeded with the subset of `corev1.ObjectReference` that the tracker currently consumes / supports, but the intention is to expand this type to allow inexact references that (optionally) use label selectors in place of name to reference objects.
See also: https://github.com/knative/pkg/issues/859
Not having this causes the listers to log an annoying log message like
W1108 02:48:54.848573 211995 listers.go:77] can not retrieve list of objects using index : Index with name namespace does not exist
That message doesn't cause the tests to fail because the cache logic works around by doing a "slow indexing". I was very confused by this log though and sunk a bit of time into debugging it, so here we go.
The 1.14 K8s test libs introduce changes that broke how we were testing this, but it still works in the cases we care about, so this adjusts the test to more accurately test the reactor in the way we actually care about.
Currently the table tests do not annotate the context logger with the key
which means we puts lots of unnecessary logging in the reconcilers to log the key that is being reconciled.
So this fixes that.
Also precreates some containers to the needed size.
/assign mattmoor
Currently we're collecting and printing extra objects
as VerbActions, which of course is not what's extra, the extra is the
object wrapped around them. So print that insted.
* Moving reconcile/testing from serving to pkg.
* add clock.
* Update clock cw.
* move testing/configmap.go to configmap/
* wire in a setable context.
* need to export example key.