@@ -32,6 +32,10 @@ import (
32
32
"k8s.io/kube-state-metrics/v2/pkg/options"
33
33
)
34
34
35
+ // Make sure the public Builder implements the public BuilderInterface.
36
+ // New internal Builder methods should be added to the public BuilderInterface.
37
+ var _ ksmtypes.BuilderInterface = & Builder {}
38
+
35
39
// Builder helps to build store. It follows the builder pattern
36
40
// (https://en.wikipedia.org/wiki/Builder_pattern).
37
41
type Builder struct {
@@ -61,6 +65,11 @@ func (b *Builder) WithNamespaces(n options.NamespaceList) {
61
65
b .internal .WithNamespaces (n )
62
66
}
63
67
68
+ // WithFieldSelectorFilter sets the fieldSelector property of a Builder.
69
+ func (b * Builder ) WithFieldSelectorFilter (fieldSelectorFilter string ) {
70
+ b .internal .WithFieldSelectorFilter (fieldSelectorFilter )
71
+ }
72
+
64
73
// WithSharding sets the shard and totalShards property of a Builder.
65
74
func (b * Builder ) WithSharding (shard int32 , totalShards int ) {
66
75
b .internal .WithSharding (shard , totalShards )
@@ -103,8 +112,8 @@ func (b *Builder) WithAllowAnnotations(annotations map[string][]string) {
103
112
}
104
113
105
114
// WithAllowLabels configures which labels can be returned for metrics
106
- func (b * Builder ) WithAllowLabels (l map [string ][]string ) {
107
- b .internal .WithAllowLabels (l )
115
+ func (b * Builder ) WithAllowLabels (l map [string ][]string ) error {
116
+ return b .internal .WithAllowLabels (l )
108
117
}
109
118
110
119
// WithGenerateStoresFunc configures a custom generate store function
0 commit comments