Commit Graph

16 Commits

Author SHA1 Message Date
Markus Thömmes a92c682188
Add an option to skip automated status updates in a reconciler. (#1456)
* 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.
2020-06-30 08:02:29 -07:00
Matt Moore 5e60b6f863
Implement the fourth wave of per-reconciler leaderelection. (#1304)
With this, all downstream `// +genreconciler` reconcilers will become leader-aware and expose a model for the typed reconcilers they wrap to themselves become leader-aware.

Detailed design: https://docs.google.com/document/d/1i_QHjQO2T3SNv49xjZLWlivcc0UvZN1Tbw2NKxThkyM/edit#
Issue: https://github.com/knative/pkg/issues/1181
2020-06-21 18:58:26 -07:00
Shashwathi 93be3f499d
Add ability to override controller agent name (#1240)
* 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>
2020-05-02 10:00:43 -07:00
Matt Moore d0328aa36b
Generate unique workqueue names. (#1255)
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.
2020-04-28 07:44:52 -07:00
Markus Thömmes 6103dd9b71
Add a controller option to specify a custom finalizer name. (#1230) 2020-04-22 14:55:40 -07:00
Markus Thömmes 5605ade524
Add filtering to class based controller stubs. (#1133) 2020-03-03 12:57:53 -08:00
Scott Nichols 5d8a01d12c
Implement strongly typed class reconcilers (#1103)
* Implement strongly typed class reconcilers

* document class filters.

* matt is always right
2020-02-19 08:38:06 -08:00
Scott Nichols d93ce78496
[Reconciler Generators] Adding support for configStore.ToContext (#1085)
* Support optional config maps.

* document configmap stores

* whitespace.

* optionsFns

* review

* check for nil.

* zero trust imports.
2020-02-12 16:10:35 -08:00
Matt Moore dddb2d8753
golang format tools (#1072)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)`
  `goimports -w $(find -name '*.go' | grep -v vendor | grep -v third_party)`
/assign n3wscott
/cc n3wscott
2020-02-11 07:13:07 -08:00
Scott Nichols 248c9f0353
fix filtering for reconcilers gen. (#1071) 2020-02-11 05:26:07 -08:00
Scott Nichols 85608a8329
Generate Managed Finalizers for Reconcilers (#1069)
* 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.
2020-02-10 19:46:06 -08:00
Matt Moore 8e404c7c40
golang format tools (#1056)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)`
  `goimports -w $(find -name '*.go' | grep -v vendor | grep -v third_party)`
/assign n3wscott
/cc n3wscott
2020-02-06 16:57:32 -08:00
Scott Nichols b63641488a
fix event recorder (#1053) 2020-02-05 13:51:31 -08:00
Matt Moore 5660964262
golang format tools (#1051)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)`
  `goimports -w $(find -name '*.go' | grep -v vendor | grep -v third_party)`
/assign n3wscott
/cc n3wscott
2020-02-05 07:57:31 -08:00
Scott Nichols b9974987c2
Fix issue with returning errors, and not adding scheme (#1049) 2020-02-04 18:03:30 -08:00
Scott Nichols b317048346
Generate Base Reconciler Code for Injection Based Controllers. (#947)
* 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.
2020-02-04 10:23:30 -08:00