From e8fe7b71106ea583293c04703618e21648623675 Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Tue, 22 Sep 2020 15:58:21 -0400 Subject: [PATCH] make pingsource adapter controller read-only --- pkg/adapter/mtping/controller.go | 6 +++++- pkg/adapter/mtping/pingsource.go | 6 +----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/adapter/mtping/controller.go b/pkg/adapter/mtping/controller.go index 155c0e8a82f..c039b46b2e0 100644 --- a/pkg/adapter/mtping/controller.go +++ b/pkg/adapter/mtping/controller.go @@ -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)) diff --git a/pkg/adapter/mtping/pingsource.go b/pkg/adapter/mtping/pingsource.go index 33f63867df9..6bae4b1fecd 100644 --- a/pkg/adapter/mtping/pingsource.go +++ b/pkg/adapter/mtping/pingsource.go @@ -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