Skip to content

Commit

Permalink
always initialize API config observer
Browse files Browse the repository at this point in the history
  • Loading branch information
tremes committed Jun 8, 2023
1 parent 2715343 commit 39e6f01
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ func (s *Operator) Run(ctx context.Context, controller *controllercmd.Controller
if envVersion, exists := os.LookupEnv("RELEASE_VERSION"); exists {
desiredVersion = envVersion
}
apiConfigObserver, err := configobserver.NewAPIConfigObserver(gatherKubeConfig, controller.EventRecorder, configInformers)
if err != nil {
return err
}

// By default, this will exit(0) the process if the featuregates ever change to a different set of values.
featureGateAccessor := featuregates.NewFeatureGateAccess(
Expand Down Expand Up @@ -120,12 +124,7 @@ func (s *Operator) Run(ctx context.Context, controller *controllercmd.Controller
return fmt.Errorf("can't create --path: %v", err)
}
}
var apiConfigObserver configobserver.APIConfigObserver
if insightsConfigAPIEnabled {
apiConfigObserver, err = configobserver.NewAPIConfigObserver(gatherKubeConfig, controller.EventRecorder, configInformers)
if err != nil {
return err
}
go apiConfigObserver.Run(ctx, 1)
}

Expand Down

0 comments on commit 39e6f01

Please sign in to comment.