From 54d366e241da73b6065e8a8d87a0b0615b452773 Mon Sep 17 00:00:00 2001 From: ozline Date: Sat, 26 Oct 2024 23:36:31 +0800 Subject: [PATCH] fix: follow the import rules and correct non-standard files --- pkg/client/control/resourcerecommend.go | 5 ++-- pkg/client/control/resourcerecommend_test.go | 5 ++-- .../resourcerecommend_controller.go | 25 ++++++++++--------- .../resourcerecommend_controller_test.go | 3 +-- .../resource-recommend/oom/oom_recorder.go | 18 +++++++------ .../oom/oom_recorder_test.go | 3 +-- .../processor/manager/processor_manager.go | 1 - .../manager/processor_manager_test.go | 1 - .../processor/percentile/process_gc.go | 2 -- .../processor/percentile/processor.go | 3 +-- .../manager/recommender_manager.go | 1 - .../recommenders/percentile_recommender.go | 1 - .../percentile_recommender_test.go | 1 - .../resource/k8s_resource.go | 7 +----- .../resource/k8s_resource_test.go | 3 +-- .../resource/k8s_resource_test_util.go | 3 +-- .../types/conditions/conditions.go | 1 - .../types/conditions/conditions_test.go | 2 -- .../types/processor/task_key.go | 1 - .../types/processor/task_key_test.go | 1 - .../types/recommendation/recommendation.go | 1 - .../recommendation/recommendation_test.go | 3 --- .../types/recommendation/validate.go | 1 - .../types/recommendation/validate_test.go | 8 +++--- 24 files changed, 38 insertions(+), 62 deletions(-) diff --git a/pkg/client/control/resourcerecommend.go b/pkg/client/control/resourcerecommend.go index b063a59a6d..fae879a370 100644 --- a/pkg/client/control/resourcerecommend.go +++ b/pkg/client/control/resourcerecommend.go @@ -21,11 +21,12 @@ import ( "encoding/json" "fmt" - apis "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" - clientset "github.com/kubewharf/katalyst-api/pkg/client/clientset/versioned" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/jsonmergepatch" + + apis "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" + clientset "github.com/kubewharf/katalyst-api/pkg/client/clientset/versioned" ) // ResourceRecommendUpdater is used to update ResourceRecommend CR diff --git a/pkg/client/control/resourcerecommend_test.go b/pkg/client/control/resourcerecommend_test.go index 0c22225139..8ee89c10c9 100644 --- a/pkg/client/control/resourcerecommend_test.go +++ b/pkg/client/control/resourcerecommend_test.go @@ -20,10 +20,11 @@ import ( "context" "testing" - apis "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" - externalfake "github.com/kubewharf/katalyst-api/pkg/client/clientset/versioned/fake" "github.com/stretchr/testify/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + apis "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" + externalfake "github.com/kubewharf/katalyst-api/pkg/client/clientset/versioned/fake" ) func TestPatchResourceRecommend(t *testing.T) { diff --git a/pkg/controller/resource-recommend/controller/resourcerecommend_controller.go b/pkg/controller/resource-recommend/controller/resourcerecommend_controller.go index 97617e56a5..ab1c1c25e0 100644 --- a/pkg/controller/resource-recommend/controller/resourcerecommend_controller.go +++ b/pkg/controller/resource-recommend/controller/resourcerecommend_controller.go @@ -38,7 +38,6 @@ import ( "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" reclister "github.com/kubewharf/katalyst-api/pkg/client/listers/recommendation/v1alpha1" - katalystbase "github.com/kubewharf/katalyst-core/cmd/base" "github.com/kubewharf/katalyst-core/pkg/client/control" "github.com/kubewharf/katalyst-core/pkg/config/controller" @@ -206,21 +205,23 @@ func (rrc *ResourceRecommendController) updateRec(oldObj, newObj interface{}) { } func (rrc *ResourceRecommendController) deleteRec(obj interface{}) { - v, ok := obj.(*v1alpha1.ResourceRecommend) - if !ok { - tombstone, ok := obj.(cache.DeletedFinalStateUnknown) + var rec *v1alpha1.ResourceRecommend = nil + var ok = false + switch t := obj.(type) { + case *v1alpha1.ResourceRecommend: + rec = t + case cache.DeletedFinalStateUnknown: + rec, ok = t.Obj.(*v1alpha1.ResourceRecommend) if !ok { - klog.Errorf("[resource-recommend] cannot convert obj to *apis.ResourceRecommend: %v", obj) - return - } - v, ok = tombstone.Obj.(*v1alpha1.ResourceRecommend) - if !ok { - klog.Errorf("[resource-recommend] cannot convert obj to *apis.ResourceRecommend: %v", obj) + klog.ErrorS(nil, "[resource-recommend] cannot convert obj to *apis.ResourceRecommend: %v", "Obj", t) return } + default: + klog.ErrorS(nil, "Cannot convert to *v1alpha1.ResourceRecommend", "Obj", t) + return } - klog.V(4).Infof("[resource-recommend] notice deletion of ResourceRecommend %s", v.Name) - rrc.dequeueRec(v) + klog.V(4).Infof("[resource-recommend] notice deletion of ResourceRecommend %s", rec.Name) + rrc.dequeueRec(rec) } func (rrc *ResourceRecommendController) enqueueRec(rec *v1alpha1.ResourceRecommend) { diff --git a/pkg/controller/resource-recommend/controller/resourcerecommend_controller_test.go b/pkg/controller/resource-recommend/controller/resourcerecommend_controller_test.go index 4846ab6db4..03cc9708ff 100644 --- a/pkg/controller/resource-recommend/controller/resourcerecommend_controller_test.go +++ b/pkg/controller/resource-recommend/controller/resourcerecommend_controller_test.go @@ -21,9 +21,8 @@ import ( "time" "github.com/bytedance/mockey" - "github.com/smartystreets/goconvey/convey" - promapiv1 "github.com/prometheus/client_golang/api/prometheus/v1" + "github.com/smartystreets/goconvey/convey" "github.com/stretchr/testify/mock" "github.com/kubewharf/katalyst-core/pkg/config/controller" diff --git a/pkg/controller/resource-recommend/oom/oom_recorder.go b/pkg/controller/resource-recommend/oom/oom_recorder.go index bf88906696..ce76cc74a6 100644 --- a/pkg/controller/resource-recommend/oom/oom_recorder.go +++ b/pkg/controller/resource-recommend/oom/oom_recorder.go @@ -23,15 +23,13 @@ import ( "sync" "time" + "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" corev1 "k8s.io/client-go/kubernetes/typed/core/v1" - - "github.com/pkg/errors" - "k8s.io/apimachinery/pkg/api/resource" "k8s.io/client-go/util/workqueue" "k8s.io/klog/v2" - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( @@ -144,9 +142,9 @@ func (r *PodOOMRecorder) updateOOMRecordConfigMap() error { return err } oomConfigMap, err := r.Client.ConfigMaps(ConfigMapOOMRecordNameSpace). - Get(context.TODO(), ConfigMapOOMRecordName, metav1.GetOptions{}) + Get(context.TODO(), ConfigMapOOMRecordName, metav1.GetOptions{ResourceVersion: "0"}) if err != nil { - if apierrors.IsNotFound(err) { + if !apierrors.IsNotFound(err) { return err } oomConfigMap.Name = ConfigMapOOMRecordName @@ -214,9 +212,13 @@ func (r *PodOOMRecorder) Run(stopCh <-chan struct{}) error { func (r *PodOOMRecorder) ListOOMRecordsFromConfigmap() ([]OOMRecord, error) { oomConfigMap, err := r.Client.ConfigMaps(ConfigMapOOMRecordNameSpace). - Get(context.TODO(), ConfigMapOOMRecordName, metav1.GetOptions{}) + Get(context.TODO(), ConfigMapOOMRecordName, metav1.GetOptions{ResourceVersion: "0"}) if err != nil { - return nil, client.IgnoreNotFound(err) + // if ConfigMap cant be found, we return an empty list + if apierrors.IsNotFound(err) { + return []OOMRecord{}, nil + } + return nil, err } oomRecords := make([]OOMRecord, 0) err = json.Unmarshal([]byte(oomConfigMap.Data[ConfigMapDataOOMRecord]), &oomRecords) diff --git a/pkg/controller/resource-recommend/oom/oom_recorder_test.go b/pkg/controller/resource-recommend/oom/oom_recorder_test.go index 84d03ded06..a4ad38f778 100644 --- a/pkg/controller/resource-recommend/oom/oom_recorder_test.go +++ b/pkg/controller/resource-recommend/oom/oom_recorder_test.go @@ -21,11 +21,10 @@ import ( "testing" "time" - k8sfake "k8s.io/client-go/kubernetes/fake" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8sfake "k8s.io/client-go/kubernetes/fake" ) func TestCleanOOMRecord(t *testing.T) { diff --git a/pkg/controller/resource-recommend/processor/manager/processor_manager.go b/pkg/controller/resource-recommend/processor/manager/processor_manager.go index cf590ab437..aa332ae041 100644 --- a/pkg/controller/resource-recommend/processor/manager/processor_manager.go +++ b/pkg/controller/resource-recommend/processor/manager/processor_manager.go @@ -23,7 +23,6 @@ import ( "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" lister "github.com/kubewharf/katalyst-api/pkg/client/listers/recommendation/v1alpha1" - "github.com/kubewharf/katalyst-core/pkg/controller/resource-recommend/datasource" "github.com/kubewharf/katalyst-core/pkg/controller/resource-recommend/processor" "github.com/kubewharf/katalyst-core/pkg/controller/resource-recommend/processor/percentile" diff --git a/pkg/controller/resource-recommend/processor/manager/processor_manager_test.go b/pkg/controller/resource-recommend/processor/manager/processor_manager_test.go index 3667eaeebb..23e6db1d87 100644 --- a/pkg/controller/resource-recommend/processor/manager/processor_manager_test.go +++ b/pkg/controller/resource-recommend/processor/manager/processor_manager_test.go @@ -23,7 +23,6 @@ import ( "time" "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" - "github.com/kubewharf/katalyst-core/pkg/controller/resource-recommend/processor" "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/log" errortypes "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/types/error" diff --git a/pkg/controller/resource-recommend/processor/percentile/process_gc.go b/pkg/controller/resource-recommend/processor/percentile/process_gc.go index 841eb8faab..4acfb5a9b5 100644 --- a/pkg/controller/resource-recommend/processor/percentile/process_gc.go +++ b/pkg/controller/resource-recommend/processor/percentile/process_gc.go @@ -22,12 +22,10 @@ import ( "time" "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/types" "k8s.io/klog/v2" "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" - "github.com/kubewharf/katalyst-core/pkg/controller/resource-recommend/processor/percentile/task" "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/log" processortypes "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/types/processor" diff --git a/pkg/controller/resource-recommend/processor/percentile/processor.go b/pkg/controller/resource-recommend/processor/percentile/processor.go index 710109f582..adf1bbaa8a 100644 --- a/pkg/controller/resource-recommend/processor/percentile/processor.go +++ b/pkg/controller/resource-recommend/processor/percentile/processor.go @@ -22,14 +22,13 @@ import ( "sync" "time" - "github.com/kubewharf/katalyst-api/pkg/client/listers/recommendation/v1alpha1" - "github.com/pkg/errors" "golang.org/x/time/rate" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/util/workqueue" "k8s.io/klog/v2" + "github.com/kubewharf/katalyst-api/pkg/client/listers/recommendation/v1alpha1" "github.com/kubewharf/katalyst-core/pkg/controller/resource-recommend/datasource" "github.com/kubewharf/katalyst-core/pkg/controller/resource-recommend/processor" "github.com/kubewharf/katalyst-core/pkg/controller/resource-recommend/processor/percentile/task" diff --git a/pkg/controller/resource-recommend/recommender/manager/recommender_manager.go b/pkg/controller/resource-recommend/recommender/manager/recommender_manager.go index 112e2ecdd1..146196cf95 100644 --- a/pkg/controller/resource-recommend/recommender/manager/recommender_manager.go +++ b/pkg/controller/resource-recommend/recommender/manager/recommender_manager.go @@ -20,7 +20,6 @@ import ( "k8s.io/klog/v2" "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" - "github.com/kubewharf/katalyst-core/pkg/controller/resource-recommend/oom" processormanager "github.com/kubewharf/katalyst-core/pkg/controller/resource-recommend/processor/manager" "github.com/kubewharf/katalyst-core/pkg/controller/resource-recommend/recommender" diff --git a/pkg/controller/resource-recommend/recommender/recommenders/percentile_recommender.go b/pkg/controller/resource-recommend/recommender/recommenders/percentile_recommender.go index 25cc38b121..729370c1fd 100644 --- a/pkg/controller/resource-recommend/recommender/recommenders/percentile_recommender.go +++ b/pkg/controller/resource-recommend/recommender/recommenders/percentile_recommender.go @@ -26,7 +26,6 @@ import ( "k8s.io/klog/v2" "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" - "github.com/kubewharf/katalyst-core/pkg/controller/resource-recommend/oom" "github.com/kubewharf/katalyst-core/pkg/controller/resource-recommend/processor" "github.com/kubewharf/katalyst-core/pkg/controller/resource-recommend/recommender" diff --git a/pkg/controller/resource-recommend/recommender/recommenders/percentile_recommender_test.go b/pkg/controller/resource-recommend/recommender/recommenders/percentile_recommender_test.go index f68d414b4f..ec1eee7b72 100644 --- a/pkg/controller/resource-recommend/recommender/recommenders/percentile_recommender_test.go +++ b/pkg/controller/resource-recommend/recommender/recommenders/percentile_recommender_test.go @@ -27,7 +27,6 @@ import ( "k8s.io/apimachinery/pkg/types" "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" - "github.com/kubewharf/katalyst-core/pkg/controller/resource-recommend/oom" datasourcetypes "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/types/datasource" customtypes "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/types/error" diff --git a/pkg/util/resource-recommend/resource/k8s_resource.go b/pkg/util/resource-recommend/resource/k8s_resource.go index d606c1f317..645925fd53 100644 --- a/pkg/util/resource-recommend/resource/k8s_resource.go +++ b/pkg/util/resource-recommend/resource/k8s_resource.go @@ -45,12 +45,7 @@ func ConvertAndGetResource(ctx context.Context, client dynamic.Interface, Group: gvk.Group, Version: gvk.Version, Resource: mapping.Resource.Resource, - }).Namespace(namespace).Get(ctx, targetRef.Name, metav1.GetOptions{ - TypeMeta: metav1.TypeMeta{ - APIVersion: targetRef.APIVersion, - Kind: targetRef.Kind, - }, - }) + }).Namespace(namespace).Get(ctx, targetRef.Name, metav1.GetOptions{ResourceVersion: "0"}) if err != nil { return nil, err } diff --git a/pkg/util/resource-recommend/resource/k8s_resource_test.go b/pkg/util/resource-recommend/resource/k8s_resource_test.go index e049bed305..e71d87e4b5 100644 --- a/pkg/util/resource-recommend/resource/k8s_resource_test.go +++ b/pkg/util/resource-recommend/resource/k8s_resource_test.go @@ -21,10 +21,9 @@ import ( "reflect" "testing" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/dynamic" - - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" dynamicfake "k8s.io/client-go/dynamic/fake" "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" diff --git a/pkg/util/resource-recommend/resource/k8s_resource_test_util.go b/pkg/util/resource-recommend/resource/k8s_resource_test_util.go index 87ae1dd498..545f618a82 100644 --- a/pkg/util/resource-recommend/resource/k8s_resource_test_util.go +++ b/pkg/util/resource-recommend/resource/k8s_resource_test_util.go @@ -19,6 +19,7 @@ package resource import ( "context" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -29,8 +30,6 @@ import ( corev1 "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/restmapper" clientTesting "k8s.io/client-go/testing" - - v1 "k8s.io/api/core/v1" ) func CreateMockPod(labels, annotations map[string]string, name, namespace, nodeName string, containers []v1.Container, client corev1.CoreV1Interface) error { diff --git a/pkg/util/resource-recommend/types/conditions/conditions.go b/pkg/util/resource-recommend/types/conditions/conditions.go index 3a2d777630..fe82244b01 100644 --- a/pkg/util/resource-recommend/types/conditions/conditions.go +++ b/pkg/util/resource-recommend/types/conditions/conditions.go @@ -23,7 +23,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" - errortypes "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/types/error" ) diff --git a/pkg/util/resource-recommend/types/conditions/conditions_test.go b/pkg/util/resource-recommend/types/conditions/conditions_test.go index 396e08c070..7a0dc8d0ac 100644 --- a/pkg/util/resource-recommend/types/conditions/conditions_test.go +++ b/pkg/util/resource-recommend/types/conditions/conditions_test.go @@ -23,12 +23,10 @@ import ( "github.com/bytedance/mockey" "github.com/smartystreets/goconvey/convey" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" - errortypes "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/types/error" ) diff --git a/pkg/util/resource-recommend/types/processor/task_key.go b/pkg/util/resource-recommend/types/processor/task_key.go index bcc6b4cb74..c375d3da76 100644 --- a/pkg/util/resource-recommend/types/processor/task_key.go +++ b/pkg/util/resource-recommend/types/processor/task_key.go @@ -23,7 +23,6 @@ import ( "k8s.io/apimachinery/pkg/types" "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" - datasourcetypes "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/types/datasource" ) diff --git a/pkg/util/resource-recommend/types/processor/task_key_test.go b/pkg/util/resource-recommend/types/processor/task_key_test.go index f212bceff4..4af2f45e90 100644 --- a/pkg/util/resource-recommend/types/processor/task_key_test.go +++ b/pkg/util/resource-recommend/types/processor/task_key_test.go @@ -24,7 +24,6 @@ import ( "k8s.io/apimachinery/pkg/types" "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" - datasourcetype "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/types/datasource" ) diff --git a/pkg/util/resource-recommend/types/recommendation/recommendation.go b/pkg/util/resource-recommend/types/recommendation/recommendation.go index a3023a840d..7ae3bb4e80 100644 --- a/pkg/util/resource-recommend/types/recommendation/recommendation.go +++ b/pkg/util/resource-recommend/types/recommendation/recommendation.go @@ -27,7 +27,6 @@ import ( "k8s.io/klog/v2" "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" - conditionstypes "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/types/conditions" errortypes "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/types/error" ) diff --git a/pkg/util/resource-recommend/types/recommendation/recommendation_test.go b/pkg/util/resource-recommend/types/recommendation/recommendation_test.go index 4adab1f4dd..6faac86f82 100644 --- a/pkg/util/resource-recommend/types/recommendation/recommendation_test.go +++ b/pkg/util/resource-recommend/types/recommendation/recommendation_test.go @@ -23,16 +23,13 @@ import ( "time" "github.com/bytedance/mockey" - _ "github.com/bytedance/mockey" "github.com/smartystreets/goconvey/convey" - _ "github.com/smartystreets/goconvey/convey" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" dynamicfake "k8s.io/client-go/dynamic/fake" "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" - resourceutils "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/resource" conditionstypes "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/types/conditions" errortypes "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/types/error" diff --git a/pkg/util/resource-recommend/types/recommendation/validate.go b/pkg/util/resource-recommend/types/recommendation/validate.go index f1c95b9dc4..56926efb32 100644 --- a/pkg/util/resource-recommend/types/recommendation/validate.go +++ b/pkg/util/resource-recommend/types/recommendation/validate.go @@ -25,7 +25,6 @@ import ( k8sclient "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" - "github.com/kubewharf/katalyst-core/pkg/util/general" resourceutils "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/resource" errortypes "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/types/error" diff --git a/pkg/util/resource-recommend/types/recommendation/validate_test.go b/pkg/util/resource-recommend/types/recommendation/validate_test.go index 3342625b7e..646ceeddcb 100644 --- a/pkg/util/resource-recommend/types/recommendation/validate_test.go +++ b/pkg/util/resource-recommend/types/recommendation/validate_test.go @@ -21,16 +21,14 @@ import ( "reflect" "testing" - "k8s.io/client-go/dynamic" - k8sfake "k8s.io/client-go/kubernetes/fake" - corev1 "k8s.io/client-go/kubernetes/typed/core/v1" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/dynamic" dynamicfake "k8s.io/client-go/dynamic/fake" + k8sfake "k8s.io/client-go/kubernetes/fake" + corev1 "k8s.io/client-go/kubernetes/typed/core/v1" "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1" - resourceutils "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/resource" errortypes "github.com/kubewharf/katalyst-core/pkg/util/resource-recommend/types/error" )