From 7508e5ef11aba987789fc0b51dfae1ee2c89ca1a Mon Sep 17 00:00:00 2001 From: qmhu Date: Thu, 1 Jun 2023 17:03:00 +0800 Subject: [PATCH] fix compile error --- .../recommendation/recommendation_rule_controller.go | 5 +++-- .../recommendation/recommendation_trigger_controller.go | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/controller/recommendation/recommendation_rule_controller.go b/pkg/controller/recommendation/recommendation_rule_controller.go index 7de43cfc3..2f6d8d082 100644 --- a/pkg/controller/recommendation/recommendation_rule_controller.go +++ b/pkg/controller/recommendation/recommendation_rule_controller.go @@ -23,6 +23,7 @@ import ( "k8s.io/client-go/scale" "k8s.io/client-go/tools/record" "k8s.io/client-go/util/retry" + "k8s.io/klog/v2" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" @@ -197,7 +198,7 @@ func (c *RecommendationRuleController) doReconcile(ctx context.Context, recommen if klog.V(6).Enabled() { klog.V(6).InfoS("execute identities", "RecommendationRule", klog.KObj(recommendationRule), "target", identitiesArray[index].GetObjectReference()) } - go executeIdentity(ctx, &wg, c.RecommenderMgr, c.Provider, c.PredictorMgr, recommendationRule, identitiesArray[index], c.Client, c.ScaleClient, timeNow, newStatus.RunNumber) + go executeIdentity(ctx, &wg, c.RecommenderMgr, c.Provider, c.PredictorMgr, recommendationRule, identitiesArray[index], c.Client, c.ScaleClient, c.OOMRecorder, timeNow, newStatus.RunNumber) } wg.Wait() @@ -435,7 +436,7 @@ func generateRecommendationLabels(recommendationRule *analysisv1alph1.Recommenda } func executeIdentity(ctx context.Context, wg *sync.WaitGroup, recommenderMgr recommender.RecommenderManager, provider providers.History, predictorMgr predictormgr.Manager, - recommendationRule *analysisv1alph1.RecommendationRule, id ObjectIdentity, client client.Client, scaleClient scale.ScalesGetter, timeNow metav1.Time, currentRunNumber int32) { + recommendationRule *analysisv1alph1.RecommendationRule, id ObjectIdentity, client client.Client, scaleClient scale.ScalesGetter, oomRecorder oom.Recorder, timeNow metav1.Time, currentRunNumber int32) { defer func() { if wg != nil { wg.Done() diff --git a/pkg/controller/recommendation/recommendation_trigger_controller.go b/pkg/controller/recommendation/recommendation_trigger_controller.go index ab0b3e673..d6f33494a 100644 --- a/pkg/controller/recommendation/recommendation_trigger_controller.go +++ b/pkg/controller/recommendation/recommendation_trigger_controller.go @@ -11,6 +11,7 @@ import ( "k8s.io/client-go/scale" "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" + "k8s.io/klog/v2" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" @@ -105,7 +106,7 @@ func (c *RecommendationTriggerController) Reconcile(ctx context.Context, req ctr return ctrl.Result{}, nil } - executeIdentity(context.TODO(), nil, c.RecommenderMgr, c.Provider, c.PredictorMgr, recommendationRule, id, c.Client, c.ScaleClient, metav1.Now(), newStatus.RunNumber) + executeIdentity(context.TODO(), nil, c.RecommenderMgr, c.Provider, c.PredictorMgr, recommendationRule, id, c.Client, c.ScaleClient, c.OOMRecorder, metav1.Now(), newStatus.RunNumber) if newStatus.Recommendations[currentMissionIndex].Message != "Success" { err = c.Client.Delete(context.TODO(), recommendation) if err != nil {