diff --git a/pkg/apis/eventing/v1beta1/broker_types.go b/pkg/apis/eventing/v1beta1/broker_types.go index 7e785a4d486..2fdd97aa205 100644 --- a/pkg/apis/eventing/v1beta1/broker_types.go +++ b/pkg/apis/eventing/v1beta1/broker_types.go @@ -28,7 +28,7 @@ import ( ) // +genclient -// +genreconciler:class=eventing.knative.dev/broker.class +// +genreconciler:class=eventing.knative.dev/broker.class,krshapedlogic=true // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Broker collects a pool of events that are consumable using Triggers. Brokers diff --git a/pkg/apis/eventing/v1beta1/eventtype_types.go b/pkg/apis/eventing/v1beta1/eventtype_types.go index 6a480b6f007..6b24a2d0eeb 100644 --- a/pkg/apis/eventing/v1beta1/eventtype_types.go +++ b/pkg/apis/eventing/v1beta1/eventtype_types.go @@ -26,7 +26,7 @@ import ( ) // +genclient -// +genreconciler +// +genreconciler:krshapedlogic=true // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type EventType struct { diff --git a/pkg/apis/eventing/v1beta1/trigger_types.go b/pkg/apis/eventing/v1beta1/trigger_types.go index 3021028391f..e6ce9a4e491 100644 --- a/pkg/apis/eventing/v1beta1/trigger_types.go +++ b/pkg/apis/eventing/v1beta1/trigger_types.go @@ -34,7 +34,7 @@ const ( ) // +genclient -// +genreconciler +// +genreconciler:krshapedlogic=true // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Trigger represents a request to have events delivered to a consumer from a diff --git a/pkg/client/injection/reconciler/eventing/v1beta1/broker/reconciler.go b/pkg/client/injection/reconciler/eventing/v1beta1/broker/reconciler.go index 40af2104d74..c47e5e56c78 100644 --- a/pkg/client/injection/reconciler/eventing/v1beta1/broker/reconciler.go +++ b/pkg/client/injection/reconciler/eventing/v1beta1/broker/reconciler.go @@ -175,10 +175,14 @@ func (r *reconcilerImpl) Reconcile(ctx context.Context, key string) error { logger.Warnw("Failed to set finalizers", zap.Error(err)) } + reconciler.PreProcessReconcile(ctx, resource) + // Reconcile this copy of the resource and then write back any status // updates regardless of whether the reconciliation errored out. reconcileEvent = r.reconciler.ReconcileKind(ctx, resource) + reconciler.PostProcessReconcile(ctx, resource) + } else if fin, ok := r.reconciler.(Finalizer); ok { // Append the target method to the logger. logger = logger.With(zap.String("targetMethod", "FinalizeKind")) diff --git a/pkg/client/injection/reconciler/eventing/v1beta1/eventtype/reconciler.go b/pkg/client/injection/reconciler/eventing/v1beta1/eventtype/reconciler.go index c2c68a3062d..2db828a5b11 100644 --- a/pkg/client/injection/reconciler/eventing/v1beta1/eventtype/reconciler.go +++ b/pkg/client/injection/reconciler/eventing/v1beta1/eventtype/reconciler.go @@ -164,10 +164,14 @@ func (r *reconcilerImpl) Reconcile(ctx context.Context, key string) error { logger.Warnw("Failed to set finalizers", zap.Error(err)) } + reconciler.PreProcessReconcile(ctx, resource) + // Reconcile this copy of the resource and then write back any status // updates regardless of whether the reconciliation errored out. reconcileEvent = r.reconciler.ReconcileKind(ctx, resource) + reconciler.PostProcessReconcile(ctx, resource) + } else if fin, ok := r.reconciler.(Finalizer); ok { // Append the target method to the logger. logger = logger.With(zap.String("targetMethod", "FinalizeKind")) diff --git a/pkg/client/injection/reconciler/eventing/v1beta1/trigger/reconciler.go b/pkg/client/injection/reconciler/eventing/v1beta1/trigger/reconciler.go index a55894cf192..a6a3e5c1fb8 100644 --- a/pkg/client/injection/reconciler/eventing/v1beta1/trigger/reconciler.go +++ b/pkg/client/injection/reconciler/eventing/v1beta1/trigger/reconciler.go @@ -164,10 +164,14 @@ func (r *reconcilerImpl) Reconcile(ctx context.Context, key string) error { logger.Warnw("Failed to set finalizers", zap.Error(err)) } + reconciler.PreProcessReconcile(ctx, resource) + // Reconcile this copy of the resource and then write back any status // updates regardless of whether the reconciliation errored out. reconcileEvent = r.reconciler.ReconcileKind(ctx, resource) + reconciler.PostProcessReconcile(ctx, resource) + } else if fin, ok := r.reconciler.(Finalizer); ok { // Append the target method to the logger. logger = logger.With(zap.String("targetMethod", "FinalizeKind"))