Adds RequestOption and WithHeader functions that allow users to customize
the request options when taking polling actions.
This unblocks Knative Serving to pass user set headers through
in conformance testing.
This form should be more hospitable to running things to auto-update `knative/pkg` and `knative/test-infra`.
I canaried this change in `knative/sample-controller`, and was able to produce: https://github.com/knative/sample-controller/pull/11
This creates a base library that enables us to leverage the dependency
graph to convey injection dependencies. Our controllers will start
to get their informers off of a `context.Context` via `fooinformers.Get(ctx)`.
By simply linking `fooinformers` to access the informer in this way, we trigger
a cascade of `init`-time registrations for the informer, and its transitive
dependencies (e.g. shared informer factory, client).
The `ctx` is infused with these informers in `package main` by linking the
appropriate reconcilers (transitively registering everything) and then calling
`sharedmain.Main()` (from `github.com/knative/pkg/injection/sharedmain`).
* Logging config pares all components, rather than just a list passed in.
* Simplify the prefix checking logic.
* PR comment - ignore empty string.
* Unit test.
A while back we added a "StatsReporter" argument to `controller.NewImpl`,
but in serving every callsite of this is passing:
```
controller.NewImpl(r, logger, "my-string", MustNewStatsReporter("my-string", logger))
```
Where `MustNewStatsReporter` is just a form of knative/pkg's `controller.NewStatsReporter`
that logs fatally when an error is returned. It is notable that Serving's logic has been
duplicated to both Build and Eventing.
There are a handful of changes here:
1. Move MustNewStatsReporter into knative/pkg
2. Expose the current interface as NewImplWithStats
3. Drop the StatsReporter from NewImpl and default to `MustNewStatsReporter()`
This is a breaking change for downstream repositories, but should make their callsites universally simpler.
In serving we have `reconciler.Handler` that wraps a handler function
(e.g. `Enqueue`) in the `cache.ResourceEventHandlerFuncs`. This pattern
was becoming pervasive, so this simpler handler dramatically reduced our
boilerplate.
* Add configmap.DefaultingWatcher that allows watched ConfigMaps to be defaulted in code.
* Add a test where the real K8s CM is deleted.
* Remove unused cmName.
* WatchWithDefault after start panics.
* cfgs -> defaults
* Initialize defaults in NewInformedWatcherFromFactory.
* Remove unneeded error in panic.
This is needed for the positive handoff, so that we can enqueue
the KPA after we received the positive answer from the activator
but still want to have buffer time to make sure the network
changes propagate everywhere.
* Add support for a structured URL type.
This type can be used to accept `url: http://asdf.com` where in code we
get a `url.URL` to interact with.
* Propagate errors parsing, cast pointer instead of copying.