Skip to content

Commit

Permalink
Include feedback from review
Browse files Browse the repository at this point in the history
  • Loading branch information
mrueg committed Dec 17, 2022
1 parent e547f07 commit 07c2ab6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ func RunKubeStateMetricsWrapper(ctx context.Context, opts *options.Options) erro
// Any out-of-tree custom resource metrics could be registered by newing a registry factory
// which implements customresource.RegistryFactory and pass all factories into this function.
func RunKubeStateMetrics(ctx context.Context, opts *options.Options) error {
var factories []customresource.RegistryFactory
promLogger := promLogger{}

storeBuilder := store.NewBuilder()
Expand Down Expand Up @@ -152,12 +151,13 @@ func RunKubeStateMetrics(ctx context.Context, opts *options.Options) error {
return err
}

var factories []customresource.RegistryFactory

if config != nil {
crf, err := customresourcestate.FromConfig(config)
factories, err = customresourcestate.FromConfig(config)
if err != nil {
return fmt.Errorf("Parsing from Custom Resource State Metrics file failed: %v", err)
}
factories = append(factories, crf...)
}
storeBuilder.WithCustomResourceStoreFactories(factories...)

Expand All @@ -173,7 +173,7 @@ func RunKubeStateMetrics(ctx context.Context, opts *options.Options) error {

}

var resources []string
resources := make([]string, len(factories))

for _, factory := range factories {
resources = append(resources, factory.Name())
Expand Down

0 comments on commit 07c2ab6

Please sign in to comment.