@@ -214,28 +214,36 @@ func (c *ConfigMapRegistryReconciler) currentRoleBinding(source configMapCatalog
214
214
215
215
func (c * ConfigMapRegistryReconciler ) currentPods (source configMapCatalogSourceDecorator , image string ) []* v1.Pod {
216
216
podName := source .Pod (image ).GetName ()
217
- pods , err := c .Lister . CoreV1 ().PodLister ().Pods (source .GetNamespace ()).List (labels .SelectorFromSet (source .Selector ()))
217
+ pods , err := c .OpClient . KubernetesInterface ().CoreV1 ().Pods (source .GetNamespace ()).List (context . TODO (), metav1. ListOptions { LabelSelector : labels .SelectorFromSet (source .Selector ()). String ()} )
218
218
if err != nil {
219
219
logrus .WithField ("pod" , podName ).WithError (err ).Debug ("couldn't find pod in cache" )
220
220
return nil
221
221
}
222
- if len (pods ) > 1 {
222
+ if len (pods . Items ) > 1 {
223
223
logrus .WithField ("selector" , source .Selector ()).Debug ("multiple pods found for selector" )
224
224
}
225
- return pods
225
+ ret := make ([]* v1.Pod , len (pods .Items ))
226
+ for i , pod := range pods .Items {
227
+ ret [i ] = & pod
228
+ }
229
+ return ret
226
230
}
227
231
228
232
func (c * ConfigMapRegistryReconciler ) currentPodsWithCorrectResourceVersion (source configMapCatalogSourceDecorator , image string ) []* v1.Pod {
229
233
podName := source .Pod (image ).GetName ()
230
- pods , err := c .Lister . CoreV1 ().PodLister ().Pods (source .GetNamespace ()).List (labels .SelectorFromValidatedSet (source .Labels ()))
234
+ pods , err := c .OpClient . KubernetesInterface ().CoreV1 ().Pods (source .GetNamespace ()).List (context . TODO (), metav1. ListOptions { LabelSelector : labels .SelectorFromValidatedSet (source .Labels ()). String ()} )
231
235
if err != nil {
232
236
logrus .WithField ("pod" , podName ).WithError (err ).Debug ("couldn't find pod in cache" )
233
237
return nil
234
238
}
235
- if len (pods ) > 1 {
239
+ if len (pods . Items ) > 1 {
236
240
logrus .WithField ("selector" , source .Labels ()).Debug ("multiple pods found for selector" )
237
241
}
238
- return pods
242
+ ret := make ([]* v1.Pod , len (pods .Items ))
243
+ for i , pod := range pods .Items {
244
+ ret [i ] = & pod
245
+ }
246
+ return ret
239
247
}
240
248
241
249
// EnsureRegistryServer ensures that all components of registry server are up to date.
0 commit comments