-
Notifications
You must be signed in to change notification settings - Fork 0
/
reconciler.go
30 lines (23 loc) · 1.08 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
30
package jiratarget
import (
"context"
"knative.dev/pkg/reconciler"
commonv1alpha1 "github.com/zeiss/typhoon/pkg/apis/common/v1alpha1"
"github.com/zeiss/typhoon/pkg/apis/targets/v1alpha1"
reconcilerv1alpha1 "github.com/zeiss/typhoon/pkg/client/generated/injection/reconciler/targets/v1alpha1/jiratarget"
listersv1alpha1 "github.com/zeiss/typhoon/pkg/client/generated/listers/targets/v1alpha1"
common "github.com/zeiss/typhoon/pkg/reconciler"
)
// Reconciler implements controller.Reconciler for the event target type.
type Reconciler struct {
base common.GenericServiceReconciler[*v1alpha1.JiraTarget, listersv1alpha1.JiraTargetNamespaceLister]
adapterCfg *adapterConfig
}
// Check that our Reconciler implements Interface
var _ reconcilerv1alpha1.Interface = (*Reconciler)(nil)
// ReconcileKind implements Interface.ReconcileKind.
func (r *Reconciler) ReconcileKind(ctx context.Context, trg *v1alpha1.JiraTarget) reconciler.Event {
// inject target into context for usage in reconciliation logic
ctx = commonv1alpha1.WithReconcilable(ctx, trg)
return r.base.ReconcileAdapter(ctx, r)
}