Skip to content

Commit

Permalink
make pingsource adapter controller read-only (#4099)
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelvillard authored Sep 23, 2020
1 parent baa7cd3 commit 5741e8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 5 additions & 1 deletion pkg/adapter/mtping/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ func NewController(ctx context.Context, adapter adapter.Adapter) *controller.Imp
// }
//}

impl := pingsourcereconciler.NewImpl(ctx, r)
impl := pingsourcereconciler.NewImpl(ctx, r, func(impl *controller.Impl) controller.Options {
return controller.Options{
SkipStatusUpdates: true,
}
})

logging.FromContext(ctx).Info("Setting up event handlers")
pingsourceinformer.Get(ctx).Informer().AddEventHandler(controller.HandleAll(impl.Enqueue))
Expand Down
6 changes: 1 addition & 5 deletions pkg/adapter/mtping/pingsource.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ var _ pingsourcereconciler.Finalizer = (*Reconciler)(nil)

func (r *Reconciler) ReconcileKind(ctx context.Context, source *v1beta1.PingSource) reconciler.Event {
if !source.Status.IsReady() {
// The source might have been previously ready
// Make sure the adapter does not handle it
r.mtadapter.Remove(ctx, source)

return fmt.Errorf("PingSource is not ready")
return fmt.Errorf("warning: PingSource is not ready")
}

// Update the adapter state
Expand Down

0 comments on commit 5741e8f

Please sign in to comment.