Commit Graph

9 Commits

Author SHA1 Message Date
Dave Protasowski 5671699f23
drop the dynamic type (#2750) 2023-05-31 07:39:36 +00:00
Pierangelo Di Pilato d82be484e4
Disable controllers using a command-line flag (#2339)
* Disable controllers using a flag

This patch allows disabling controllers when using a new `Main` function
called `MainNamed` which takes a list of `NamedControllerConstructor`.

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>

* Apply reviews

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>

* Add comments, split filter and conversion

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>

* Allocate len(ctors)

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>

* to disable -> disabling

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
2021-11-16 13:30:53 -08:00
Matt Moore 7b5ecbc0e4
Sketch out an alternate way of injecting clients/informers (#2210)
* This commit contains the actual changes to support dynamic client injection.

* Incorporate n3wscott review nits

* This includes the code-generation for the dynamic client-based injection.

This also includes a number of manually created files of the form `*_expansion.go`, which are needed to satisfy some of the Kubernetes manual type "expansions".  At present, these are all simply `panic("NYI")`, but may become more than that in the future.
2021-08-18 06:52:08 -07:00
Markus Thömmes bbe0bb3eb1
Implement getter machinery to generically fetch all injected clients (#2054) 2021-03-10 09:35:25 -08:00
qibobo 1bbf0a6436
add LabelSelector to InformerFactory so that the informers only list and watch resources with the given labels (#1940)
* add  filtered InformerFactory and informers which only list and watch resources with the given labels

* rename to RegisterFilteredInformers

* generated files

* typo

* update per comments

* rename file

* rm old files
2021-01-19 08:21:23 -08:00
Matt Moore 43ca049cdb Reduce the boilerplate for setting up duck.InformerFactory's. (#896)
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`.
2019-11-25 09:57:10 -08:00
Matt Moore 222dd25986 Migrate pkg to use the knative.dev/pkg import path (#489)
* Manual changes.

* scripted changes.
2019-06-26 13:02:06 -07:00
Matt Moore d8a2a739d6 Eliminate controller registration in favor of passing a list to the shared main. (#447) 2019-06-06 18:17:41 -07:00
Matt Moore 4c630bb1bb Create a library for Reconciler dependency injection. (#423)
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`).
2019-06-05 07:37:38 -07:00