Commit 213ee26d authored by Geoff Simmons's avatar Geoff Simmons

Add the CLI option resyncPeriod to the controller.

parent 88d54284
...@@ -81,6 +81,10 @@ var ( ...@@ -81,6 +81,10 @@ var (
ingressClassF = flag.String("class", "varnish", "value of the Ingress "+ ingressClassF = flag.String("class", "varnish", "value of the Ingress "+
"annotation kubernetes.io/ingress.class\nthe controller only "+ "annotation kubernetes.io/ingress.class\nthe controller only "+
"considers Ingresses with this value for the\nannotation") "considers Ingresses with this value for the\nannotation")
resyncPeriodF = flag.Duration("resyncPeriod", 30*time.Second,
"if non-zero, re-update the controller with the state of\n"+
"the cluster this often, even if nothing has changed,\n"+
"to synchronize state that may have been missed")
logFormat = logrus.TextFormatter{ logFormat = logrus.TextFormatter{
DisableColors: true, DisableColors: true,
FullTimestamp: true, FullTimestamp: true,
...@@ -93,10 +97,6 @@ var ( ...@@ -93,10 +97,6 @@ var (
informerStop = make(chan struct{}) informerStop = make(chan struct{})
) )
const resyncPeriod = 0
// resyncPeriod = 30 * time.Second
// Satisifes type TweakListOptionsFunc in // Satisifes type TweakListOptionsFunc in
// k8s.io/client-go/informers/internalinterfaces, for use in // k8s.io/client-go/informers/internalinterfaces, for use in
// NewFilteredSharedInformerFactory below. // NewFilteredSharedInformerFactory below.
...@@ -177,20 +177,20 @@ func main() { ...@@ -177,20 +177,20 @@ func main() {
var vcrInformerFactory vcr_informers.SharedInformerFactory var vcrInformerFactory vcr_informers.SharedInformerFactory
if *namespaceF == api_v1.NamespaceAll { if *namespaceF == api_v1.NamespaceAll {
informerFactory = informers.NewSharedInformerFactory( informerFactory = informers.NewSharedInformerFactory(
kubeClient, resyncPeriod) kubeClient, *resyncPeriodF)
vcrInformerFactory = vcr_informers.NewSharedInformerFactory( vcrInformerFactory = vcr_informers.NewSharedInformerFactory(
vingClient, resyncPeriod) vingClient, *resyncPeriodF)
} else { } else {
informerFactory = informers.NewFilteredSharedInformerFactory( informerFactory = informers.NewFilteredSharedInformerFactory(
kubeClient, resyncPeriod, *namespaceF, noop) kubeClient, *resyncPeriodF, *namespaceF, noop)
vcrInformerFactory = vcrInformerFactory =
vcr_informers.NewFilteredSharedInformerFactory( vcr_informers.NewFilteredSharedInformerFactory(
vingClient, resyncPeriod, *namespaceF, noop) vingClient, *resyncPeriodF, *namespaceF, noop)
// XXX this is prefered, but only available in newer // XXX this is prefered, but only available in newer
// versions of client-go. // versions of client-go.
// informerFactory = informers.NewSharedInformerFactoryWithOptions( // informerFactory = informers.NewSharedInformerFactoryWithOptions(
// kubeClient, resyncPeriod, // kubeClient, *resyncPeriodF,
// informers.WithNamespace(*namespaceF)) // informers.WithNamespace(*namespaceF))
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment