Skip to content

Commit c3c5528

Browse files
committed
chore: Fix lint
Signed-off-by: Manuel Rüger <[email protected]>
1 parent b4535b3 commit c3c5528

14 files changed

+41
-23
lines changed

internal/store/certificatesigningrequest.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,14 @@ func wrapCSRFunc(f func(*certv1.CertificateSigningRequest) *metric.Family) func(
147147
}
148148
}
149149

150-
func createCSRListWatch(kubeClient clientset.Interface, ns string, fieldSelector string) cache.ListerWatcher {
150+
func createCSRListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher {
151151
return &cache.ListWatch{
152152
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
153+
opts.FieldSelector = fieldSelector
153154
return kubeClient.CertificatesV1().CertificateSigningRequests().List(context.TODO(), opts)
154155
},
155156
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
157+
opts.FieldSelector = fieldSelector
156158
return kubeClient.CertificatesV1().CertificateSigningRequests().Watch(context.TODO(), opts)
157159
},
158160
}

internal/store/clusterrole.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func clusterRoleMetricFamilies(allowAnnotationsList, allowLabelsList []string) [
132132
}
133133
}
134134

135-
func createClusterRoleListWatch(kubeClient clientset.Interface, ns string, fieldSelector string) cache.ListerWatcher {
135+
func createClusterRoleListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher {
136136
return &cache.ListWatch{
137137
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
138138
opts.FieldSelector = fieldSelector

internal/store/clusterrolebinding.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func clusterRoleBindingMetricFamilies(allowAnnotationsList, allowLabelsList []st
134134
}
135135
}
136136

137-
func createClusterRoleBindingListWatch(kubeClient clientset.Interface, ns string, fieldSelector string) cache.ListerWatcher {
137+
func createClusterRoleBindingListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher {
138138
return &cache.ListWatch{
139139
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
140140
opts.FieldSelector = fieldSelector

internal/store/endpointslice.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,11 @@ func wrapEndpointSliceFunc(f func(*discoveryv1.EndpointSlice) *metric.Family) fu
225225
func createEndpointSliceListWatch(kubeClient clientset.Interface, ns string, fieldSelector string) cache.ListerWatcher {
226226
return &cache.ListWatch{
227227
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
228+
opts.FieldSelector = fieldSelector
228229
return kubeClient.DiscoveryV1().EndpointSlices(ns).List(context.TODO(), opts)
229230
},
230231
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
232+
opts.FieldSelector = fieldSelector
231233
return kubeClient.DiscoveryV1().EndpointSlices(ns).Watch(context.TODO(), opts)
232234
},
233235
}

internal/store/ingressclass.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,14 @@ func wrapIngressClassFunc(f func(*networkingv1.IngressClass) *metric.Family) fun
128128
}
129129
}
130130

131-
func createIngressClassListWatch(kubeClient clientset.Interface, ns string, fieldSelector string) cache.ListerWatcher {
131+
func createIngressClassListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher {
132132
return &cache.ListWatch{
133133
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
134+
opts.FieldSelector = fieldSelector
134135
return kubeClient.NetworkingV1().IngressClasses().List(context.TODO(), opts)
135136
},
136137
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
138+
opts.FieldSelector = fieldSelector
137139
return kubeClient.NetworkingV1().IngressClasses().Watch(context.TODO(), opts)
138140
},
139141
}

internal/store/mutatingwebhookconfiguration.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,14 @@ var (
8585
}
8686
)
8787

88-
func createMutatingWebhookConfigurationListWatch(kubeClient clientset.Interface, ns string, fieldSelector string) cache.ListerWatcher {
88+
func createMutatingWebhookConfigurationListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher {
8989
return &cache.ListWatch{
9090
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
91+
opts.FieldSelector = fieldSelector
9192
return kubeClient.AdmissionregistrationV1().MutatingWebhookConfigurations().List(context.TODO(), opts)
9293
},
9394
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
95+
opts.FieldSelector = fieldSelector
9496
return kubeClient.AdmissionregistrationV1().MutatingWebhookConfigurations().Watch(context.TODO(), opts)
9597
},
9698
}

internal/store/namespace.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,14 @@ func wrapNamespaceFunc(f func(*v1.Namespace) *metric.Family) func(interface{}) *
169169
}
170170
}
171171

172-
func createNamespaceListWatch(kubeClient clientset.Interface, ns string, fieldSelector string) cache.ListerWatcher {
172+
func createNamespaceListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher {
173173
return &cache.ListWatch{
174174
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
175+
opts.FieldSelector = fieldSelector
175176
return kubeClient.CoreV1().Namespaces().List(context.TODO(), opts)
176177
},
177178
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
179+
opts.FieldSelector = fieldSelector
178180
return kubeClient.CoreV1().Namespaces().Watch(context.TODO(), opts)
179181
},
180182
}

internal/store/node.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,12 +489,14 @@ func wrapNodeFunc(f func(*v1.Node) *metric.Family) func(interface{}) *metric.Fam
489489
}
490490
}
491491

492-
func createNodeListWatch(kubeClient clientset.Interface, ns string, fieldSelector string) cache.ListerWatcher {
492+
func createNodeListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher {
493493
return &cache.ListWatch{
494494
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
495+
opts.FieldSelector = fieldSelector
495496
return kubeClient.CoreV1().Nodes().List(context.TODO(), opts)
496497
},
497498
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
499+
opts.FieldSelector = fieldSelector
498500
return kubeClient.CoreV1().Nodes().Watch(context.TODO(), opts)
499501
},
500502
}

internal/store/persistentvolume.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,14 @@ func wrapPersistentVolumeFunc(f func(*v1.PersistentVolume) *metric.Family) func(
338338
}
339339
}
340340

341-
func createPersistentVolumeListWatch(kubeClient clientset.Interface, ns string, fieldSelector string) cache.ListerWatcher {
341+
func createPersistentVolumeListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher {
342342
return &cache.ListWatch{
343343
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
344+
opts.FieldSelector = fieldSelector
344345
return kubeClient.CoreV1().PersistentVolumes().List(context.TODO(), opts)
345346
},
346347
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
348+
opts.FieldSelector = fieldSelector
347349
return kubeClient.CoreV1().PersistentVolumes().Watch(context.TODO(), opts)
348350
},
349351
}

internal/store/storageclass.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,14 @@ func wrapStorageClassFunc(f func(*storagev1.StorageClass) *metric.Family) func(i
140140
}
141141
}
142142

143-
func createStorageClassListWatch(kubeClient clientset.Interface, ns string, fieldSelector string) cache.ListerWatcher {
143+
func createStorageClassListWatch(kubeClient clientset.Interface, _ string, fieldSelector string) cache.ListerWatcher {
144144
return &cache.ListWatch{
145145
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
146+
opts.FieldSelector = fieldSelector
146147
return kubeClient.StorageV1().StorageClasses().List(context.TODO(), opts)
147148
},
148149
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
150+
opts.FieldSelector = fieldSelector
149151
return kubeClient.StorageV1().StorageClasses().Watch(context.TODO(), opts)
150152
},
151153
}

0 commit comments

Comments
 (0)