Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
a915b8b2
Commit
a915b8b2
authored
Dec 09, 2015
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #18080 from wojtek-t/list_options_in_listwatch
Pass ListOptions to List in ListWatch.
parents
78c31b67
b0fcb5ad
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
105 additions
and
101 deletions
+105
-101
executor_test.go
contrib/mesos/pkg/executor/executor_test.go
+1
-1
integration_test.go
contrib/mesos/pkg/scheduler/integration/integration_test.go
+1
-1
endpoints_controller.go
contrib/mesos/pkg/service/endpoints_controller.go
+4
-4
listwatch.go
pkg/client/cache/listwatch.go
+5
-4
listwatch_test.go
pkg/client/cache/listwatch_test.go
+1
-1
reflector.go
pkg/client/cache/reflector.go
+3
-2
reflector_test.go
pkg/client/cache/reflector_test.go
+3
-1
controller.go
pkg/controller/daemon/controller.go
+6
-6
endpoints_controller.go
pkg/controller/endpoint/endpoints_controller.go
+4
-4
fake_controller_source.go
pkg/controller/framework/fake_controller_source.go
+1
-1
fake_controller_source_test.go
pkg/controller/framework/fake_controller_source_test.go
+1
-1
gc_controller.go
pkg/controller/gc/gc_controller.go
+2
-2
controller.go
pkg/controller/job/controller.go
+4
-4
namespace_controller.go
pkg/controller/namespace/namespace_controller.go
+2
-2
nodecontroller.go
pkg/controller/node/nodecontroller.go
+4
-4
persistentvolume_claim_binder_controller.go
...sistentvolume/persistentvolume_claim_binder_controller.go
+4
-4
persistentvolume_recycler_controller.go
.../persistentvolume/persistentvolume_recycler_controller.go
+2
-2
replication_controller.go
pkg/controller/replication/replication_controller.go
+4
-4
resource_quota_controller.go
pkg/controller/resourcequota/resource_quota_controller.go
+4
-4
serviceaccounts_controller.go
pkg/controller/serviceaccount/serviceaccounts_controller.go
+4
-4
tokens_controller.go
pkg/controller/serviceaccount/tokens_controller.go
+4
-4
apiserver_test.go
pkg/kubelet/config/apiserver_test.go
+1
-1
kubelet.go
pkg/kubelet/kubelet.go
+4
-4
api_test.go
pkg/proxy/config/api_test.go
+1
-1
cacher.go
pkg/storage/cacher.go
+1
-1
watch_cache_test.go
pkg/storage/watch_cache_test.go
+5
-3
util.go
pkg/volume/util.go
+2
-2
admission.go
plugin/pkg/admission/limitranger/admission.go
+2
-2
admission.go
plugin/pkg/admission/namespace/autoprovision/admission.go
+2
-2
admission.go
plugin/pkg/admission/namespace/exists/admission.go
+2
-2
admission.go
plugin/pkg/admission/namespace/lifecycle/admission.go
+2
-2
admission.go
plugin/pkg/admission/resourcequota/admission.go
+2
-2
admission.go
plugin/pkg/admission/serviceaccount/admission.go
+4
-4
daemon_restart.go
test/e2e/daemon_restart.go
+2
-2
density.go
test/e2e/density.go
+4
-4
latency.go
test/e2e/latency.go
+2
-2
service_latency.go
test/e2e/service_latency.go
+2
-2
util.go
test/e2e/util.go
+3
-5
No files found.
contrib/mesos/pkg/executor/executor_test.go
View file @
a915b8b2
...
@@ -523,7 +523,7 @@ func NewMockPodsListWatch(initialPodList api.PodList) *MockPodsListWatch {
...
@@ -523,7 +523,7 @@ func NewMockPodsListWatch(initialPodList api.PodList) *MockPodsListWatch {
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
lw
.
fakeWatcher
,
nil
return
lw
.
fakeWatcher
,
nil
},
},
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
&
lw
.
list
,
nil
return
&
lw
.
list
,
nil
},
},
}
}
...
...
contrib/mesos/pkg/scheduler/integration/integration_test.go
View file @
a915b8b2
...
@@ -173,7 +173,7 @@ func NewMockPodsListWatch(initialPodList api.PodList) *MockPodsListWatch {
...
@@ -173,7 +173,7 @@ func NewMockPodsListWatch(initialPodList api.PodList) *MockPodsListWatch {
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
lw
.
fakeWatcher
,
nil
return
lw
.
fakeWatcher
,
nil
},
},
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
lw
.
lock
.
Lock
()
lw
.
lock
.
Lock
()
defer
lw
.
lock
.
Unlock
()
defer
lw
.
lock
.
Unlock
()
...
...
contrib/mesos/pkg/service/endpoints_controller.go
View file @
a915b8b2
...
@@ -58,8 +58,8 @@ func NewEndpointController(client *client.Client) *endpointController {
...
@@ -58,8 +58,8 @@ func NewEndpointController(client *client.Client) *endpointController {
}
}
e
.
serviceStore
.
Store
,
e
.
serviceController
=
framework
.
NewInformer
(
e
.
serviceStore
.
Store
,
e
.
serviceController
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
e
.
client
.
Services
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
e
.
client
.
Services
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
e
.
client
.
Services
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
e
.
client
.
Services
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
@@ -78,8 +78,8 @@ func NewEndpointController(client *client.Client) *endpointController {
...
@@ -78,8 +78,8 @@ func NewEndpointController(client *client.Client) *endpointController {
e
.
podStore
.
Store
,
e
.
podController
=
framework
.
NewInformer
(
e
.
podStore
.
Store
,
e
.
podController
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
e
.
client
.
Pods
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
e
.
client
.
Pods
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
e
.
client
.
Pods
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
e
.
client
.
Pods
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
...
pkg/client/cache/listwatch.go
View file @
a915b8b2
...
@@ -28,7 +28,7 @@ import (
...
@@ -28,7 +28,7 @@ import (
)
)
// ListFunc knows how to list resources
// ListFunc knows how to list resources
type
ListFunc
func
()
(
runtime
.
Object
,
error
)
type
ListFunc
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
// WatchFunc knows how to watch resources
// WatchFunc knows how to watch resources
type
WatchFunc
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
type
WatchFunc
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
...
@@ -48,10 +48,11 @@ type Getter interface {
...
@@ -48,10 +48,11 @@ type Getter interface {
// NewListWatchFromClient creates a new ListWatch from the specified client, resource, namespace and field selector.
// NewListWatchFromClient creates a new ListWatch from the specified client, resource, namespace and field selector.
func
NewListWatchFromClient
(
c
Getter
,
resource
string
,
namespace
string
,
fieldSelector
fields
.
Selector
)
*
ListWatch
{
func
NewListWatchFromClient
(
c
Getter
,
resource
string
,
namespace
string
,
fieldSelector
fields
.
Selector
)
*
ListWatch
{
listFunc
:=
func
()
(
runtime
.
Object
,
error
)
{
listFunc
:=
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
c
.
Get
()
.
return
c
.
Get
()
.
Namespace
(
namespace
)
.
Namespace
(
namespace
)
.
Resource
(
resource
)
.
Resource
(
resource
)
.
VersionedParams
(
&
options
,
api
.
Scheme
)
.
FieldsSelectorParam
(
fieldSelector
)
.
FieldsSelectorParam
(
fieldSelector
)
.
Do
()
.
Do
()
.
Get
()
Get
()
...
@@ -76,8 +77,8 @@ func timeoutFromListOptions(options unversioned.ListOptions) time.Duration {
...
@@ -76,8 +77,8 @@ func timeoutFromListOptions(options unversioned.ListOptions) time.Duration {
}
}
// List a set of apiserver resources
// List a set of apiserver resources
func
(
lw
*
ListWatch
)
List
()
(
runtime
.
Object
,
error
)
{
func
(
lw
*
ListWatch
)
List
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
lw
.
ListFunc
()
return
lw
.
ListFunc
(
options
)
}
}
// Watch a set of apiserver resources
// Watch a set of apiserver resources
...
...
pkg/client/cache/listwatch_test.go
View file @
a915b8b2
...
@@ -99,7 +99,7 @@ func TestListWatchesCanList(t *testing.T) {
...
@@ -99,7 +99,7 @@ func TestListWatchesCanList(t *testing.T) {
client
:=
client
.
NewOrDie
(
&
client
.
Config
{
Host
:
server
.
URL
,
GroupVersion
:
testapi
.
Default
.
GroupVersion
()})
client
:=
client
.
NewOrDie
(
&
client
.
Config
{
Host
:
server
.
URL
,
GroupVersion
:
testapi
.
Default
.
GroupVersion
()})
lw
:=
NewListWatchFromClient
(
client
,
item
.
resource
,
item
.
namespace
,
item
.
fieldSelector
)
lw
:=
NewListWatchFromClient
(
client
,
item
.
resource
,
item
.
namespace
,
item
.
fieldSelector
)
// This test merely tests that the correct request is made.
// This test merely tests that the correct request is made.
lw
.
List
()
lw
.
List
(
unversioned
.
ListOptions
{}
)
handler
.
ValidateRequest
(
t
,
item
.
location
,
"GET"
,
nil
)
handler
.
ValidateRequest
(
t
,
item
.
location
,
"GET"
,
nil
)
}
}
}
}
...
...
pkg/client/cache/reflector.go
View file @
a915b8b2
...
@@ -43,7 +43,7 @@ import (
...
@@ -43,7 +43,7 @@ import (
type
ListerWatcher
interface
{
type
ListerWatcher
interface
{
// List should return a list type object; the Items field will be extracted, and the
// List should return a list type object; the Items field will be extracted, and the
// ResourceVersion field will be used to start the watch in the right place.
// ResourceVersion field will be used to start the watch in the right place.
List
()
(
runtime
.
Object
,
error
)
List
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
// Watch should begin a watch at the specified version.
// Watch should begin a watch at the specified version.
Watch
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
Watch
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
}
}
...
@@ -227,7 +227,8 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error {
...
@@ -227,7 +227,8 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error {
resyncCh
,
cleanup
:=
r
.
resyncChan
()
resyncCh
,
cleanup
:=
r
.
resyncChan
()
defer
cleanup
()
defer
cleanup
()
list
,
err
:=
r
.
listerWatcher
.
List
()
options
:=
unversioned
.
ListOptions
{}
list
,
err
:=
r
.
listerWatcher
.
List
(
options
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"%s: Failed to list %v: %v"
,
r
.
name
,
r
.
expectedType
,
err
)
return
fmt
.
Errorf
(
"%s: Failed to list %v: %v"
,
r
.
name
,
r
.
expectedType
,
err
)
}
}
...
...
pkg/client/cache/reflector_test.go
View file @
a915b8b2
...
@@ -35,7 +35,9 @@ type testLW struct {
...
@@ -35,7 +35,9 @@ type testLW struct {
WatchFunc
func
(
resourceVersion
string
)
(
watch
.
Interface
,
error
)
WatchFunc
func
(
resourceVersion
string
)
(
watch
.
Interface
,
error
)
}
}
func
(
t
*
testLW
)
List
()
(
runtime
.
Object
,
error
)
{
return
t
.
ListFunc
()
}
func
(
t
*
testLW
)
List
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
t
.
ListFunc
()
}
func
(
t
*
testLW
)
Watch
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
func
(
t
*
testLW
)
Watch
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
t
.
WatchFunc
(
options
.
ResourceVersion
)
return
t
.
WatchFunc
(
options
.
ResourceVersion
)
}
}
...
...
pkg/controller/daemon/controller.go
View file @
a915b8b2
...
@@ -96,8 +96,8 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
...
@@ -96,8 +96,8 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
// Manage addition/update of daemon sets.
// Manage addition/update of daemon sets.
dsc
.
dsStore
.
Store
,
dsc
.
dsController
=
framework
.
NewInformer
(
dsc
.
dsStore
.
Store
,
dsc
.
dsController
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
dsc
.
kubeClient
.
Extensions
()
.
DaemonSets
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
dsc
.
kubeClient
.
Extensions
()
.
DaemonSets
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
dsc
.
kubeClient
.
Extensions
()
.
DaemonSets
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
dsc
.
kubeClient
.
Extensions
()
.
DaemonSets
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
@@ -128,8 +128,8 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
...
@@ -128,8 +128,8 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
// more pods until all the effects (expectations) of a daemon set's create/delete have been observed.
// more pods until all the effects (expectations) of a daemon set's create/delete have been observed.
dsc
.
podStore
.
Store
,
dsc
.
podController
=
framework
.
NewInformer
(
dsc
.
podStore
.
Store
,
dsc
.
podController
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
dsc
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
dsc
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
dsc
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
dsc
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
@@ -146,8 +146,8 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
...
@@ -146,8 +146,8 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
// Watch for new nodes or updates to nodes - daemon pods are launched on new nodes, and possibly when labels on nodes change,
// Watch for new nodes or updates to nodes - daemon pods are launched on new nodes, and possibly when labels on nodes change,
dsc
.
nodeStore
.
Store
,
dsc
.
nodeController
=
framework
.
NewInformer
(
dsc
.
nodeStore
.
Store
,
dsc
.
nodeController
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
dsc
.
kubeClient
.
Nodes
()
.
List
(
unversioned
.
ListOptions
{}
)
return
dsc
.
kubeClient
.
Nodes
()
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
dsc
.
kubeClient
.
Nodes
()
.
Watch
(
options
)
return
dsc
.
kubeClient
.
Nodes
()
.
Watch
(
options
)
...
...
pkg/controller/endpoint/endpoints_controller.go
View file @
a915b8b2
...
@@ -62,8 +62,8 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync
...
@@ -62,8 +62,8 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync
e
.
serviceStore
.
Store
,
e
.
serviceController
=
framework
.
NewInformer
(
e
.
serviceStore
.
Store
,
e
.
serviceController
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
e
.
client
.
Services
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
e
.
client
.
Services
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
e
.
client
.
Services
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
e
.
client
.
Services
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
@@ -83,8 +83,8 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync
...
@@ -83,8 +83,8 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync
e
.
podStore
.
Store
,
e
.
podController
=
framework
.
NewInformer
(
e
.
podStore
.
Store
,
e
.
podController
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
e
.
client
.
Pods
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
e
.
client
.
Pods
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
e
.
client
.
Pods
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
e
.
client
.
Pods
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
...
pkg/controller/framework/fake_controller_source.go
View file @
a915b8b2
...
@@ -122,7 +122,7 @@ func (f *FakeControllerSource) Change(e watch.Event, watchProbability float64) {
...
@@ -122,7 +122,7 @@ func (f *FakeControllerSource) Change(e watch.Event, watchProbability float64) {
}
}
// List returns a list object, with its resource version set.
// List returns a list object, with its resource version set.
func
(
f
*
FakeControllerSource
)
List
()
(
runtime
.
Object
,
error
)
{
func
(
f
*
FakeControllerSource
)
List
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
f
.
lock
.
RLock
()
f
.
lock
.
RLock
()
defer
f
.
lock
.
RUnlock
()
defer
f
.
lock
.
RUnlock
()
list
:=
make
([]
runtime
.
Object
,
0
,
len
(
f
.
items
))
list
:=
make
([]
runtime
.
Object
,
0
,
len
(
f
.
items
))
...
...
pkg/controller/framework/fake_controller_source_test.go
View file @
a915b8b2
...
@@ -71,7 +71,7 @@ func TestRCNumber(t *testing.T) {
...
@@ -71,7 +71,7 @@ func TestRCNumber(t *testing.T) {
}
}
go
consume
(
t
,
w
,
[]
string
{
"2"
,
"3"
},
wg
)
go
consume
(
t
,
w
,
[]
string
{
"2"
,
"3"
},
wg
)
list
,
err
:=
source
.
List
()
list
,
err
:=
source
.
List
(
unversioned
.
ListOptions
{}
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Unexpected error: %v"
,
err
)
t
.
Fatalf
(
"Unexpected error: %v"
,
err
)
}
}
...
...
pkg/controller/gc/gc_controller.go
View file @
a915b8b2
...
@@ -66,8 +66,8 @@ func New(kubeClient client.Interface, resyncPeriod controller.ResyncPeriodFunc,
...
@@ -66,8 +66,8 @@ func New(kubeClient client.Interface, resyncPeriod controller.ResyncPeriodFunc,
gcc
.
podStore
.
Store
,
gcc
.
podStoreSyncer
=
framework
.
NewInformer
(
gcc
.
podStore
.
Store
,
gcc
.
podStoreSyncer
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
options
:=
unversioned
.
ListOptions
{
FieldSelector
:
unversioned
.
FieldSelector
{
terminatedSelector
}}
options
.
FieldSelector
.
Selector
=
terminatedSelector
return
gcc
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
List
(
options
)
return
gcc
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
...
...
pkg/controller/job/controller.go
View file @
a915b8b2
...
@@ -83,8 +83,8 @@ func NewJobController(kubeClient client.Interface, resyncPeriod controller.Resyn
...
@@ -83,8 +83,8 @@ func NewJobController(kubeClient client.Interface, resyncPeriod controller.Resyn
jm
.
jobStore
.
Store
,
jm
.
jobController
=
framework
.
NewInformer
(
jm
.
jobStore
.
Store
,
jm
.
jobController
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
jm
.
kubeClient
.
Extensions
()
.
Jobs
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
jm
.
kubeClient
.
Extensions
()
.
Jobs
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
jm
.
kubeClient
.
Extensions
()
.
Jobs
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
jm
.
kubeClient
.
Extensions
()
.
Jobs
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
@@ -106,8 +106,8 @@ func NewJobController(kubeClient client.Interface, resyncPeriod controller.Resyn
...
@@ -106,8 +106,8 @@ func NewJobController(kubeClient client.Interface, resyncPeriod controller.Resyn
jm
.
podStore
.
Store
,
jm
.
podController
=
framework
.
NewInformer
(
jm
.
podStore
.
Store
,
jm
.
podController
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
jm
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
jm
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
jm
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
jm
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
...
pkg/controller/namespace/namespace_controller.go
View file @
a915b8b2
...
@@ -45,8 +45,8 @@ func NewNamespaceController(kubeClient client.Interface, versions *unversioned.A
...
@@ -45,8 +45,8 @@ func NewNamespaceController(kubeClient client.Interface, versions *unversioned.A
var
controller
*
framework
.
Controller
var
controller
*
framework
.
Controller
_
,
controller
=
framework
.
NewInformer
(
_
,
controller
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
kubeClient
.
Namespaces
()
.
List
(
unversioned
.
ListOptions
{}
)
return
kubeClient
.
Namespaces
()
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
kubeClient
.
Namespaces
()
.
Watch
(
options
)
return
kubeClient
.
Namespaces
()
.
Watch
(
options
)
...
...
pkg/controller/node/nodecontroller.go
View file @
a915b8b2
...
@@ -162,8 +162,8 @@ func NewNodeController(
...
@@ -162,8 +162,8 @@ func NewNodeController(
nc
.
podStore
.
Store
,
nc
.
podController
=
framework
.
NewInformer
(
nc
.
podStore
.
Store
,
nc
.
podController
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
nc
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
nc
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
nc
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
nc
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
@@ -178,8 +178,8 @@ func NewNodeController(
...
@@ -178,8 +178,8 @@ func NewNodeController(
)
)
nc
.
nodeStore
.
Store
,
nc
.
nodeController
=
framework
.
NewInformer
(
nc
.
nodeStore
.
Store
,
nc
.
nodeController
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
nc
.
kubeClient
.
Nodes
()
.
List
(
unversioned
.
ListOptions
{}
)
return
nc
.
kubeClient
.
Nodes
()
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
nc
.
kubeClient
.
Nodes
()
.
Watch
(
options
)
return
nc
.
kubeClient
.
Nodes
()
.
Watch
(
options
)
...
...
pkg/controller/persistentvolume/persistentvolume_claim_binder_controller.go
View file @
a915b8b2
...
@@ -55,8 +55,8 @@ func NewPersistentVolumeClaimBinder(kubeClient client.Interface, syncPeriod time
...
@@ -55,8 +55,8 @@ func NewPersistentVolumeClaimBinder(kubeClient client.Interface, syncPeriod time
_
,
volumeController
:=
framework
.
NewInformer
(
_
,
volumeController
:=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
kubeClient
.
PersistentVolumes
()
.
List
(
unversioned
.
ListOptions
{}
)
return
kubeClient
.
PersistentVolumes
()
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
kubeClient
.
PersistentVolumes
()
.
Watch
(
options
)
return
kubeClient
.
PersistentVolumes
()
.
Watch
(
options
)
...
@@ -73,8 +73,8 @@ func NewPersistentVolumeClaimBinder(kubeClient client.Interface, syncPeriod time
...
@@ -73,8 +73,8 @@ func NewPersistentVolumeClaimBinder(kubeClient client.Interface, syncPeriod time
)
)
_
,
claimController
:=
framework
.
NewInformer
(
_
,
claimController
:=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
kubeClient
.
PersistentVolumeClaims
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
kubeClient
.
PersistentVolumeClaims
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
kubeClient
.
PersistentVolumeClaims
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
kubeClient
.
PersistentVolumeClaims
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
...
pkg/controller/persistentvolume/persistentvolume_recycler_controller.go
View file @
a915b8b2
...
@@ -62,8 +62,8 @@ func NewPersistentVolumeRecycler(kubeClient client.Interface, syncPeriod time.Du
...
@@ -62,8 +62,8 @@ func NewPersistentVolumeRecycler(kubeClient client.Interface, syncPeriod time.Du
_
,
volumeController
:=
framework
.
NewInformer
(
_
,
volumeController
:=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
kubeClient
.
PersistentVolumes
()
.
List
(
unversioned
.
ListOptions
{}
)
return
kubeClient
.
PersistentVolumes
()
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
kubeClient
.
PersistentVolumes
()
.
Watch
(
options
)
return
kubeClient
.
PersistentVolumes
()
.
Watch
(
options
)
...
...
pkg/controller/replication/replication_controller.go
View file @
a915b8b2
...
@@ -107,8 +107,8 @@ func NewReplicationManager(kubeClient client.Interface, resyncPeriod controller.
...
@@ -107,8 +107,8 @@ func NewReplicationManager(kubeClient client.Interface, resyncPeriod controller.
rm
.
rcStore
.
Store
,
rm
.
rcController
=
framework
.
NewInformer
(
rm
.
rcStore
.
Store
,
rm
.
rcController
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
rm
.
kubeClient
.
ReplicationControllers
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
rm
.
kubeClient
.
ReplicationControllers
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
rm
.
kubeClient
.
ReplicationControllers
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
rm
.
kubeClient
.
ReplicationControllers
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
@@ -148,8 +148,8 @@ func NewReplicationManager(kubeClient client.Interface, resyncPeriod controller.
...
@@ -148,8 +148,8 @@ func NewReplicationManager(kubeClient client.Interface, resyncPeriod controller.
rm
.
podStore
.
Store
,
rm
.
podController
=
framework
.
NewInformer
(
rm
.
podStore
.
Store
,
rm
.
podController
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
rm
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
rm
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
rm
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
rm
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
...
pkg/controller/resourcequota/resource_quota_controller.go
View file @
a915b8b2
...
@@ -65,8 +65,8 @@ func NewResourceQuotaController(kubeClient client.Interface, resyncPeriod contro
...
@@ -65,8 +65,8 @@ func NewResourceQuotaController(kubeClient client.Interface, resyncPeriod contro
rq
.
rqIndexer
,
rq
.
rqController
=
framework
.
NewIndexerInformer
(
rq
.
rqIndexer
,
rq
.
rqController
=
framework
.
NewIndexerInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
rq
.
kubeClient
.
ResourceQuotas
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
rq
.
kubeClient
.
ResourceQuotas
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
rq
.
kubeClient
.
ResourceQuotas
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
rq
.
kubeClient
.
ResourceQuotas
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
@@ -105,8 +105,8 @@ func NewResourceQuotaController(kubeClient client.Interface, resyncPeriod contro
...
@@ -105,8 +105,8 @@ func NewResourceQuotaController(kubeClient client.Interface, resyncPeriod contro
// release compute resources from any associated quota.
// release compute resources from any associated quota.
rq
.
podStore
.
Store
,
rq
.
podController
=
framework
.
NewInformer
(
rq
.
podStore
.
Store
,
rq
.
podController
=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
rq
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
rq
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
rq
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
rq
.
kubeClient
.
Pods
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
...
pkg/controller/serviceaccount/serviceaccounts_controller.go
View file @
a915b8b2
...
@@ -80,8 +80,8 @@ func NewServiceAccountsController(cl client.Interface, options ServiceAccountsCo
...
@@ -80,8 +80,8 @@ func NewServiceAccountsController(cl client.Interface, options ServiceAccountsCo
}
}
e
.
serviceAccounts
,
e
.
serviceAccountController
=
framework
.
NewIndexerInformer
(
e
.
serviceAccounts
,
e
.
serviceAccountController
=
framework
.
NewIndexerInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
options
:=
unversioned
.
ListOptions
{
FieldSelector
:
unversioned
.
FieldSelector
{
accountSelector
}}
options
.
FieldSelector
.
Selector
=
accountSelector
return
e
.
client
.
ServiceAccounts
(
api
.
NamespaceAll
)
.
List
(
options
)
return
e
.
client
.
ServiceAccounts
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
...
@@ -99,8 +99,8 @@ func NewServiceAccountsController(cl client.Interface, options ServiceAccountsCo
...
@@ -99,8 +99,8 @@ func NewServiceAccountsController(cl client.Interface, options ServiceAccountsCo
e
.
namespaces
,
e
.
namespaceController
=
framework
.
NewIndexerInformer
(
e
.
namespaces
,
e
.
namespaceController
=
framework
.
NewIndexerInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
e
.
client
.
Namespaces
()
.
List
(
unversioned
.
ListOptions
{}
)
return
e
.
client
.
Namespaces
()
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
e
.
client
.
Namespaces
()
.
Watch
(
options
)
return
e
.
client
.
Namespaces
()
.
Watch
(
options
)
...
...
pkg/controller/serviceaccount/tokens_controller.go
View file @
a915b8b2
...
@@ -62,8 +62,8 @@ func NewTokensController(cl client.Interface, options TokensControllerOptions) *
...
@@ -62,8 +62,8 @@ func NewTokensController(cl client.Interface, options TokensControllerOptions) *
e
.
serviceAccounts
,
e
.
serviceAccountController
=
framework
.
NewIndexerInformer
(
e
.
serviceAccounts
,
e
.
serviceAccountController
=
framework
.
NewIndexerInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
e
.
client
.
ServiceAccounts
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
e
.
client
.
ServiceAccounts
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
e
.
client
.
ServiceAccounts
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
e
.
client
.
ServiceAccounts
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
@@ -82,8 +82,8 @@ func NewTokensController(cl client.Interface, options TokensControllerOptions) *
...
@@ -82,8 +82,8 @@ func NewTokensController(cl client.Interface, options TokensControllerOptions) *
tokenSelector
:=
fields
.
SelectorFromSet
(
map
[
string
]
string
{
client
.
SecretType
:
string
(
api
.
SecretTypeServiceAccountToken
)})
tokenSelector
:=
fields
.
SelectorFromSet
(
map
[
string
]
string
{
client
.
SecretType
:
string
(
api
.
SecretTypeServiceAccountToken
)})
e
.
secrets
,
e
.
secretController
=
framework
.
NewIndexerInformer
(
e
.
secrets
,
e
.
secretController
=
framework
.
NewIndexerInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
options
:=
unversioned
.
ListOptions
{
FieldSelector
:
unversioned
.
FieldSelector
{
tokenSelector
}}
options
.
FieldSelector
.
Selector
=
tokenSelector
return
e
.
client
.
Secrets
(
api
.
NamespaceAll
)
.
List
(
options
)
return
e
.
client
.
Secrets
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
...
...
pkg/kubelet/config/apiserver_test.go
View file @
a915b8b2
...
@@ -32,7 +32,7 @@ type fakePodLW struct {
...
@@ -32,7 +32,7 @@ type fakePodLW struct {
watchResp
watch
.
Interface
watchResp
watch
.
Interface
}
}
func
(
lw
fakePodLW
)
List
()
(
runtime
.
Object
,
error
)
{
func
(
lw
fakePodLW
)
List
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
lw
.
listResp
,
nil
return
lw
.
listResp
,
nil
}
}
...
...
pkg/kubelet/kubelet.go
View file @
a915b8b2
...
@@ -233,8 +233,8 @@ func NewMainKubelet(
...
@@ -233,8 +233,8 @@ func NewMainKubelet(
// TODO: cache.NewListWatchFromClient is limited as it takes a client implementation rather
// TODO: cache.NewListWatchFromClient is limited as it takes a client implementation rather
// than an interface. There is no way to construct a list+watcher using resource name.
// than an interface. There is no way to construct a list+watcher using resource name.
listWatch
:=
&
cache
.
ListWatch
{
listWatch
:=
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
kubeClient
.
Services
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
kubeClient
.
Services
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
kubeClient
.
Services
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
kubeClient
.
Services
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
@@ -250,8 +250,8 @@ func NewMainKubelet(
...
@@ -250,8 +250,8 @@ func NewMainKubelet(
// than an interface. There is no way to construct a list+watcher using resource name.
// than an interface. There is no way to construct a list+watcher using resource name.
fieldSelector
:=
fields
.
Set
{
client
.
ObjectNameField
:
nodeName
}
.
AsSelector
()
fieldSelector
:=
fields
.
Set
{
client
.
ObjectNameField
:
nodeName
}
.
AsSelector
()
listWatch
:=
&
cache
.
ListWatch
{
listWatch
:=
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
options
:=
unversioned
.
ListOptions
{
FieldSelector
:
unversioned
.
FieldSelector
{
fieldSelector
}}
options
.
FieldSelector
.
Selector
=
fieldSelector
return
kubeClient
.
Nodes
()
.
List
(
options
)
return
kubeClient
.
Nodes
()
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
...
...
pkg/proxy/config/api_test.go
View file @
a915b8b2
...
@@ -32,7 +32,7 @@ type fakeLW struct {
...
@@ -32,7 +32,7 @@ type fakeLW struct {
watchResp
watch
.
Interface
watchResp
watch
.
Interface
}
}
func
(
lw
fakeLW
)
List
()
(
runtime
.
Object
,
error
)
{
func
(
lw
fakeLW
)
List
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
lw
.
listResp
,
nil
return
lw
.
listResp
,
nil
}
}
...
...
pkg/storage/cacher.go
View file @
a915b8b2
...
@@ -387,7 +387,7 @@ func newCacherListerWatcher(storage Interface, resourcePrefix string, newListFun
...
@@ -387,7 +387,7 @@ func newCacherListerWatcher(storage Interface, resourcePrefix string, newListFun
}
}
// Implements cache.ListerWatcher interface.
// Implements cache.ListerWatcher interface.
func
(
lw
*
cacherListerWatcher
)
List
()
(
runtime
.
Object
,
error
)
{
func
(
lw
*
cacherListerWatcher
)
List
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
list
:=
lw
.
newListFunc
()
list
:=
lw
.
newListFunc
()
if
err
:=
lw
.
storage
.
List
(
context
.
TODO
(),
lw
.
resourcePrefix
,
0
,
Everything
,
list
);
err
!=
nil
{
if
err
:=
lw
.
storage
.
List
(
context
.
TODO
(),
lw
.
resourcePrefix
,
0
,
Everything
,
list
);
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
...
pkg/storage/watch_cache_test.go
View file @
a915b8b2
...
@@ -249,11 +249,13 @@ func TestWaitUntilFreshAndList(t *testing.T) {
...
@@ -249,11 +249,13 @@ func TestWaitUntilFreshAndList(t *testing.T) {
}
}
type
testLW
struct
{
type
testLW
struct
{
ListFunc
func
()
(
runtime
.
Object
,
error
)
ListFunc
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
WatchFunc
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
WatchFunc
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
}
}
func
(
t
*
testLW
)
List
()
(
runtime
.
Object
,
error
)
{
return
t
.
ListFunc
()
}
func
(
t
*
testLW
)
List
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
t
.
ListFunc
(
options
)
}
func
(
t
*
testLW
)
Watch
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
func
(
t
*
testLW
)
Watch
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
t
.
WatchFunc
(
options
)
return
t
.
WatchFunc
(
options
)
}
}
...
@@ -274,7 +276,7 @@ func TestReflectorForWatchCache(t *testing.T) {
...
@@ -274,7 +276,7 @@ func TestReflectorForWatchCache(t *testing.T) {
go
fw
.
Stop
()
go
fw
.
Stop
()
return
fw
,
nil
return
fw
,
nil
},
},
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
&
api
.
PodList
{
ListMeta
:
unversioned
.
ListMeta
{
ResourceVersion
:
"10"
}},
nil
return
&
api
.
PodList
{
ListMeta
:
unversioned
.
ListMeta
{
ResourceVersion
:
"10"
}},
nil
},
},
}
}
...
...
pkg/volume/util.go
View file @
a915b8b2
...
@@ -108,8 +108,8 @@ func (c *realRecyclerClient) WatchPod(name, namespace, resourceVersion string, s
...
@@ -108,8 +108,8 @@ func (c *realRecyclerClient) WatchPod(name, namespace, resourceVersion string, s
fieldSelector
,
_
:=
fields
.
ParseSelector
(
"metadata.name="
+
name
)
fieldSelector
,
_
:=
fields
.
ParseSelector
(
"metadata.name="
+
name
)
podLW
:=
&
cache
.
ListWatch
{
podLW
:=
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
options
:=
unversioned
.
ListOptions
{
FieldSelector
:
unversioned
.
FieldSelector
{
fieldSelector
}}
options
.
FieldSelector
.
Selector
=
fieldSelector
return
c
.
client
.
Pods
(
namespace
)
.
List
(
options
)
return
c
.
client
.
Pods
(
namespace
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
...
...
plugin/pkg/admission/limitranger/admission.go
View file @
a915b8b2
...
@@ -97,8 +97,8 @@ func (l *limitRanger) Admit(a admission.Attributes) (err error) {
...
@@ -97,8 +97,8 @@ func (l *limitRanger) Admit(a admission.Attributes) (err error) {
// NewLimitRanger returns an object that enforces limits based on the supplied limit function
// NewLimitRanger returns an object that enforces limits based on the supplied limit function
func
NewLimitRanger
(
client
client
.
Interface
,
limitFunc
LimitFunc
)
admission
.
Interface
{
func
NewLimitRanger
(
client
client
.
Interface
,
limitFunc
LimitFunc
)
admission
.
Interface
{
lw
:=
&
cache
.
ListWatch
{
lw
:=
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
client
.
LimitRanges
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
client
.
LimitRanges
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
client
.
LimitRanges
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
client
.
LimitRanges
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
...
plugin/pkg/admission/namespace/autoprovision/admission.go
View file @
a915b8b2
...
@@ -83,8 +83,8 @@ func NewProvision(c client.Interface) admission.Interface {
...
@@ -83,8 +83,8 @@ func NewProvision(c client.Interface) admission.Interface {
store
:=
cache
.
NewStore
(
cache
.
MetaNamespaceKeyFunc
)
store
:=
cache
.
NewStore
(
cache
.
MetaNamespaceKeyFunc
)
reflector
:=
cache
.
NewReflector
(
reflector
:=
cache
.
NewReflector
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
c
.
Namespaces
()
.
List
(
unversioned
.
ListOptions
{}
)
return
c
.
Namespaces
()
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
Namespaces
()
.
Watch
(
options
)
return
c
.
Namespaces
()
.
Watch
(
options
)
...
...
plugin/pkg/admission/namespace/exists/admission.go
View file @
a915b8b2
...
@@ -90,8 +90,8 @@ func NewExists(c client.Interface) admission.Interface {
...
@@ -90,8 +90,8 @@ func NewExists(c client.Interface) admission.Interface {
store
:=
cache
.
NewStore
(
cache
.
MetaNamespaceKeyFunc
)
store
:=
cache
.
NewStore
(
cache
.
MetaNamespaceKeyFunc
)
reflector
:=
cache
.
NewReflector
(
reflector
:=
cache
.
NewReflector
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
c
.
Namespaces
()
.
List
(
unversioned
.
ListOptions
{}
)
return
c
.
Namespaces
()
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
Namespaces
()
.
Watch
(
options
)
return
c
.
Namespaces
()
.
Watch
(
options
)
...
...
plugin/pkg/admission/namespace/lifecycle/admission.go
View file @
a915b8b2
...
@@ -107,8 +107,8 @@ func NewLifecycle(c client.Interface) admission.Interface {
...
@@ -107,8 +107,8 @@ func NewLifecycle(c client.Interface) admission.Interface {
store
:=
cache
.
NewStore
(
cache
.
MetaNamespaceKeyFunc
)
store
:=
cache
.
NewStore
(
cache
.
MetaNamespaceKeyFunc
)
reflector
:=
cache
.
NewReflector
(
reflector
:=
cache
.
NewReflector
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
c
.
Namespaces
()
.
List
(
unversioned
.
ListOptions
{}
)
return
c
.
Namespaces
()
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
Namespaces
()
.
Watch
(
options
)
return
c
.
Namespaces
()
.
Watch
(
options
)
...
...
plugin/pkg/admission/resourcequota/admission.go
View file @
a915b8b2
...
@@ -49,8 +49,8 @@ type quota struct {
...
@@ -49,8 +49,8 @@ type quota struct {
// NewResourceQuota creates a new resource quota admission control handler
// NewResourceQuota creates a new resource quota admission control handler
func
NewResourceQuota
(
client
client
.
Interface
)
admission
.
Interface
{
func
NewResourceQuota
(
client
client
.
Interface
)
admission
.
Interface
{
lw
:=
&
cache
.
ListWatch
{
lw
:=
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
client
.
ResourceQuotas
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
client
.
ResourceQuotas
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
client
.
ResourceQuotas
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
client
.
ResourceQuotas
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
...
plugin/pkg/admission/serviceaccount/admission.go
View file @
a915b8b2
...
@@ -90,8 +90,8 @@ type serviceAccount struct {
...
@@ -90,8 +90,8 @@ type serviceAccount struct {
func
NewServiceAccount
(
cl
client
.
Interface
)
*
serviceAccount
{
func
NewServiceAccount
(
cl
client
.
Interface
)
*
serviceAccount
{
serviceAccountsIndexer
,
serviceAccountsReflector
:=
cache
.
NewNamespaceKeyedIndexerAndReflector
(
serviceAccountsIndexer
,
serviceAccountsReflector
:=
cache
.
NewNamespaceKeyedIndexerAndReflector
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
cl
.
ServiceAccounts
(
api
.
NamespaceAll
)
.
List
(
unversioned
.
ListOptions
{}
)
return
cl
.
ServiceAccounts
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
cl
.
ServiceAccounts
(
api
.
NamespaceAll
)
.
Watch
(
options
)
return
cl
.
ServiceAccounts
(
api
.
NamespaceAll
)
.
Watch
(
options
)
...
@@ -104,8 +104,8 @@ func NewServiceAccount(cl client.Interface) *serviceAccount {
...
@@ -104,8 +104,8 @@ func NewServiceAccount(cl client.Interface) *serviceAccount {
tokenSelector
:=
fields
.
SelectorFromSet
(
map
[
string
]
string
{
client
.
SecretType
:
string
(
api
.
SecretTypeServiceAccountToken
)})
tokenSelector
:=
fields
.
SelectorFromSet
(
map
[
string
]
string
{
client
.
SecretType
:
string
(
api
.
SecretTypeServiceAccountToken
)})
secretsIndexer
,
secretsReflector
:=
cache
.
NewNamespaceKeyedIndexerAndReflector
(
secretsIndexer
,
secretsReflector
:=
cache
.
NewNamespaceKeyedIndexerAndReflector
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
options
:=
unversioned
.
ListOptions
{
FieldSelector
:
unversioned
.
FieldSelector
{
tokenSelector
}}
options
.
FieldSelector
.
Selector
=
tokenSelector
return
cl
.
Secrets
(
api
.
NamespaceAll
)
.
List
(
options
)
return
cl
.
Secrets
(
api
.
NamespaceAll
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
...
...
test/e2e/daemon_restart.go
View file @
a915b8b2
...
@@ -220,8 +220,8 @@ var _ = Describe("DaemonRestart", func() {
...
@@ -220,8 +220,8 @@ var _ = Describe("DaemonRestart", func() {
tracker
=
newPodTracker
()
tracker
=
newPodTracker
()
newPods
,
controller
=
controllerframework
.
NewInformer
(
newPods
,
controller
=
controllerframework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
options
:=
unversioned
.
ListOptions
{
LabelSelector
:
unversioned
.
LabelSelector
{
labelSelector
}}
options
.
LabelSelector
.
Selector
=
labelSelector
return
framework
.
Client
.
Pods
(
ns
)
.
List
(
options
)
return
framework
.
Client
.
Pods
(
ns
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
...
...
test/e2e/density.go
View file @
a915b8b2
...
@@ -235,8 +235,8 @@ var _ = Describe("Density [Skipped]", func() {
...
@@ -235,8 +235,8 @@ var _ = Describe("Density [Skipped]", func() {
events
:=
make
([](
*
api
.
Event
),
0
)
events
:=
make
([](
*
api
.
Event
),
0
)
_
,
controller
:=
controllerframework
.
NewInformer
(
_
,
controller
:=
controllerframework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
c
.
Events
(
ns
)
.
List
(
unversioned
.
ListOptions
{}
)
return
c
.
Events
(
ns
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
Events
(
ns
)
.
Watch
(
options
)
return
c
.
Events
(
ns
)
.
Watch
(
options
)
...
@@ -318,9 +318,9 @@ var _ = Describe("Density [Skipped]", func() {
...
@@ -318,9 +318,9 @@ var _ = Describe("Density [Skipped]", func() {
additionalPodsPrefix
=
"density-latency-pod-"
+
string
(
util
.
NewUUID
())
additionalPodsPrefix
=
"density-latency-pod-"
+
string
(
util
.
NewUUID
())
_
,
controller
:=
controllerframework
.
NewInformer
(
_
,
controller
:=
controllerframework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
selector
:=
labels
.
SelectorFromSet
(
labels
.
Set
{
"name"
:
additionalPodsPrefix
})
selector
:=
labels
.
SelectorFromSet
(
labels
.
Set
{
"name"
:
additionalPodsPrefix
})
options
:=
unversioned
.
ListOptions
{
LabelSelector
:
unversioned
.
LabelSelector
{
selector
}}
options
.
LabelSelector
.
Selector
=
selector
return
c
.
Pods
(
ns
)
.
List
(
options
)
return
c
.
Pods
(
ns
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
...
...
test/e2e/latency.go
View file @
a915b8b2
...
@@ -143,9 +143,9 @@ func runLatencyTest(nodeCount int, c *client.Client, ns string) {
...
@@ -143,9 +143,9 @@ func runLatencyTest(nodeCount int, c *client.Client, ns string) {
stopCh
:=
make
(
chan
struct
{})
stopCh
:=
make
(
chan
struct
{})
_
,
informer
:=
framework
.
NewInformer
(
_
,
informer
:=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
selector
:=
labels
.
SelectorFromSet
(
labels
.
Set
{
"name"
:
additionalPodsPrefix
})
selector
:=
labels
.
SelectorFromSet
(
labels
.
Set
{
"name"
:
additionalPodsPrefix
})
options
:=
unversioned
.
ListOptions
{
LabelSelector
:
unversioned
.
LabelSelector
{
selector
}}
options
.
LabelSelector
.
Selector
=
selector
return
c
.
Pods
(
ns
)
.
List
(
options
)
return
c
.
Pods
(
ns
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
...
...
test/e2e/service_latency.go
View file @
a915b8b2
...
@@ -277,8 +277,8 @@ func (eq *endpointQueries) added(e *api.Endpoints) {
...
@@ -277,8 +277,8 @@ func (eq *endpointQueries) added(e *api.Endpoints) {
func
startEndpointWatcher
(
f
*
Framework
,
q
*
endpointQueries
)
{
func
startEndpointWatcher
(
f
*
Framework
,
q
*
endpointQueries
)
{
_
,
controller
:=
framework
.
NewInformer
(
_
,
controller
:=
framework
.
NewInformer
(
&
cache
.
ListWatch
{
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
f
.
Client
.
Endpoints
(
f
.
Namespace
.
Name
)
.
List
(
unversioned
.
ListOptions
{}
)
return
f
.
Client
.
Endpoints
(
f
.
Namespace
.
Name
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
f
.
Client
.
Endpoints
(
f
.
Namespace
.
Name
)
.
Watch
(
options
)
return
f
.
Client
.
Endpoints
(
f
.
Namespace
.
Name
)
.
Watch
(
options
)
...
...
test/e2e/util.go
View file @
a915b8b2
...
@@ -161,11 +161,9 @@ type podStore struct {
...
@@ -161,11 +161,9 @@ type podStore struct {
func
newPodStore
(
c
*
client
.
Client
,
namespace
string
,
label
labels
.
Selector
,
field
fields
.
Selector
)
*
podStore
{
func
newPodStore
(
c
*
client
.
Client
,
namespace
string
,
label
labels
.
Selector
,
field
fields
.
Selector
)
*
podStore
{
lw
:=
&
cache
.
ListWatch
{
lw
:=
&
cache
.
ListWatch
{
ListFunc
:
func
()
(
runtime
.
Object
,
error
)
{
ListFunc
:
func
(
options
unversioned
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
options
:=
unversioned
.
ListOptions
{
options
.
LabelSelector
.
Selector
=
label
LabelSelector
:
unversioned
.
LabelSelector
{
label
},
options
.
FieldSelector
.
Selector
=
field
FieldSelector
:
unversioned
.
FieldSelector
{
field
},
}
return
c
.
Pods
(
namespace
)
.
List
(
options
)
return
c
.
Pods
(
namespace
)
.
List
(
options
)
},
},
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
WatchFunc
:
func
(
options
unversioned
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment