@@ -51,7 +51,7 @@ type informerCache struct {
51
51
}
52
52
53
53
// Get implements Reader
54
- func (ip * informerCache ) Get (ctx context.Context , key client.ObjectKey , out runtime .Object ) error {
54
+ func (ip * informerCache ) Get (ctx context.Context , key client.ObjectKey , out client .Object ) error {
55
55
gvk , err := apiutil .GVKForObject (out , ip .Scheme )
56
56
if err != nil {
57
57
return err
@@ -69,7 +69,7 @@ func (ip *informerCache) Get(ctx context.Context, key client.ObjectKey, out runt
69
69
}
70
70
71
71
// List implements Reader
72
- func (ip * informerCache ) List (ctx context.Context , out runtime. Object , opts ... client.ListOption ) error {
72
+ func (ip * informerCache ) List (ctx context.Context , out client. ObjectList , opts ... client.ListOption ) error {
73
73
74
74
gvk , cacheTypeObj , err := ip .objectTypeForListObject (out )
75
75
if err != nil {
@@ -91,7 +91,7 @@ func (ip *informerCache) List(ctx context.Context, out runtime.Object, opts ...c
91
91
// objectTypeForListObject tries to find the runtime.Object and associated GVK
92
92
// for a single object corresponding to the passed-in list type. We need them
93
93
// because they are used as cache map key.
94
- func (ip * informerCache ) objectTypeForListObject (list runtime. Object ) (* schema.GroupVersionKind , runtime.Object , error ) {
94
+ func (ip * informerCache ) objectTypeForListObject (list client. ObjectList ) (* schema.GroupVersionKind , runtime.Object , error ) {
95
95
gvk , err := apiutil .GVKForObject (list , ip .Scheme )
96
96
if err != nil {
97
97
return nil , nil , err
@@ -146,7 +146,7 @@ func (ip *informerCache) GetInformerForKind(ctx context.Context, gvk schema.Grou
146
146
}
147
147
148
148
// GetInformer returns the informer for the obj
149
- func (ip * informerCache ) GetInformer (ctx context.Context , obj runtime .Object ) (Informer , error ) {
149
+ func (ip * informerCache ) GetInformer (ctx context.Context , obj client .Object ) (Informer , error ) {
150
150
gvk , err := apiutil .GVKForObject (obj , ip .Scheme )
151
151
if err != nil {
152
152
return nil , err
@@ -170,7 +170,7 @@ func (ip *informerCache) NeedLeaderElection() bool {
170
170
// to List. For one-to-one compatibility with "normal" field selectors, only return one value.
171
171
// The values may be anything. They will automatically be prefixed with the namespace of the
172
172
// given object, if present. The objects passed are guaranteed to be objects of the correct type.
173
- func (ip * informerCache ) IndexField (ctx context.Context , obj runtime .Object , field string , extractValue client.IndexerFunc ) error {
173
+ func (ip * informerCache ) IndexField (ctx context.Context , obj client .Object , field string , extractValue client.IndexerFunc ) error {
174
174
informer , err := ip .GetInformer (ctx , obj )
175
175
if err != nil {
176
176
return err
@@ -181,7 +181,7 @@ func (ip *informerCache) IndexField(ctx context.Context, obj runtime.Object, fie
181
181
func indexByField (indexer Informer , field string , extractor client.IndexerFunc ) error {
182
182
indexFunc := func (objRaw interface {}) ([]string , error ) {
183
183
// TODO(directxman12): check if this is the correct type?
184
- obj , isObj := objRaw .(runtime .Object )
184
+ obj , isObj := objRaw .(client .Object )
185
185
if ! isObj {
186
186
return nil , fmt .Errorf ("object of type %T is not an Object" , objRaw )
187
187
}
0 commit comments