ContainerImage.Pinniped/internal/controller/informer.go
Monis Khan d4eeb74641
Add initial controller boilerplate and example controller
Signed-off-by: Monis Khan <mok@vmware.com>
2020-07-22 22:27:55 -04:00

26 lines
763 B
Go

/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
package controller
import "k8s.io/client-go/tools/cache"
type InformerGetter interface {
Informer() cache.SharedIndexInformer
}
type InformerOption struct {
SkipSync bool
SkipEvents bool
// TODO maybe add a field like:
// ResyncPeriod time.Duration
// to support using AddEventHandlerWithResyncPeriod
// this field would be mutually exclusive with SkipEvents
// I suspect we do not need this level of flexibility and resyncs can mask bugs in controller logic
// A related change could be an Option such as WithResyncSchedule to allow for cron style control loops
// It is unclear to me if we would ever need that since we assume that all events come from a Kube watch
}