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 25, 2022
1 parent e547f07 commit e510f4a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 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,10 +173,10 @@ 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())
for i, factory := range factories {
resources[i] = factory.Name()
}

switch {
Expand Down

0 comments on commit e510f4a

Please sign in to comment.