diff --git a/internal/store/certificatesigningrequest.go b/internal/store/certificatesigningrequest.go index c70cf801bd..ea287e1490 100644 --- a/internal/store/certificatesigningrequest.go +++ b/internal/store/certificatesigningrequest.go @@ -153,14 +153,12 @@ func wrapCSRFunc(f func(*certv1.CertificateSigningRequest) *metric.Family) func( } } -func createCSRListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher { +func createCSRListWatch(kubeClient clientset.Interface, _ string, _ string) cache.ListerWatcher { return &cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { - opts.FieldSelector = fieldSelector return kubeClient.CertificatesV1().CertificateSigningRequests().List(context.TODO(), opts) }, WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { - opts.FieldSelector = fieldSelector return kubeClient.CertificatesV1().CertificateSigningRequests().Watch(context.TODO(), opts) }, } diff --git a/internal/store/clusterrole.go b/internal/store/clusterrole.go index ee7a7384df..86642ab229 100644 --- a/internal/store/clusterrole.go +++ b/internal/store/clusterrole.go @@ -138,14 +138,12 @@ func clusterRoleMetricFamilies(allowAnnotationsList, allowLabelsList []string) [ } } -func createClusterRoleListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher { +func createClusterRoleListWatch(kubeClient clientset.Interface, _ string, _ string) cache.ListerWatcher { return &cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { - opts.FieldSelector = fieldSelector return kubeClient.RbacV1().ClusterRoles().List(context.TODO(), opts) }, WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { - opts.FieldSelector = fieldSelector return kubeClient.RbacV1().ClusterRoles().Watch(context.TODO(), opts) }, } diff --git a/internal/store/clusterrolebinding.go b/internal/store/clusterrolebinding.go index c046008b23..494095221e 100644 --- a/internal/store/clusterrolebinding.go +++ b/internal/store/clusterrolebinding.go @@ -140,14 +140,12 @@ func clusterRoleBindingMetricFamilies(allowAnnotationsList, allowLabelsList []st } } -func createClusterRoleBindingListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher { +func createClusterRoleBindingListWatch(kubeClient clientset.Interface, _ string, _ string) cache.ListerWatcher { return &cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { - opts.FieldSelector = fieldSelector return kubeClient.RbacV1().ClusterRoleBindings().List(context.TODO(), opts) }, WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { - opts.FieldSelector = fieldSelector return kubeClient.RbacV1().ClusterRoleBindings().Watch(context.TODO(), opts) }, } diff --git a/internal/store/ingressclass.go b/internal/store/ingressclass.go index 0aaa8e13e2..fbdb934a6c 100644 --- a/internal/store/ingressclass.go +++ b/internal/store/ingressclass.go @@ -134,14 +134,12 @@ func wrapIngressClassFunc(f func(*networkingv1.IngressClass) *metric.Family) fun } } -func createIngressClassListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher { +func createIngressClassListWatch(kubeClient clientset.Interface, _ string, _ string) cache.ListerWatcher { return &cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { - opts.FieldSelector = fieldSelector return kubeClient.NetworkingV1().IngressClasses().List(context.TODO(), opts) }, WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { - opts.FieldSelector = fieldSelector return kubeClient.NetworkingV1().IngressClasses().Watch(context.TODO(), opts) }, } diff --git a/internal/store/mutatingwebhookconfiguration.go b/internal/store/mutatingwebhookconfiguration.go index 1a003f490a..c09df4773f 100644 --- a/internal/store/mutatingwebhookconfiguration.go +++ b/internal/store/mutatingwebhookconfiguration.go @@ -111,14 +111,12 @@ var ( } ) -func createMutatingWebhookConfigurationListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher { +func createMutatingWebhookConfigurationListWatch(kubeClient clientset.Interface, _ string, _ string) cache.ListerWatcher { return &cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { - opts.FieldSelector = fieldSelector return kubeClient.AdmissionregistrationV1().MutatingWebhookConfigurations().List(context.TODO(), opts) }, WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { - opts.FieldSelector = fieldSelector return kubeClient.AdmissionregistrationV1().MutatingWebhookConfigurations().Watch(context.TODO(), opts) }, } diff --git a/internal/store/namespace.go b/internal/store/namespace.go index df3f1f0578..e46c73cf28 100644 --- a/internal/store/namespace.go +++ b/internal/store/namespace.go @@ -176,14 +176,12 @@ func wrapNamespaceFunc(f func(*v1.Namespace) *metric.Family) func(interface{}) * } } -func createNamespaceListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher { +func createNamespaceListWatch(kubeClient clientset.Interface, _ string, _ string) cache.ListerWatcher { return &cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { - opts.FieldSelector = fieldSelector return kubeClient.CoreV1().Namespaces().List(context.TODO(), opts) }, WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { - opts.FieldSelector = fieldSelector return kubeClient.CoreV1().Namespaces().Watch(context.TODO(), opts) }, } diff --git a/internal/store/node.go b/internal/store/node.go index fb577a0bec..1d4d6bee4f 100644 --- a/internal/store/node.go +++ b/internal/store/node.go @@ -495,14 +495,12 @@ func wrapNodeFunc(f func(*v1.Node) *metric.Family) func(interface{}) *metric.Fam } } -func createNodeListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher { +func createNodeListWatch(kubeClient clientset.Interface, _ string, _ string) cache.ListerWatcher { return &cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { - opts.FieldSelector = fieldSelector return kubeClient.CoreV1().Nodes().List(context.TODO(), opts) }, WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { - opts.FieldSelector = fieldSelector return kubeClient.CoreV1().Nodes().Watch(context.TODO(), opts) }, } diff --git a/internal/store/persistentvolume.go b/internal/store/persistentvolume.go index 18778e33a5..bd534ea87b 100644 --- a/internal/store/persistentvolume.go +++ b/internal/store/persistentvolume.go @@ -366,14 +366,12 @@ func wrapPersistentVolumeFunc(f func(*v1.PersistentVolume) *metric.Family) func( } } -func createPersistentVolumeListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher { +func createPersistentVolumeListWatch(kubeClient clientset.Interface, _ string, _ string) cache.ListerWatcher { return &cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { - opts.FieldSelector = fieldSelector return kubeClient.CoreV1().PersistentVolumes().List(context.TODO(), opts) }, WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { - opts.FieldSelector = fieldSelector return kubeClient.CoreV1().PersistentVolumes().Watch(context.TODO(), opts) }, } diff --git a/internal/store/storageclass.go b/internal/store/storageclass.go index d5ed3bae1a..15c76d7965 100644 --- a/internal/store/storageclass.go +++ b/internal/store/storageclass.go @@ -146,14 +146,12 @@ func wrapStorageClassFunc(f func(*storagev1.StorageClass) *metric.Family) func(i } } -func createStorageClassListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher { +func createStorageClassListWatch(kubeClient clientset.Interface, _ string, _ string) cache.ListerWatcher { return &cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { - opts.FieldSelector = fieldSelector return kubeClient.StorageV1().StorageClasses().List(context.TODO(), opts) }, WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { - opts.FieldSelector = fieldSelector return kubeClient.StorageV1().StorageClasses().Watch(context.TODO(), opts) }, } diff --git a/internal/store/validatingwebhookconfiguration.go b/internal/store/validatingwebhookconfiguration.go index 17996419ac..5084e8dd3e 100644 --- a/internal/store/validatingwebhookconfiguration.go +++ b/internal/store/validatingwebhookconfiguration.go @@ -111,14 +111,12 @@ var ( } ) -func createValidatingWebhookConfigurationListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher { +func createValidatingWebhookConfigurationListWatch(kubeClient clientset.Interface, _ string, _ string) cache.ListerWatcher { return &cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { - opts.FieldSelector = fieldSelector return kubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().List(context.TODO(), opts) }, WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { - opts.FieldSelector = fieldSelector return kubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Watch(context.TODO(), opts) }, }