From b09c1ce5ddb7473b8b9dd5d63b46267381ed852f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Orive?= Date: Wed, 14 Nov 2018 08:36:38 +0100 Subject: [PATCH] Add newInformer documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrián Orive --- .../src/k8s.io/client-go/tools/cache/controller.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/staging/src/k8s.io/client-go/tools/cache/controller.go b/staging/src/k8s.io/client-go/tools/cache/controller.go index 5eeb83c8e78..bce29c97599 100644 --- a/staging/src/k8s.io/client-go/tools/cache/controller.go +++ b/staging/src/k8s.io/client-go/tools/cache/controller.go @@ -317,6 +317,20 @@ func NewIndexerInformer( return clientState, newInformer(lw, objType, resyncPeriod, h, clientState) } +// newInformer returns a controller for populating the store while also +// providing event notifications. +// +// Parameters +// * lw is list and watch functions for the source of the resource you want to +// be informed of. +// * objType is an object of the type that you expect to receive. +// * resyncPeriod: if non-zero, will re-list this often (you will get OnUpdate +// calls, even if nothing changed). Otherwise, re-list will be delayed as +// long as possible (until the upstream source closes the watch or times out, +// or you stop the controller). +// * h is the object you want notifications sent to. +// * clientState is the store you want to populate +// func newInformer( lw ListerWatcher, objType runtime.Object,