Skip to content

Commit ed81fa6

Browse files
authored
Merge pull request kubernetes-sigs#2796 from alvaroaleman/mark
📖 Mark Typed Handlers as experimental
2 parents b74908f + b35cd6b commit ed81fa6

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

pkg/handler/enqueue.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ type EnqueueRequestForObject = TypedEnqueueRequestForObject[client.Object]
4242
// TypedEnqueueRequestForObject enqueues a Request containing the Name and Namespace of the object that is the source of the Event.
4343
// (e.g. the created / deleted / updated objects Name and Namespace). handler.TypedEnqueueRequestForObject is used by almost all
4444
// Controllers that have associated Resources (e.g. CRDs) to reconcile the associated Resource.
45+
//
46+
// TypedEnqueueRequestForObject is experimental and subject to future change.
4547
type TypedEnqueueRequestForObject[T client.Object] struct{}
4648

4749
// Create implements EventHandler.

pkg/handler/enqueue_mapped.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ type MapFunc = TypedMapFunc[client.Object]
3131

3232
// TypedMapFunc is the signature required for enqueueing requests from a generic function.
3333
// This type is usually used with EnqueueRequestsFromTypedMapFunc when registering an event handler.
34+
//
35+
// TypedMapFunc is experimental and subject to future change.
3436
type TypedMapFunc[T any] func(context.Context, T) []reconcile.Request
3537

3638
// EnqueueRequestsFromMapFunc enqueues Requests by running a transformation function that outputs a collection
@@ -57,6 +59,8 @@ func EnqueueRequestsFromMapFunc(fn MapFunc) EventHandler {
5759
//
5860
// For TypedUpdateEvents which contain both a new and old object, the transformation function is run on both
5961
// objects and both sets of Requests are enqueue.
62+
//
63+
// TypedEnqueueRequestsFromMapFunc is experimental and subject to future change.
6064
func TypedEnqueueRequestsFromMapFunc[T any](fn TypedMapFunc[T]) TypedEventHandler[T] {
6165
return &enqueueRequestsFromMapFunc[T]{
6266
toRequests: fn,

pkg/handler/enqueue_owner.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ func EnqueueRequestForOwner(scheme *runtime.Scheme, mapper meta.RESTMapper, owne
5959
// - a source.Kind Source with Type of Pod.
6060
//
6161
// - a handler.typedEnqueueRequestForOwner EventHandler with an OwnerType of ReplicaSet and OnlyControllerOwner set to true.
62+
//
63+
// TypedEnqueueRequestForOwner is experimental and subject to future change.
6264
func TypedEnqueueRequestForOwner[T client.Object](scheme *runtime.Scheme, mapper meta.RESTMapper, ownerType client.Object, opts ...OwnerOption) TypedEventHandler[T] {
6365
e := &enqueueRequestForOwner[T]{
6466
ownerType: ownerType,

pkg/handler/eventhandler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ type EventHandler TypedEventHandler[client.Object]
6262
//
6363
// Unless you are implementing your own TypedEventHandler, you can ignore the functions on the TypedEventHandler interface.
6464
// Most users shouldn't need to implement their own TypedEventHandler.
65+
//
66+
// TypedEventHandler is experimental and subject to future change.
6567
type TypedEventHandler[T any] interface {
6668
// Create is called in response to a create event - e.g. Pod Creation.
6769
Create(context.Context, event.TypedCreateEvent[T], workqueue.RateLimitingInterface)
@@ -83,6 +85,8 @@ var _ EventHandler = Funcs{}
8385
type Funcs = TypedFuncs[client.Object]
8486

8587
// TypedFuncs implements eventhandler.
88+
//
89+
// TypedFuncs is experimental and subject to future change.
8690
type TypedFuncs[T any] struct {
8791
// Create is called in response to an add event. Defaults to no-op.
8892
// RateLimitingInterface is used to enqueue reconcile.Requests.

0 commit comments

Comments
 (0)