From 71b23f2c707439c6884422d8ecbfd606af6ed529 Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Mon, 21 Sep 2020 14:53:42 -0400 Subject: [PATCH] remove reference to persisted store --- docs/source/receive-adapter.md | 36 ---------------------------------- 1 file changed, 36 deletions(-) diff --git a/docs/source/receive-adapter.md b/docs/source/receive-adapter.md index 041482d456e..4bf05239186 100644 --- a/docs/source/receive-adapter.md +++ b/docs/source/receive-adapter.md @@ -89,48 +89,12 @@ Controller watcher feature, as follows: func main() { ctx := signals.NewContext() ctx = adapter.WithController(ctx, youradapter.NewController) - ctx = adapter.WithConfigMapWatcherEnabled(ctx) adapter.MainWithContext(ctx, "yourcomponent", youradapter.NewEnvConfig, youradapter.NewAdapter) } ``` -The library automatically creates a watcher on the ConfigMap named -`config-yourcomponent`. In order to react to any ConfigMap changes, in your -adapter constructor (`NewAdapter`), you must add a ConfigMap watcher, as -follows: - -```go -func NewAdapter(ctx context.Context, - _ adapter.EnvConfigAccessor, - ceClient cloudevents.Client) adapter.Adapter { - youradapter := ... - - cmw := adapter.ConfigMapWatcherFromContext(ctx) - cmw.Watch("config-yourcomponent", youradapter.updateFromConfigMap) - - return youradapter -} -``` - -The controller associated to the receive adapter generates the ConfigMap. It -relies on the [persistent store](../../pkg/utils/cache/persisted_store.go) -utility. Add these lines to your controller to enable it. - -```go -// Create and start persistent store backed by ConfigMaps -store := eventingcache.NewPersistedStore( - "yourcomponent", - kubeclient.Get(ctx), - system.Namespace(), - "config-yourcomponent", - yourcomponentInformer.Informer(), - yourcomponent.Project) - -go store.Run(ctx) -``` - ## Logging, metrics and tracing The adapter main code automatically sets up logging, a metrics server,