From bfdeda58b7dbff4bf84f4c55df632702ed1ca966 Mon Sep 17 00:00:00 2001 From: Ali Date: Wed, 21 Oct 2020 01:55:05 +1100 Subject: [PATCH] Delete framework/v1alpha1 folder and change remaining import paths --- pkg/kubelet/BUILD | 2 +- pkg/kubelet/cm/BUILD | 2 +- pkg/kubelet/cm/container_manager.go | 2 +- pkg/kubelet/cm/container_manager_linux.go | 2 +- pkg/kubelet/cm/container_manager_stub.go | 2 +- pkg/kubelet/cm/container_manager_windows.go | 2 +- pkg/kubelet/cm/devicemanager/BUILD | 4 +- pkg/kubelet/cm/devicemanager/manager.go | 2 +- pkg/kubelet/cm/devicemanager/manager_stub.go | 2 +- pkg/kubelet/cm/devicemanager/manager_test.go | 2 +- pkg/kubelet/cm/devicemanager/types.go | 2 +- pkg/kubelet/kubelet_test.go | 2 +- pkg/kubelet/lifecycle/BUILD | 4 +- pkg/kubelet/lifecycle/predicate.go | 2 +- pkg/kubelet/lifecycle/predicate_test.go | 2 +- pkg/scheduler/framework/BUILD | 1 - pkg/scheduler/framework/v1alpha1/BUILD | 26 ------- pkg/scheduler/framework/v1alpha1/types.go | 78 -------------------- test/e2e/framework/.import-restrictions | 1 - 19 files changed, 17 insertions(+), 123 deletions(-) delete mode 100644 pkg/scheduler/framework/v1alpha1/BUILD delete mode 100644 pkg/scheduler/framework/v1alpha1/types.go diff --git a/pkg/kubelet/BUILD b/pkg/kubelet/BUILD index 437d99d2d7084..ff5f1a7657b93 100644 --- a/pkg/kubelet/BUILD +++ b/pkg/kubelet/BUILD @@ -225,7 +225,7 @@ go_test( "//pkg/kubelet/util/queue:go_default_library", "//pkg/kubelet/util/sliceutils:go_default_library", "//pkg/kubelet/volumemanager:go_default_library", - "//pkg/scheduler/framework/v1alpha1:go_default_library", + "//pkg/scheduler/framework:go_default_library", "//pkg/util/taints:go_default_library", "//pkg/volume:go_default_library", "//pkg/volume/awsebs:go_default_library", diff --git a/pkg/kubelet/cm/BUILD b/pkg/kubelet/cm/BUILD index dab983bf21c81..107878444be34 100644 --- a/pkg/kubelet/cm/BUILD +++ b/pkg/kubelet/cm/BUILD @@ -35,7 +35,7 @@ go_library( "//pkg/kubelet/lifecycle:go_default_library", "//pkg/kubelet/pluginmanager/cache:go_default_library", "//pkg/kubelet/status:go_default_library", - "//pkg/scheduler/framework/v1alpha1:go_default_library", + "//pkg/scheduler/framework:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", diff --git a/pkg/kubelet/cm/container_manager.go b/pkg/kubelet/cm/container_manager.go index 8436bfbac91cd..83c150cbec1c3 100644 --- a/pkg/kubelet/cm/container_manager.go +++ b/pkg/kubelet/cm/container_manager.go @@ -31,7 +31,7 @@ import ( "k8s.io/kubernetes/pkg/kubelet/lifecycle" "k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache" "k8s.io/kubernetes/pkg/kubelet/status" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1" + schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" "fmt" "strconv" diff --git a/pkg/kubelet/cm/container_manager_linux.go b/pkg/kubelet/cm/container_manager_linux.go index 6ba41468776ca..aaf6b88f573e4 100644 --- a/pkg/kubelet/cm/container_manager_linux.go +++ b/pkg/kubelet/cm/container_manager_linux.go @@ -62,7 +62,7 @@ import ( "k8s.io/kubernetes/pkg/kubelet/qos" "k8s.io/kubernetes/pkg/kubelet/stats/pidlimit" "k8s.io/kubernetes/pkg/kubelet/status" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1" + schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" "k8s.io/kubernetes/pkg/util/oom" "k8s.io/kubernetes/pkg/util/procfs" utilsysctl "k8s.io/kubernetes/pkg/util/sysctl" diff --git a/pkg/kubelet/cm/container_manager_stub.go b/pkg/kubelet/cm/container_manager_stub.go index 850b9eaf10950..03387f2c479e5 100644 --- a/pkg/kubelet/cm/container_manager_stub.go +++ b/pkg/kubelet/cm/container_manager_stub.go @@ -30,7 +30,7 @@ import ( "k8s.io/kubernetes/pkg/kubelet/lifecycle" "k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache" "k8s.io/kubernetes/pkg/kubelet/status" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1" + schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" ) type containerManagerStub struct { diff --git a/pkg/kubelet/cm/container_manager_windows.go b/pkg/kubelet/cm/container_manager_windows.go index 838ab83b36094..47a17a0f83707 100644 --- a/pkg/kubelet/cm/container_manager_windows.go +++ b/pkg/kubelet/cm/container_manager_windows.go @@ -42,7 +42,7 @@ import ( "k8s.io/kubernetes/pkg/kubelet/lifecycle" "k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache" "k8s.io/kubernetes/pkg/kubelet/status" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1" + schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" ) type containerManagerImpl struct { diff --git a/pkg/kubelet/cm/devicemanager/BUILD b/pkg/kubelet/cm/devicemanager/BUILD index c49b84eb825e2..071dbaebc7b8a 100644 --- a/pkg/kubelet/cm/devicemanager/BUILD +++ b/pkg/kubelet/cm/devicemanager/BUILD @@ -26,7 +26,7 @@ go_library( "//pkg/kubelet/lifecycle:go_default_library", "//pkg/kubelet/metrics:go_default_library", "//pkg/kubelet/pluginmanager/cache:go_default_library", - "//pkg/scheduler/framework/v1alpha1:go_default_library", + "//pkg/scheduler/framework:go_default_library", "//pkg/util/selinux:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library", @@ -57,7 +57,7 @@ go_test( "//pkg/kubelet/config:go_default_library", "//pkg/kubelet/lifecycle:go_default_library", "//pkg/kubelet/pluginmanager:go_default_library", - "//pkg/scheduler/framework/v1alpha1:go_default_library", + "//pkg/scheduler/framework:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/pkg/kubelet/cm/devicemanager/manager.go b/pkg/kubelet/cm/devicemanager/manager.go index 9f3c40a899368..369cc59c569fd 100644 --- a/pkg/kubelet/cm/devicemanager/manager.go +++ b/pkg/kubelet/cm/devicemanager/manager.go @@ -47,7 +47,7 @@ import ( "k8s.io/kubernetes/pkg/kubelet/lifecycle" "k8s.io/kubernetes/pkg/kubelet/metrics" "k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1" + schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" "k8s.io/kubernetes/pkg/util/selinux" ) diff --git a/pkg/kubelet/cm/devicemanager/manager_stub.go b/pkg/kubelet/cm/devicemanager/manager_stub.go index ad54b17fbc402..626f4c397917e 100644 --- a/pkg/kubelet/cm/devicemanager/manager_stub.go +++ b/pkg/kubelet/cm/devicemanager/manager_stub.go @@ -23,7 +23,7 @@ import ( "k8s.io/kubernetes/pkg/kubelet/config" "k8s.io/kubernetes/pkg/kubelet/lifecycle" "k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1" + schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" ) // ManagerStub provides a simple stub implementation for the Device Manager. diff --git a/pkg/kubelet/cm/devicemanager/manager_test.go b/pkg/kubelet/cm/devicemanager/manager_test.go index f4fb2a81069e9..6b40f1f9ef1a4 100644 --- a/pkg/kubelet/cm/devicemanager/manager_test.go +++ b/pkg/kubelet/cm/devicemanager/manager_test.go @@ -42,7 +42,7 @@ import ( "k8s.io/kubernetes/pkg/kubelet/config" "k8s.io/kubernetes/pkg/kubelet/lifecycle" "k8s.io/kubernetes/pkg/kubelet/pluginmanager" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1" + schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" ) const ( diff --git a/pkg/kubelet/cm/devicemanager/types.go b/pkg/kubelet/cm/devicemanager/types.go index 39cdf65a14cf4..4559da0ce554c 100644 --- a/pkg/kubelet/cm/devicemanager/types.go +++ b/pkg/kubelet/cm/devicemanager/types.go @@ -26,7 +26,7 @@ import ( kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/lifecycle" "k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1" + schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" ) // Manager manages all the Device Plugins running on a node. diff --git a/pkg/kubelet/kubelet_test.go b/pkg/kubelet/kubelet_test.go index cff25f50728f7..b984525249d55 100644 --- a/pkg/kubelet/kubelet_test.go +++ b/pkg/kubelet/kubelet_test.go @@ -68,7 +68,7 @@ import ( kubetypes "k8s.io/kubernetes/pkg/kubelet/types" "k8s.io/kubernetes/pkg/kubelet/util/queue" kubeletvolume "k8s.io/kubernetes/pkg/kubelet/volumemanager" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1" + schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" "k8s.io/kubernetes/pkg/volume" "k8s.io/kubernetes/pkg/volume/awsebs" "k8s.io/kubernetes/pkg/volume/azuredd" diff --git a/pkg/kubelet/lifecycle/BUILD b/pkg/kubelet/lifecycle/BUILD index 05f2963b1cedc..d08f5ee1d94d1 100644 --- a/pkg/kubelet/lifecycle/BUILD +++ b/pkg/kubelet/lifecycle/BUILD @@ -21,12 +21,12 @@ go_library( "//pkg/kubelet/container:go_default_library", "//pkg/kubelet/types:go_default_library", "//pkg/kubelet/util/format:go_default_library", + "//pkg/scheduler/framework:go_default_library", "//pkg/scheduler/framework/plugins/helper:go_default_library", "//pkg/scheduler/framework/plugins/nodeaffinity:go_default_library", "//pkg/scheduler/framework/plugins/nodename:go_default_library", "//pkg/scheduler/framework/plugins/nodeports:go_default_library", "//pkg/scheduler/framework/plugins/noderesources:go_default_library", - "//pkg/scheduler/framework/v1alpha1:go_default_library", "//pkg/security/apparmor:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", @@ -47,9 +47,9 @@ go_test( "//pkg/apis/core/v1/helper:go_default_library", "//pkg/kubelet/container:go_default_library", "//pkg/kubelet/util/format:go_default_library", + "//pkg/scheduler/framework:go_default_library", "//pkg/scheduler/framework/plugins/nodename:go_default_library", "//pkg/scheduler/framework/plugins/nodeports:go_default_library", - "//pkg/scheduler/framework/v1alpha1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/pkg/kubelet/lifecycle/predicate.go b/pkg/kubelet/lifecycle/predicate.go index 5991ea77303c3..e0d3715713c05 100644 --- a/pkg/kubelet/lifecycle/predicate.go +++ b/pkg/kubelet/lifecycle/predicate.go @@ -23,12 +23,12 @@ import ( "k8s.io/klog/v2" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" "k8s.io/kubernetes/pkg/kubelet/util/format" + schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" pluginhelper "k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodename" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1" ) type getNodeAnyWayFuncType func() (*v1.Node, error) diff --git a/pkg/kubelet/lifecycle/predicate_test.go b/pkg/kubelet/lifecycle/predicate_test.go index f7006beba66ae..41dd60a702d1d 100644 --- a/pkg/kubelet/lifecycle/predicate_test.go +++ b/pkg/kubelet/lifecycle/predicate_test.go @@ -24,9 +24,9 @@ import ( "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" + schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodename" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1" ) var ( diff --git a/pkg/scheduler/framework/BUILD b/pkg/scheduler/framework/BUILD index 04c8912d0a09c..af8bc8b75a519 100644 --- a/pkg/scheduler/framework/BUILD +++ b/pkg/scheduler/framework/BUILD @@ -45,7 +45,6 @@ filegroup( "//pkg/scheduler/framework/fake:all-srcs", "//pkg/scheduler/framework/plugins:all-srcs", "//pkg/scheduler/framework/runtime:all-srcs", - "//pkg/scheduler/framework/v1alpha1:all-srcs", ], tags = ["automanaged"], visibility = ["//visibility:public"], diff --git a/pkg/scheduler/framework/v1alpha1/BUILD b/pkg/scheduler/framework/v1alpha1/BUILD deleted file mode 100644 index 8d7e91a2b172f..0000000000000 --- a/pkg/scheduler/framework/v1alpha1/BUILD +++ /dev/null @@ -1,26 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["types.go"], - importpath = "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1", - visibility = ["//visibility:public"], - deps = [ - "//pkg/scheduler/framework:go_default_library", - "//staging/src/k8s.io/api/core/v1:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], - visibility = ["//visibility:public"], -) diff --git a/pkg/scheduler/framework/v1alpha1/types.go b/pkg/scheduler/framework/v1alpha1/types.go deleted file mode 100644 index 51ba87ec378fe..0000000000000 --- a/pkg/scheduler/framework/v1alpha1/types.go +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "k8s.io/api/core/v1" - "k8s.io/kubernetes/pkg/scheduler/framework" -) - -// NodeInfo is node level aggregated information. -type NodeInfo = framework.NodeInfo - -// NewNodeInfo returns a ready to use empty NodeInfo object. -// If any pods are given in arguments, their information will be aggregated in -// the returned object. -func NewNodeInfo(pods ...*v1.Pod) *NodeInfo { - return framework.NewNodeInfo(pods...) -} - -// NewPodInfo return a new PodInfo -func NewPodInfo(pod *v1.Pod) *PodInfo { - return framework.NewPodInfo(pod) -} - -// Resource is a collection of compute resource. -type Resource = framework.Resource - -// QueuedPodInfo is a Pod wrapper with additional information related to -// the pod's status in the scheduling queue, such as the timestamp when -// it's added to the queue. -type QueuedPodInfo = framework.QueuedPodInfo - -// PodInfo is a wrapper to a Pod with additional pre-computed information to -// accelerate processing. This information is typically immutable (e.g., pre-processed -// inter-pod affinity selectors). -type PodInfo = framework.PodInfo - -// AffinityTerm is a processed version of v1.PodAffinityTerm. -type AffinityTerm = framework.AffinityTerm - -// WeightedAffinityTerm is a "processed" representation of v1.WeightedAffinityTerm. -type WeightedAffinityTerm = framework.WeightedAffinityTerm - -// ImageStateSummary provides summarized information about the state of an image. -type ImageStateSummary = framework.ImageStateSummary - -// TransientSchedulerInfo is a transient structure which is destructed at the end of each scheduling cycle. -// It consists of items that are valid for a scheduling cycle and is used for message passing across predicates and -// priorities. Some examples which could be used as fields are number of volumes being used on node, current utilization -// on node etc. -// IMPORTANT NOTE: Make sure that each field in this structure is documented along with usage. Expand this structure -// only when absolutely needed as this data structure will be created and destroyed during every scheduling cycle. -type TransientSchedulerInfo = framework.TransientSchedulerInfo - -// HostPortInfo stores mapping from ip to a set of ProtocolPort -type HostPortInfo = framework.HostPortInfo - -// ProtocolPort represents a protocol port pair, e.g. tcp:80. -type ProtocolPort = framework.ProtocolPort - -// NewResource creates a Resource from ResourceList -func NewResource(rl v1.ResourceList) *Resource { - return framework.NewResource(rl) -} diff --git a/test/e2e/framework/.import-restrictions b/test/e2e/framework/.import-restrictions index 641487a44fcd5..a8f4848e4285c 100644 --- a/test/e2e/framework/.import-restrictions +++ b/test/e2e/framework/.import-restrictions @@ -188,7 +188,6 @@ rules: - k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodename - k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports - k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources - - k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1 - k8s.io/kubernetes/pkg/scheduler/framework/runtime - k8s.io/kubernetes/pkg/scheduler/internal/parallelize - k8s.io/kubernetes/pkg/scheduler/listers