Skip to content

Commit

Permalink
Merge pull request #833 from aheizi/fix/recommendation_feature_gates
Browse files Browse the repository at this point in the history
fix recommendation feature gates
  • Loading branch information
qmhu authored Jul 7, 2023
2 parents 2466bae + 8b80e8f commit 2a3f5ed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/craned/app/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ func Run(ctx context.Context, opts *options.Options) error {
}
}()

recommenderMgr := initRecommenderManager(opts)
initControllers(podOOMRecorder, mgr, opts, predictorMgr, recommenderMgr, historyDataSources[providers.PrometheusDataSource])
initControllers(podOOMRecorder, mgr, opts, predictorMgr, historyDataSources[providers.PrometheusDataSource])
// initialize custom collector metrics
initMetricCollector(mgr)
runAll(ctx, mgr, predictorMgr, dataSourceProviders[providers.PrometheusDataSource], opts)
Expand Down Expand Up @@ -267,7 +266,7 @@ func initPredictorManager(opts *options.Options, realtimeDataSources map[provide
}

// initControllers setup controllers with manager
func initControllers(oomRecorder oom.Recorder, mgr ctrl.Manager, opts *options.Options, predictorMgr predictor.Manager, recommenderMgr recommendation.RecommenderManager, historyDataSource providers.History) {
func initControllers(oomRecorder oom.Recorder, mgr ctrl.Manager, opts *options.Options, predictorMgr predictor.Manager, historyDataSource providers.History) {
discoveryClientSet, err := discovery.NewDiscoveryClientForConfig(mgr.GetConfig())
if err != nil {
klog.Exit(err, "Unable to create discover client")
Expand Down Expand Up @@ -367,6 +366,8 @@ func initControllers(oomRecorder oom.Recorder, mgr ctrl.Manager, opts *options.O

// TODO(qmhu), change feature gate from analysis to recommendation
if utilfeature.DefaultFeatureGate.Enabled(features.CraneAnalysis) {
recommenderMgr := initRecommenderManager(opts)

if err := (&analytics.Controller{
Client: mgr.GetClient(),
/*Scheme: mgr.GetScheme(),
Expand Down

0 comments on commit 2a3f5ed

Please sign in to comment.