diff --git a/.golangci.yml b/.golangci.yml index ed72e87a23d..261d25587d3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -69,12 +69,11 @@ issues: linters: - gomnd - dupl - - path: pkg/apis/scheduling/v1beta1/conversion.go - linters: - - golint - - path: generated + - path: v1beta1 linters: - golint + - deadcode - path: fake linters: - golint + - deadcode diff --git a/pkg/apis/scheduling/register.go b/pkg/apis/scheduling/register.go index e214a4e0302..cf62fb4e6ba 100644 --- a/pkg/apis/scheduling/register.go +++ b/pkg/apis/scheduling/register.go @@ -22,9 +22,8 @@ import ( ) var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - localSchemeBuilder = &SchemeBuilder - AddToScheme = SchemeBuilder.AddToScheme + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme ) // GroupName is the group name used in this package. diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 07c3ad0a176..9c0015c32a8 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -31,7 +31,6 @@ import ( var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) -var parameterCodec = runtime.NewParameterCodec(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ batchv1alpha1.AddToScheme, busv1alpha1.AddToScheme, diff --git a/pkg/scheduler/cache/cache_test.go b/pkg/scheduler/cache/cache_test.go index c892d8368f7..91f3ba480d1 100644 --- a/pkg/scheduler/cache/cache_test.go +++ b/pkg/scheduler/cache/cache_test.go @@ -30,39 +30,6 @@ import ( "volcano.sh/volcano/pkg/scheduler/util" ) -func nodesEqual(l, r map[string]*api.NodeInfo) bool { - if len(l) != len(r) { - return false - } - - for k, n := range l { - if !reflect.DeepEqual(n, r[k]) { - return false - } - } - - return true -} - -func jobsEqual(l, r map[api.JobID]*api.JobInfo) bool { - if len(l) != len(r) { - return false - } - - for k, p := range l { - if !reflect.DeepEqual(p, r[k]) { - return false - } - } - - return true -} - -func cacheEqual(l, r *SchedulerCache) bool { - return nodesEqual(l.Nodes, r.Nodes) && - jobsEqual(l.Jobs, r.Jobs) -} - func buildNode(name string, alloc v1.ResourceList) *v1.Node { return &v1.Node{ ObjectMeta: metav1.ObjectMeta{ @@ -111,13 +78,6 @@ func buildResourceList(cpu string, memory string) v1.ResourceList { } } -func buildResource(cpu string, memory string) *api.Resource { - return api.NewResource(v1.ResourceList{ - v1.ResourceCPU: resource.MustParse(cpu), - v1.ResourceMemory: resource.MustParse(memory), - }) -} - func buildOwnerReference(owner string) metav1.OwnerReference { controller := true return metav1.OwnerReference{ diff --git a/pkg/scheduler/plugins/predicates/predicates.go b/pkg/scheduler/plugins/predicates/predicates.go index 52c99d399a0..bde08fec717 100644 --- a/pkg/scheduler/plugins/predicates/predicates.go +++ b/pkg/scheduler/plugins/predicates/predicates.go @@ -17,9 +17,6 @@ limitations under the License. package predicates import ( - "fmt" - "strings" - "k8s.io/klog" "k8s.io/kubernetes/pkg/scheduler/algorithm" "k8s.io/kubernetes/pkg/scheduler/algorithm/predicates" @@ -56,15 +53,6 @@ func (pp *predicatesPlugin) Name() string { return PluginName } -func formatReason(reasons []predicates.PredicateFailureReason) string { - reasonStrings := []string{} - for _, v := range reasons { - reasonStrings = append(reasonStrings, fmt.Sprintf("%v", v.GetReason())) - } - - return strings.Join(reasonStrings, ", ") -} - type predicateEnable struct { memoryPressureEnable bool diskPressureEnable bool diff --git a/test/e2e/util.go b/test/e2e/util.go index f3047d8c0a6..2b210dec1ab 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -1082,27 +1082,6 @@ func IsNodeReady(node *v1.Node) bool { return false } -func waitClusterReady(ctx *context) error { - return wait.Poll(100*time.Millisecond, oneMinute, func() (bool, error) { - if readyNodeAmount(ctx) >= 1 { - return true, nil - } - return false, nil - }) -} - -func readyNodeAmount(ctx *context) int { - var amount int - nodes, err := ctx.kubeclient.CoreV1().Nodes().List(metav1.ListOptions{}) - Expect(err).NotTo(HaveOccurred()) - for _, n := range nodes.Items { - if IsNodeReady(&n) && len(n.Spec.Taints) == 0 { - amount++ - } - } - return amount -} - func waitPodGone(ctx *context, podName, namespace string) error { var additionalError error err := wait.Poll(100*time.Millisecond, oneMinute, func() (bool, error) {