Skip to content

Commit

Permalink
fix ut and fmt error
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudzp committed Apr 17, 2024
1 parent 3bceccd commit d8d5dd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ package recommendation
import (
"context"
"fmt"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic/dynamicinformer"
"k8s.io/client-go/tools/cache"
"sort"
"strconv"
"strings"
Expand All @@ -19,12 +15,16 @@ import (
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
unstructuredv1 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/discovery"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/dynamic/dynamicinformer"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/scale"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/retry"
"k8s.io/klog/v2"
Expand All @@ -34,7 +34,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/predicate"

analysisv1alph1 "github.com/gocrane/api/analysis/v1alpha1"

"github.com/gocrane/crane/pkg/known"
"github.com/gocrane/crane/pkg/metrics"
"github.com/gocrane/crane/pkg/oom"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package recommendation

import (
"reflect"
"testing"

analysisv1alph1 "github.com/gocrane/api/analysis/v1alpha1"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"reflect"
"testing"
)

func TestRecommendationIndex_GetRecommendation(t *testing.T) {
Expand Down Expand Up @@ -69,14 +70,15 @@ func TestRecommendationIndex_GetRecommendation(t *testing.T) {
TargetRef: corev1.ObjectReference{
Namespace: "test-namespace",
Kind: "Deployment",
Name: "test-deployment-name",
Name: "test-deployment-bar",
APIVersion: "app/v1",
},
Type: analysisv1alph1.AnalysisTypeResource,
},
},
args: args{
id: ObjectIdentity{
Name: "test-deployment-name",
Name: "test-deployment-bar",
Namespace: "test-namespace",
APIVersion: "app/v1",
Kind: "Deployment",
Expand Down

0 comments on commit d8d5dd2

Please sign in to comment.