Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix recommendation feature gates #833

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading