Skip to content

Commit 1231b8b

Browse files
committed
feat: Use PartialObjectMetadata for Configmaps and Secrets
1 parent f8aa7d9 commit 1231b8b

File tree

5 files changed

+103
-39
lines changed

5 files changed

+103
-39
lines changed

internal/store/builder.go

Lines changed: 50 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ var _ ksmtypes.BuilderInterface = &Builder{}
6565
// Builder helps to build store. It follows the builder pattern
6666
// (https://en.wikipedia.org/wiki/Builder_pattern).
6767
type Builder struct {
68-
kubeClient clientset.Interface
69-
customResourceClients map[string]interface{}
70-
namespaces options.NamespaceList
68+
kubeClient clientset.Interface
69+
metadataOnlyKubeClient clientset.Interface
70+
customResourceClients map[string]interface{}
71+
namespaces options.NamespaceList
7172
// namespaceFilter is inside fieldSelectorFilter
7273
fieldSelectorFilter string
7374
ctx context.Context
@@ -157,6 +158,11 @@ func (b *Builder) WithKubeClient(c clientset.Interface) {
157158
b.kubeClient = c
158159
}
159160

161+
// WithMetadataOnlyKubeClient sets the metadataOnlyKubeClient property of a Builder.
162+
func (b *Builder) WithMetadataOnlyKubeClient(c clientset.Interface) {
163+
b.metadataOnlyKubeClient = c
164+
}
165+
160166
// WithCustomResourceClients sets the customResourceClients property of a Builder.
161167
func (b *Builder) WithCustomResourceClients(cs map[string]interface{}) {
162168
b.customResourceClients = cs
@@ -362,150 +368,151 @@ func availableResources() []string {
362368
}
363369

364370
func (b *Builder) buildConfigMapStores() []cache.Store {
365-
return b.buildStoresFunc(configMapMetricFamilies(b.allowAnnotationsList["configmaps"], b.allowLabelsList["configmaps"]), &v1.ConfigMap{}, createConfigMapListWatch, b.useAPIServerCache)
371+
return b.buildStoresFunc(configMapMetricFamilies(b.allowAnnotationsList["configmaps"], b.allowLabelsList["configmaps"]), &v1.ConfigMap{}, createConfigMapListWatch, b.useAPIServerCache, true)
366372
}
367373

368374
func (b *Builder) buildCronJobStores() []cache.Store {
369-
return b.buildStoresFunc(cronJobMetricFamilies(b.allowAnnotationsList["cronjobs"], b.allowLabelsList["cronjobs"]), &batchv1.CronJob{}, createCronJobListWatch, b.useAPIServerCache)
375+
return b.buildStoresFunc(cronJobMetricFamilies(b.allowAnnotationsList["cronjobs"], b.allowLabelsList["cronjobs"]), &batchv1.CronJob{}, createCronJobListWatch, b.useAPIServerCache, false)
370376
}
371377

372378
func (b *Builder) buildDaemonSetStores() []cache.Store {
373-
return b.buildStoresFunc(daemonSetMetricFamilies(b.allowAnnotationsList["daemonsets"], b.allowLabelsList["daemonsets"]), &appsv1.DaemonSet{}, createDaemonSetListWatch, b.useAPIServerCache)
379+
return b.buildStoresFunc(daemonSetMetricFamilies(b.allowAnnotationsList["daemonsets"], b.allowLabelsList["daemonsets"]), &appsv1.DaemonSet{}, createDaemonSetListWatch, b.useAPIServerCache, false)
374380
}
375381

376382
func (b *Builder) buildDeploymentStores() []cache.Store {
377-
return b.buildStoresFunc(deploymentMetricFamilies(b.allowAnnotationsList["deployments"], b.allowLabelsList["deployments"]), &appsv1.Deployment{}, createDeploymentListWatch, b.useAPIServerCache)
383+
return b.buildStoresFunc(deploymentMetricFamilies(b.allowAnnotationsList["deployments"], b.allowLabelsList["deployments"]), &appsv1.Deployment{}, createDeploymentListWatch, b.useAPIServerCache, false)
378384
}
379385

380386
func (b *Builder) buildEndpointsStores() []cache.Store {
381-
return b.buildStoresFunc(endpointMetricFamilies(b.allowAnnotationsList["endpoints"], b.allowLabelsList["endpoints"]), &v1.Endpoints{}, createEndpointsListWatch, b.useAPIServerCache)
387+
return b.buildStoresFunc(endpointMetricFamilies(b.allowAnnotationsList["endpoints"], b.allowLabelsList["endpoints"]), &v1.Endpoints{}, createEndpointsListWatch, b.useAPIServerCache, false)
382388
}
383389

384390
func (b *Builder) buildEndpointSlicesStores() []cache.Store {
385-
return b.buildStoresFunc(endpointSliceMetricFamilies(b.allowAnnotationsList["endpointslices"], b.allowLabelsList["endpointslices"]), &discoveryv1.EndpointSlice{}, createEndpointSliceListWatch, b.useAPIServerCache)
391+
return b.buildStoresFunc(endpointSliceMetricFamilies(b.allowAnnotationsList["endpointslices"], b.allowLabelsList["endpointslices"]), &discoveryv1.EndpointSlice{}, createEndpointSliceListWatch, b.useAPIServerCache, false)
386392
}
387393

388394
func (b *Builder) buildHPAStores() []cache.Store {
389-
return b.buildStoresFunc(hpaMetricFamilies(b.allowAnnotationsList["horizontalpodautoscalers"], b.allowLabelsList["horizontalpodautoscalers"]), &autoscaling.HorizontalPodAutoscaler{}, createHPAListWatch, b.useAPIServerCache)
395+
return b.buildStoresFunc(hpaMetricFamilies(b.allowAnnotationsList["horizontalpodautoscalers"], b.allowLabelsList["horizontalpodautoscalers"]), &autoscaling.HorizontalPodAutoscaler{}, createHPAListWatch, b.useAPIServerCache, false)
390396
}
391397

392398
func (b *Builder) buildIngressStores() []cache.Store {
393-
return b.buildStoresFunc(ingressMetricFamilies(b.allowAnnotationsList["ingresses"], b.allowLabelsList["ingresses"]), &networkingv1.Ingress{}, createIngressListWatch, b.useAPIServerCache)
399+
return b.buildStoresFunc(ingressMetricFamilies(b.allowAnnotationsList["ingresses"], b.allowLabelsList["ingresses"]), &networkingv1.Ingress{}, createIngressListWatch, b.useAPIServerCache, false)
394400
}
395401

396402
func (b *Builder) buildJobStores() []cache.Store {
397-
return b.buildStoresFunc(jobMetricFamilies(b.allowAnnotationsList["jobs"], b.allowLabelsList["jobs"]), &batchv1.Job{}, createJobListWatch, b.useAPIServerCache)
403+
return b.buildStoresFunc(jobMetricFamilies(b.allowAnnotationsList["jobs"], b.allowLabelsList["jobs"]), &batchv1.Job{}, createJobListWatch, b.useAPIServerCache, false)
398404
}
399405

400406
func (b *Builder) buildLimitRangeStores() []cache.Store {
401-
return b.buildStoresFunc(limitRangeMetricFamilies, &v1.LimitRange{}, createLimitRangeListWatch, b.useAPIServerCache)
407+
return b.buildStoresFunc(limitRangeMetricFamilies, &v1.LimitRange{}, createLimitRangeListWatch, b.useAPIServerCache, false)
402408
}
403409

404410
func (b *Builder) buildMutatingWebhookConfigurationStores() []cache.Store {
405-
return b.buildStoresFunc(mutatingWebhookConfigurationMetricFamilies, &admissionregistrationv1.MutatingWebhookConfiguration{}, createMutatingWebhookConfigurationListWatch, b.useAPIServerCache)
411+
return b.buildStoresFunc(mutatingWebhookConfigurationMetricFamilies, &admissionregistrationv1.MutatingWebhookConfiguration{}, createMutatingWebhookConfigurationListWatch, b.useAPIServerCache, false)
406412
}
407413

408414
func (b *Builder) buildNamespaceStores() []cache.Store {
409-
return b.buildStoresFunc(namespaceMetricFamilies(b.allowAnnotationsList["namespaces"], b.allowLabelsList["namespaces"]), &v1.Namespace{}, createNamespaceListWatch, b.useAPIServerCache)
415+
return b.buildStoresFunc(namespaceMetricFamilies(b.allowAnnotationsList["namespaces"], b.allowLabelsList["namespaces"]), &v1.Namespace{}, createNamespaceListWatch, b.useAPIServerCache, false)
410416
}
411417

412418
func (b *Builder) buildNetworkPolicyStores() []cache.Store {
413-
return b.buildStoresFunc(networkPolicyMetricFamilies(b.allowAnnotationsList["networkpolicies"], b.allowLabelsList["networkpolicies"]), &networkingv1.NetworkPolicy{}, createNetworkPolicyListWatch, b.useAPIServerCache)
419+
return b.buildStoresFunc(networkPolicyMetricFamilies(b.allowAnnotationsList["networkpolicies"], b.allowLabelsList["networkpolicies"]), &networkingv1.NetworkPolicy{}, createNetworkPolicyListWatch, b.useAPIServerCache, false)
414420
}
415421

416422
func (b *Builder) buildNodeStores() []cache.Store {
417-
return b.buildStoresFunc(nodeMetricFamilies(b.allowAnnotationsList["nodes"], b.allowLabelsList["nodes"]), &v1.Node{}, createNodeListWatch, b.useAPIServerCache)
423+
return b.buildStoresFunc(nodeMetricFamilies(b.allowAnnotationsList["nodes"], b.allowLabelsList["nodes"]), &v1.Node{}, createNodeListWatch, b.useAPIServerCache, false)
418424
}
419425

420426
func (b *Builder) buildPersistentVolumeClaimStores() []cache.Store {
421-
return b.buildStoresFunc(persistentVolumeClaimMetricFamilies(b.allowAnnotationsList["persistentvolumeclaims"], b.allowLabelsList["persistentvolumeclaims"]), &v1.PersistentVolumeClaim{}, createPersistentVolumeClaimListWatch, b.useAPIServerCache)
427+
return b.buildStoresFunc(persistentVolumeClaimMetricFamilies(b.allowAnnotationsList["persistentvolumeclaims"], b.allowLabelsList["persistentvolumeclaims"]), &v1.PersistentVolumeClaim{}, createPersistentVolumeClaimListWatch, b.useAPIServerCache, false)
422428
}
423429

424430
func (b *Builder) buildPersistentVolumeStores() []cache.Store {
425-
return b.buildStoresFunc(persistentVolumeMetricFamilies(b.allowAnnotationsList["persistentvolumes"], b.allowLabelsList["persistentvolumes"]), &v1.PersistentVolume{}, createPersistentVolumeListWatch, b.useAPIServerCache)
431+
return b.buildStoresFunc(persistentVolumeMetricFamilies(b.allowAnnotationsList["persistentvolumes"], b.allowLabelsList["persistentvolumes"]), &v1.PersistentVolume{}, createPersistentVolumeListWatch, b.useAPIServerCache, false)
426432
}
427433

428434
func (b *Builder) buildPodDisruptionBudgetStores() []cache.Store {
429-
return b.buildStoresFunc(podDisruptionBudgetMetricFamilies(b.allowAnnotationsList["poddisruptionbudgets"], b.allowLabelsList["poddisruptionbudgets"]), &policyv1.PodDisruptionBudget{}, createPodDisruptionBudgetListWatch, b.useAPIServerCache)
435+
return b.buildStoresFunc(podDisruptionBudgetMetricFamilies(b.allowAnnotationsList["poddisruptionbudgets"], b.allowLabelsList["poddisruptionbudgets"]), &policyv1.PodDisruptionBudget{}, createPodDisruptionBudgetListWatch, b.useAPIServerCache, false)
430436
}
431437

432438
func (b *Builder) buildReplicaSetStores() []cache.Store {
433-
return b.buildStoresFunc(replicaSetMetricFamilies(b.allowAnnotationsList["replicasets"], b.allowLabelsList["replicasets"]), &appsv1.ReplicaSet{}, createReplicaSetListWatch, b.useAPIServerCache)
439+
return b.buildStoresFunc(replicaSetMetricFamilies(b.allowAnnotationsList["replicasets"], b.allowLabelsList["replicasets"]), &appsv1.ReplicaSet{}, createReplicaSetListWatch, b.useAPIServerCache, false)
434440
}
435441

436442
func (b *Builder) buildReplicationControllerStores() []cache.Store {
437-
return b.buildStoresFunc(replicationControllerMetricFamilies, &v1.ReplicationController{}, createReplicationControllerListWatch, b.useAPIServerCache)
443+
return b.buildStoresFunc(replicationControllerMetricFamilies, &v1.ReplicationController{}, createReplicationControllerListWatch, b.useAPIServerCache, false)
438444
}
439445

440446
func (b *Builder) buildResourceQuotaStores() []cache.Store {
441-
return b.buildStoresFunc(resourceQuotaMetricFamilies(b.allowAnnotationsList["resourcequotas"], b.allowLabelsList["resourcequotas"]), &v1.ResourceQuota{}, createResourceQuotaListWatch, b.useAPIServerCache)
447+
return b.buildStoresFunc(resourceQuotaMetricFamilies(b.allowAnnotationsList["resourcequotas"], b.allowLabelsList["resourcequotas"]), &v1.ResourceQuota{}, createResourceQuotaListWatch, b.useAPIServerCache, false)
442448
}
443449

444450
func (b *Builder) buildSecretStores() []cache.Store {
445-
return b.buildStoresFunc(secretMetricFamilies(b.allowAnnotationsList["secrets"], b.allowLabelsList["secrets"]), &v1.Secret{}, createSecretListWatch, b.useAPIServerCache)
451+
return b.buildStoresFunc(secretMetricFamilies(b.allowAnnotationsList["secrets"], b.allowLabelsList["secrets"]), &v1.Secret{}, createSecretListWatch, b.useAPIServerCache, true)
446452
}
447453

448454
func (b *Builder) buildServiceAccountStores() []cache.Store {
449-
return b.buildStoresFunc(serviceAccountMetricFamilies(b.allowAnnotationsList["serviceaccounts"], b.allowLabelsList["serviceaccounts"]), &v1.ServiceAccount{}, createServiceAccountListWatch, b.useAPIServerCache)
455+
return b.buildStoresFunc(serviceAccountMetricFamilies(b.allowAnnotationsList["serviceaccounts"], b.allowLabelsList["serviceaccounts"]), &v1.ServiceAccount{}, createServiceAccountListWatch, b.useAPIServerCache, false)
450456
}
451457

452458
func (b *Builder) buildServiceStores() []cache.Store {
453-
return b.buildStoresFunc(serviceMetricFamilies(b.allowAnnotationsList["services"], b.allowLabelsList["services"]), &v1.Service{}, createServiceListWatch, b.useAPIServerCache)
459+
return b.buildStoresFunc(serviceMetricFamilies(b.allowAnnotationsList["services"], b.allowLabelsList["services"]), &v1.Service{}, createServiceListWatch, b.useAPIServerCache, false)
454460
}
455461

456462
func (b *Builder) buildStatefulSetStores() []cache.Store {
457-
return b.buildStoresFunc(statefulSetMetricFamilies(b.allowAnnotationsList["statefulsets"], b.allowLabelsList["statefulsets"]), &appsv1.StatefulSet{}, createStatefulSetListWatch, b.useAPIServerCache)
463+
return b.buildStoresFunc(statefulSetMetricFamilies(b.allowAnnotationsList["statefulsets"], b.allowLabelsList["statefulsets"]), &appsv1.StatefulSet{}, createStatefulSetListWatch, b.useAPIServerCache, false)
458464
}
459465

460466
func (b *Builder) buildStorageClassStores() []cache.Store {
461-
return b.buildStoresFunc(storageClassMetricFamilies(b.allowAnnotationsList["storageclasses"], b.allowLabelsList["storageclasses"]), &storagev1.StorageClass{}, createStorageClassListWatch, b.useAPIServerCache)
467+
return b.buildStoresFunc(storageClassMetricFamilies(b.allowAnnotationsList["storageclasses"], b.allowLabelsList["storageclasses"]), &storagev1.StorageClass{}, createStorageClassListWatch, b.useAPIServerCache, false)
462468
}
463469

464470
func (b *Builder) buildPodStores() []cache.Store {
465-
return b.buildStoresFunc(podMetricFamilies(b.allowAnnotationsList["pods"], b.allowLabelsList["pods"]), &v1.Pod{}, createPodListWatch, b.useAPIServerCache)
471+
return b.buildStoresFunc(podMetricFamilies(b.allowAnnotationsList["pods"], b.allowLabelsList["pods"]), &v1.Pod{}, createPodListWatch, b.useAPIServerCache, false)
466472
}
467473

468474
func (b *Builder) buildCsrStores() []cache.Store {
469-
return b.buildStoresFunc(csrMetricFamilies(b.allowAnnotationsList["certificatesigningrequests"], b.allowLabelsList["certificatesigningrequests"]), &certv1.CertificateSigningRequest{}, createCSRListWatch, b.useAPIServerCache)
475+
return b.buildStoresFunc(csrMetricFamilies(b.allowAnnotationsList["certificatesigningrequests"], b.allowLabelsList["certificatesigningrequests"]), &certv1.CertificateSigningRequest{}, createCSRListWatch, b.useAPIServerCache, false)
470476
}
471477

472478
func (b *Builder) buildValidatingWebhookConfigurationStores() []cache.Store {
473-
return b.buildStoresFunc(validatingWebhookConfigurationMetricFamilies, &admissionregistrationv1.ValidatingWebhookConfiguration{}, createValidatingWebhookConfigurationListWatch, b.useAPIServerCache)
479+
return b.buildStoresFunc(validatingWebhookConfigurationMetricFamilies, &admissionregistrationv1.ValidatingWebhookConfiguration{}, createValidatingWebhookConfigurationListWatch, b.useAPIServerCache, false)
474480
}
475481

476482
func (b *Builder) buildVolumeAttachmentStores() []cache.Store {
477-
return b.buildStoresFunc(volumeAttachmentMetricFamilies, &storagev1.VolumeAttachment{}, createVolumeAttachmentListWatch, b.useAPIServerCache)
483+
return b.buildStoresFunc(volumeAttachmentMetricFamilies, &storagev1.VolumeAttachment{}, createVolumeAttachmentListWatch, b.useAPIServerCache, false)
478484
}
479485

480486
func (b *Builder) buildLeasesStores() []cache.Store {
481-
return b.buildStoresFunc(leaseMetricFamilies, &coordinationv1.Lease{}, createLeaseListWatch, b.useAPIServerCache)
487+
return b.buildStoresFunc(leaseMetricFamilies, &coordinationv1.Lease{}, createLeaseListWatch, b.useAPIServerCache, false)
482488
}
483489

484490
func (b *Builder) buildClusterRoleStores() []cache.Store {
485-
return b.buildStoresFunc(clusterRoleMetricFamilies(b.allowAnnotationsList["clusterroles"], b.allowLabelsList["clusterroles"]), &rbacv1.ClusterRole{}, createClusterRoleListWatch, b.useAPIServerCache)
491+
return b.buildStoresFunc(clusterRoleMetricFamilies(b.allowAnnotationsList["clusterroles"], b.allowLabelsList["clusterroles"]), &rbacv1.ClusterRole{}, createClusterRoleListWatch, b.useAPIServerCache, false)
486492
}
487493

488494
func (b *Builder) buildRoleStores() []cache.Store {
489-
return b.buildStoresFunc(roleMetricFamilies(b.allowAnnotationsList["roles"], b.allowLabelsList["roles"]), &rbacv1.Role{}, createRoleListWatch, b.useAPIServerCache)
495+
return b.buildStoresFunc(roleMetricFamilies(b.allowAnnotationsList["roles"], b.allowLabelsList["roles"]), &rbacv1.Role{}, createRoleListWatch, b.useAPIServerCache, false)
490496
}
491497

492498
func (b *Builder) buildClusterRoleBindingStores() []cache.Store {
493-
return b.buildStoresFunc(clusterRoleBindingMetricFamilies(b.allowAnnotationsList["clusterrolebindings"], b.allowLabelsList["clusterrolebindings"]), &rbacv1.ClusterRoleBinding{}, createClusterRoleBindingListWatch, b.useAPIServerCache)
499+
return b.buildStoresFunc(clusterRoleBindingMetricFamilies(b.allowAnnotationsList["clusterrolebindings"], b.allowLabelsList["clusterrolebindings"]), &rbacv1.ClusterRoleBinding{}, createClusterRoleBindingListWatch, b.useAPIServerCache, false)
494500
}
495501

496502
func (b *Builder) buildRoleBindingStores() []cache.Store {
497-
return b.buildStoresFunc(roleBindingMetricFamilies(b.allowAnnotationsList["rolebindings"], b.allowLabelsList["rolebindings"]), &rbacv1.RoleBinding{}, createRoleBindingListWatch, b.useAPIServerCache)
503+
return b.buildStoresFunc(roleBindingMetricFamilies(b.allowAnnotationsList["rolebindings"], b.allowLabelsList["rolebindings"]), &rbacv1.RoleBinding{}, createRoleBindingListWatch, b.useAPIServerCache, false)
498504
}
499505

500506
func (b *Builder) buildIngressClassStores() []cache.Store {
501-
return b.buildStoresFunc(ingressClassMetricFamilies(b.allowAnnotationsList["ingressclasses"], b.allowLabelsList["ingressclasses"]), &networkingv1.IngressClass{}, createIngressClassListWatch, b.useAPIServerCache)
507+
return b.buildStoresFunc(ingressClassMetricFamilies(b.allowAnnotationsList["ingressclasses"], b.allowLabelsList["ingressclasses"]), &networkingv1.IngressClass{}, createIngressClassListWatch, b.useAPIServerCache, false)
502508
}
503509

504510
func (b *Builder) buildStores(
505511
metricFamilies []generator.FamilyGenerator,
506512
expectedType interface{},
507513
listWatchFunc func(kubeClient clientset.Interface, ns string, fieldSelector string) cache.ListerWatcher,
508514
useAPIServerCache bool,
515+
metadataOnly bool,
509516
) []cache.Store {
510517
metricFamilies = generator.FilterFamilyGenerators(b.familyGeneratorFilter, metricFamilies)
511518
composedMetricGenFuncs := generator.ComposeMetricGenFuncs(metricFamilies)
@@ -519,7 +526,11 @@ func (b *Builder) buildStores(
519526
if b.fieldSelectorFilter != "" {
520527
klog.InfoS("FieldSelector is used", "fieldSelector", b.fieldSelectorFilter)
521528
}
522-
listWatcher := listWatchFunc(b.kubeClient, v1.NamespaceAll, b.fieldSelectorFilter)
529+
kubeClient := b.kubeClient
530+
if metadataOnly {
531+
kubeClient = b.metadataOnlyKubeClient
532+
}
533+
listWatcher := listWatchFunc(kubeClient, v1.NamespaceAll, b.fieldSelectorFilter)
523534
b.startReflector(expectedType, store, listWatcher, useAPIServerCache)
524535
return []cache.Store{store}
525536
}

pkg/app/server.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,12 @@ func RunKubeStateMetrics(ctx context.Context, opts *options.Options) error {
275275
}
276276
storeBuilder.WithKubeClient(kubeClient)
277277

278+
metadataOnlyKubeClient, err := util.CreateMetadataOnlyKubeClient(opts.Apiserver, opts.Kubeconfig)
279+
if err != nil {
280+
return fmt.Errorf("failed to create metadata-only client: %v", err)
281+
}
282+
storeBuilder.WithMetadataOnlyKubeClient(metadataOnlyKubeClient)
283+
278284
storeBuilder.WithSharding(opts.Shard, opts.TotalShards)
279285
if err := storeBuilder.WithAllowAnnotations(opts.AnnotationsAllowList); err != nil {
280286
return fmt.Errorf("failed to set up annotations allowlist: %v", err)

pkg/builder/builder.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ func (b *Builder) WithKubeClient(c clientset.Interface) {
8484
b.internal.WithKubeClient(c)
8585
}
8686

87+
// WithMetadataOnlyKubeClient sets the metadataOnlyKubeClient property of a Builder.
88+
func (b *Builder) WithMetadataOnlyKubeClient(c clientset.Interface) {
89+
b.internal.WithMetadataOnlyKubeClient(c)
90+
}
91+
8792
// WithCustomResourceClients sets the customResourceClients property of a Builder.
8893
func (b *Builder) WithCustomResourceClients(cs map[string]interface{}) {
8994
b.internal.WithCustomResourceClients(cs)

pkg/builder/types/interfaces.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ type BuilderInterface interface {
3838
WithFieldSelectorFilter(fieldSelectors string)
3939
WithSharding(shard int32, totalShards int)
4040
WithContext(ctx context.Context)
41+
WithMetadataOnlyKubeClient(c clientset.Interface)
4142
WithKubeClient(c clientset.Interface)
4243
WithCustomResourceClients(cs map[string]interface{})
4344
WithUsingAPIServerCache(u bool)
@@ -58,6 +59,7 @@ type BuildStoresFunc func(metricFamilies []generator.FamilyGenerator,
5859
expectedType interface{},
5960
listWatchFunc func(kubeClient clientset.Interface, ns string, fieldSelector string) cache.ListerWatcher,
6061
useAPIServerCache bool,
62+
metadataOnly bool,
6163
) []cache.Store
6264

6365
// BuildCustomResourceStoresFunc function signature that is used to return a list of custom resource cache.Store

0 commit comments

Comments
 (0)