Reuse TCP connections in Reflector between resync periods.

This commit is contained in:
Wojciech Tyczynski
2015-10-26 10:34:45 +01:00
parent a094a6e3de
commit d47e21f19f
37 changed files with 184 additions and 108 deletions

View File

@@ -102,8 +102,7 @@ func NewLimitRanger(client client.Interface, limitFunc LimitFunc) admission.Inte
ListFunc: func() (runtime.Object, error) {
return client.LimitRanges(api.NamespaceAll).List(labels.Everything(), fields.Everything())
},
WatchFunc: func(resourceVersion string) (watch.Interface, error) {
options := api.ListOptions{ResourceVersion: resourceVersion}
WatchFunc: func(options api.ListOptions) (watch.Interface, error) {
return client.LimitRanges(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
},
}

View File

@@ -87,8 +87,7 @@ func NewProvision(c client.Interface) admission.Interface {
ListFunc: func() (runtime.Object, error) {
return c.Namespaces().List(labels.Everything(), fields.Everything())
},
WatchFunc: func(resourceVersion string) (watch.Interface, error) {
options := api.ListOptions{ResourceVersion: resourceVersion}
WatchFunc: func(options api.ListOptions) (watch.Interface, error) {
return c.Namespaces().Watch(labels.Everything(), fields.Everything(), options)
},
},

View File

@@ -94,8 +94,7 @@ func NewExists(c client.Interface) admission.Interface {
ListFunc: func() (runtime.Object, error) {
return c.Namespaces().List(labels.Everything(), fields.Everything())
},
WatchFunc: func(resourceVersion string) (watch.Interface, error) {
options := api.ListOptions{ResourceVersion: resourceVersion}
WatchFunc: func(options api.ListOptions) (watch.Interface, error) {
return c.Namespaces().Watch(labels.Everything(), fields.Everything(), options)
},
},

View File

@@ -111,8 +111,7 @@ func NewLifecycle(c client.Interface) admission.Interface {
ListFunc: func() (runtime.Object, error) {
return c.Namespaces().List(labels.Everything(), fields.Everything())
},
WatchFunc: func(resourceVersion string) (watch.Interface, error) {
options := api.ListOptions{ResourceVersion: resourceVersion}
WatchFunc: func(options api.ListOptions) (watch.Interface, error) {
return c.Namespaces().Watch(labels.Everything(), fields.Everything(), options)
},
},

View File

@@ -53,8 +53,7 @@ func NewResourceQuota(client client.Interface) admission.Interface {
ListFunc: func() (runtime.Object, error) {
return client.ResourceQuotas(api.NamespaceAll).List(labels.Everything(), fields.Everything())
},
WatchFunc: func(resourceVersion string) (watch.Interface, error) {
options := api.ListOptions{ResourceVersion: resourceVersion}
WatchFunc: func(options api.ListOptions) (watch.Interface, error) {
return client.ResourceQuotas(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
},
}

View File

@@ -85,8 +85,7 @@ func NewServiceAccount(cl client.Interface) *serviceAccount {
ListFunc: func() (runtime.Object, error) {
return cl.ServiceAccounts(api.NamespaceAll).List(labels.Everything(), fields.Everything())
},
WatchFunc: func(resourceVersion string) (watch.Interface, error) {
options := api.ListOptions{ResourceVersion: resourceVersion}
WatchFunc: func(options api.ListOptions) (watch.Interface, error) {
return cl.ServiceAccounts(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
},
},
@@ -100,8 +99,7 @@ func NewServiceAccount(cl client.Interface) *serviceAccount {
ListFunc: func() (runtime.Object, error) {
return cl.Secrets(api.NamespaceAll).List(labels.Everything(), tokenSelector)
},
WatchFunc: func(resourceVersion string) (watch.Interface, error) {
options := api.ListOptions{ResourceVersion: resourceVersion}
WatchFunc: func(options api.ListOptions) (watch.Interface, error) {
return cl.Secrets(api.NamespaceAll).Watch(labels.Everything(), tokenSelector, options)
},
},