Skip to content

Commit

Permalink
move pkg/controller/route to k8s.io/cloud-provider/controllers/route …
Browse files Browse the repository at this point in the history
…for easier external consumption

Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
  • Loading branch information
andrewsykim committed Jun 8, 2020
1 parent d06cd7e commit 99d9dda
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 49 deletions.
2 changes: 1 addition & 1 deletion cmd/cloud-controller-manager/app/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ go_library(
"//cmd/cloud-controller-manager/app/options:go_default_library",
"//cmd/controller-manager/app:go_default_library",
"//pkg/controller/cloud:go_default_library",
"//pkg/controller/route:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library",
Expand All @@ -23,6 +22,7 @@ go_library(
"//staging/src/k8s.io/client-go/tools/leaderelection:go_default_library",
"//staging/src/k8s.io/client-go/tools/leaderelection/resourcelock:go_default_library",
"//staging/src/k8s.io/cloud-provider:go_default_library",
"//staging/src/k8s.io/cloud-provider/controllers/route:go_default_library",
"//staging/src/k8s.io/cloud-provider/controllers/service:go_default_library",
"//staging/src/k8s.io/component-base/cli/flag:go_default_library",
"//staging/src/k8s.io/component-base/cli/globalflag:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion cmd/cloud-controller-manager/app/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import (
"strings"

cloudprovider "k8s.io/cloud-provider"
routecontroller "k8s.io/cloud-provider/controllers/route"
servicecontroller "k8s.io/cloud-provider/controllers/service"
"k8s.io/klog/v2"
cloudcontrollerconfig "k8s.io/kubernetes/cmd/cloud-controller-manager/app/config"
cloudcontrollers "k8s.io/kubernetes/pkg/controller/cloud"
routecontroller "k8s.io/kubernetes/pkg/controller/route"
netutils "k8s.io/utils/net"

utilfeature "k8s.io/apiserver/pkg/util/feature"
Expand Down
2 changes: 1 addition & 1 deletion cmd/kube-controller-manager/app/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ go_library(
"//pkg/controller/replicaset:go_default_library",
"//pkg/controller/replication:go_default_library",
"//pkg/controller/resourcequota:go_default_library",
"//pkg/controller/route:go_default_library",
"//pkg/controller/serviceaccount:go_default_library",
"//pkg/controller/statefulset:go_default_library",
"//pkg/controller/ttl:go_default_library",
Expand Down Expand Up @@ -136,6 +135,7 @@ go_library(
"//staging/src/k8s.io/client-go/util/flowcontrol:go_default_library",
"//staging/src/k8s.io/client-go/util/keyutil:go_default_library",
"//staging/src/k8s.io/cloud-provider:go_default_library",
"//staging/src/k8s.io/cloud-provider/controllers/route:go_default_library",
"//staging/src/k8s.io/cloud-provider/controllers/service:go_default_library",
"//staging/src/k8s.io/component-base/cli/flag:go_default_library",
"//staging/src/k8s.io/component-base/cli/globalflag:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion cmd/kube-controller-manager/app/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
clientset "k8s.io/client-go/kubernetes"
"k8s.io/client-go/metadata"
restclient "k8s.io/client-go/rest"
routecontroller "k8s.io/cloud-provider/controllers/route"
servicecontroller "k8s.io/cloud-provider/controllers/service"
"k8s.io/component-base/metrics/prometheus/ratelimiter"
csitrans "k8s.io/csi-translation-lib"
Expand All @@ -53,7 +54,6 @@ import (
"k8s.io/kubernetes/pkg/controller/podgc"
replicationcontroller "k8s.io/kubernetes/pkg/controller/replication"
resourcequotacontroller "k8s.io/kubernetes/pkg/controller/resourcequota"
routecontroller "k8s.io/kubernetes/pkg/controller/route"
serviceaccountcontroller "k8s.io/kubernetes/pkg/controller/serviceaccount"
ttlcontroller "k8s.io/kubernetes/pkg/controller/ttl"
"k8s.io/kubernetes/pkg/controller/ttlafterfinished"
Expand Down
2 changes: 1 addition & 1 deletion hack/.golint_failures
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ pkg/controller/replication
pkg/controller/replication/config/v1alpha1
pkg/controller/resourcequota
pkg/controller/resourcequota/config/v1alpha1
pkg/controller/route
pkg/controller/service/config/v1alpha1
pkg/controller/serviceaccount/config/v1alpha1
pkg/controller/statefulset
Expand Down Expand Up @@ -424,6 +423,7 @@ staging/src/k8s.io/client-go/util/retry
staging/src/k8s.io/client-go/util/testing
staging/src/k8s.io/client-go/util/workqueue
staging/src/k8s.io/cloud-provider
staging/src/k8s.io/cloud-provider/controllers/route
staging/src/k8s.io/code-generator/cmd/client-gen/args
staging/src/k8s.io/code-generator/cmd/client-gen/generators/fake
staging/src/k8s.io/code-generator/cmd/client-gen/generators/scheme
Expand Down
79 changes: 37 additions & 42 deletions pkg/controller/BUILD
Original file line number Diff line number Diff line change
@@ -1,44 +1,4 @@
package(default_visibility = ["//visibility:public"])

load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
"go_test",
)

go_test(
name = "go_default_test",
srcs = [
"controller_ref_manager_test.go",
"controller_utils_test.go",
],
embed = [":go_default_library"],
deps = [
"//pkg/apis/core/install:go_default_library",
"//pkg/controller/testutil:go_default_library",
"//pkg/securitycontext:go_default_library",
"//staging/src/k8s.io/api/apps/v1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/clock:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/fake:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/scheme:go_default_library",
"//staging/src/k8s.io/client-go/rest:go_default_library",
"//staging/src/k8s.io/client-go/tools/cache:go_default_library",
"//staging/src/k8s.io/client-go/tools/record:go_default_library",
"//staging/src/k8s.io/client-go/util/testing:go_default_library",
"//vendor/github.com/stretchr/testify/assert:go_default_library",
],
)
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
Expand All @@ -52,6 +12,7 @@ go_library(
"lookup_cache.go",
],
importpath = "k8s.io/kubernetes/pkg/controller",
visibility = ["//visibility:public"],
deps = [
"//pkg/api/legacyscheme:go_default_library",
"//pkg/api/v1/pod:go_default_library",
Expand Down Expand Up @@ -99,6 +60,40 @@ go_library(
],
)

go_test(
name = "go_default_test",
srcs = [
"controller_ref_manager_test.go",
"controller_utils_test.go",
],
embed = [":go_default_library"],
deps = [
"//pkg/apis/core/install:go_default_library",
"//pkg/controller/testutil:go_default_library",
"//pkg/securitycontext:go_default_library",
"//staging/src/k8s.io/api/apps/v1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/clock:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/fake:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/scheme:go_default_library",
"//staging/src/k8s.io/client-go/rest:go_default_library",
"//staging/src/k8s.io/client-go/tools/cache:go_default_library",
"//staging/src/k8s.io/client-go/tools/record:go_default_library",
"//staging/src/k8s.io/client-go/util/testing:go_default_library",
"//vendor/github.com/stretchr/testify/assert:go_default_library",
],
)

filegroup(
name = "package-srcs",
srcs = glob(["**"]),
Expand Down Expand Up @@ -132,7 +127,6 @@ filegroup(
"//pkg/controller/replicaset:all-srcs",
"//pkg/controller/replication:all-srcs",
"//pkg/controller/resourcequota:all-srcs",
"//pkg/controller/route:all-srcs",
"//pkg/controller/service/config:all-srcs",
"//pkg/controller/serviceaccount:all-srcs",
"//pkg/controller/statefulset:all-srcs",
Expand All @@ -151,4 +145,5 @@ filegroup(
"//pkg/controller/volume/scheduling:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
1 change: 1 addition & 0 deletions staging/src/k8s.io/cloud-provider/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ filegroup(
srcs = [
":package-srcs",
"//staging/src/k8s.io/cloud-provider/api:all-srcs",
"//staging/src/k8s.io/cloud-provider/controllers/route:all-srcs",
"//staging/src/k8s.io/cloud-provider/controllers/service:all-srcs",
"//staging/src/k8s.io/cloud-provider/fake:all-srcs",
"//staging/src/k8s.io/cloud-provider/node:all-srcs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ go_library(
"doc.go",
"route_controller.go",
],
importpath = "k8s.io/kubernetes/pkg/controller/route",
importmap = "k8s.io/kubernetes/vendor/k8s.io/cloud-provider/controllers/route",
importpath = "k8s.io/cloud-provider/controllers/route",
visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/api/core/v1:go_default_library",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ limitations under the License.

// Package route contains code for syncing cloud routing rules with
// the list of registered nodes.
package route // import "k8s.io/kubernetes/pkg/controller/route"
package route // import "k8s.io/cloud-provider/controllers/route"
File renamed without changes.

0 comments on commit 99d9dda

Please sign in to comment.