use proper params in pager call

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
This commit is contained in:
Matthias Bertschy
2024-07-10 11:58:06 +02:00
parent f1c15cd2b5
commit c7d3105ca5
+2 -2
View File
@@ -378,8 +378,8 @@ func (k8sHandler *K8sResourceHandler) pullSingleResource(resource *schema.GroupV
// list resources
if err := pager.New(func(ctx context.Context, opts metav1.ListOptions) (runtime.Object, error) {
return clientResource.List(context.Background(), opts)
}).EachListItem(context.TODO(), listOptions, func(obj runtime.Object) error {
return clientResource.List(ctx, opts)
}).EachListItem(context.Background(), listOptions, func(obj runtime.Object) error {
uObject := obj.(*unstructured.Unstructured)
if k8sinterface.IsTypeWorkload(uObject.Object) && k8sinterface.WorkloadHasParent(workloadinterface.NewWorkloadObj(uObject.Object)) {
logger.L().Debug("Skipping resource with parent", helpers.String("kind", uObject.GetKind()), helpers.String("name", uObject.GetName()))