* allow multiple values for comment tag keys
this will allow us to support multiple annotation keys
* add OR filter chain
* update codegen to support multiple annotation keys
* Preserve previous code & formatting if the number of annotation keys is 1
- preserve the order of the annotations vs. sorting it
- deprecate and don't remove ClassAnnotationKey to allow migration to happen smoothly
* fix default value for krshape
* include clarifying comment
* Introduce `NewContext`, deprecate `NewImplFull`.
Our generated `NewImpl` methods have long taken `context.Context`, but despite many iterations the forms we expose from our `controller` package never have. This change contains several elements:
1. Expose a new `NewContext` method that takes `context.Context` in addition to the current `NewImplFull` signature.
2. Call `NewContext` instead of the deprecated `NewImpl` from our generated controller code.
3. Call `NewContext` from all our webhook reconcilers.
* Add a Tracker to controller.Impl to cut down on downstream boilerplate.
* Fix#2003
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
* Removed useless newline
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
* Removed useless check
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
* Now we don't have any newlines anymore
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
* Add an option to skip automated status updates in a reconciler.
This option is necessary to be able to create reconcilers like Serving's labeler, that is purely adding labels to resources. If that fails, the new automated observed generation handling changes the status and that gets written to the API currently, which is not desired.
* Flip the bool.
* Add the ability to override controller agent name
- controller can set agent name via context. If nothing is set then
controller falls back to default controller agent name
* Check if context name is not nil and can be casted to string before returning.
* Create EventRecorder after we determine the controller agent name
* Address comments
Signed-off-by: Andrew Su <asu@pivotal.io>
* Remove check for if recorder is nil
Co-authored-by: Andrew Su <asu@pivotal.io>
This changes the names we give workqueues in genreconciler to avoid collisions when multiple reconcilers in a single process use the same generated reconciler base.
There are a few examples of this in serving, both route and configuration have collisions. Right now I think this mainly affects metrics published by the workqueues, but I noticed this leveraging the same for resource lock naming.
* fix rando issues
* code in the group for finalizer name.
* Use FinalizeKind
* show the Finalizer interface.
* removing isFinalizing
* sync finalizers before calling reconcilekind
* missed the events change.
* adding a reconciler generator to use as the base reconcilers for all of knative.
* mend
* fix tag names.
* use reconciler events
* trying new thing.
* base working reconciler gen
* working cleaned up reconciler generator.
* fix typo
* fix some ordering.
* fix interface path
* fix whitespace
* update deps.
* updates based on feedback.
* Remove core loop.
* reconcilerImpl
* add NewReconciler
* Fix copyright header
* Comment out finalizers
* remove finalizers from generated code.