-
Notifications
You must be signed in to change notification settings - Fork 0
/
reconciler.go
29 lines (23 loc) · 1.11 KB
/
reconciler.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package cloudeventssource
import (
"context"
"knative.dev/pkg/reconciler"
commonv1alpha1 "github.com/zeiss/typhoon/pkg/apis/common/v1alpha1"
"github.com/zeiss/typhoon/pkg/apis/sources/v1alpha1"
reconcilerv1alpha1 "github.com/zeiss/typhoon/pkg/client/generated/injection/reconciler/sources/v1alpha1/cloudeventssource"
listersv1alpha1 "github.com/zeiss/typhoon/pkg/client/generated/listers/sources/v1alpha1"
common "github.com/zeiss/typhoon/pkg/reconciler"
)
// Reconciler implements controller.Reconciler for the event source type.
type Reconciler struct {
base common.GenericServiceReconciler[*v1alpha1.CloudEventsSource, listersv1alpha1.CloudEventsSourceNamespaceLister]
adapterCfg *adapterConfig
}
// Check that our Reconciler implements Interface
var _ reconcilerv1alpha1.Interface = (*Reconciler)(nil)
// ReconcileKind implements Interface.ReconcileKind.
func (r *Reconciler) ReconcileKind(ctx context.Context, o *v1alpha1.CloudEventsSource) reconciler.Event {
// inject source into context for usage in reconciliation logic
ctx = commonv1alpha1.WithReconcilable(ctx, o)
return r.base.ReconcileAdapter(ctx, r)
}