Merge pull request #2190 from dgrisonnet/fix-regression
fix: Remove FieldSelector from non-namespaced resources
This commit is contained in:
commit
76f42c19af
|
|
@ -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)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue