Skip to content

Commit 39e6f01

Browse files
committed
always initialize API config observer
1 parent 2715343 commit 39e6f01

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

pkg/controller/operator.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ func (s *Operator) Run(ctx context.Context, controller *controllercmd.Controller
8989
if envVersion, exists := os.LookupEnv("RELEASE_VERSION"); exists {
9090
desiredVersion = envVersion
9191
}
92+
apiConfigObserver, err := configobserver.NewAPIConfigObserver(gatherKubeConfig, controller.EventRecorder, configInformers)
93+
if err != nil {
94+
return err
95+
}
9296

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

0 commit comments

Comments
 (0)