diff --git a/cmd/hyperkube/hyperkube.go b/cmd/hyperkube/hyperkube.go index 56e3916ac68..36a6fc0879d 100644 --- a/cmd/hyperkube/hyperkube.go +++ b/cmd/hyperkube/hyperkube.go @@ -21,7 +21,6 @@ package main import ( "os" - "github.com/GoogleCloudPlatform/kubernetes/pkg/controllermanager" "github.com/GoogleCloudPlatform/kubernetes/pkg/hyperkube" sched "github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/scheduler/server" ) @@ -33,7 +32,7 @@ func main() { } hk.AddServer(NewKubeAPIServer()) - hk.AddServer(controllermanager.NewHyperkubeServer()) + hk.AddServer(NewKubeControllerManager()) hk.AddServer(sched.NewHyperkubeServer()) hk.AddServer(NewKubelet()) hk.AddServer(NewKubeProxy()) diff --git a/cmd/hyperkube/kube-controller-manager.go b/cmd/hyperkube/kube-controller-manager.go new file mode 100644 index 00000000000..c59928687e9 --- /dev/null +++ b/cmd/hyperkube/kube-controller-manager.go @@ -0,0 +1,38 @@ +/* +Copyright 2015 Google Inc. All rights reserved. + +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 main + +import ( + controllermgr "github.com/GoogleCloudPlatform/kubernetes/cmd/kube-controller-manager/app" + "github.com/GoogleCloudPlatform/kubernetes/pkg/hyperkube" +) + +// NewKubeControllerManager creates a new hyperkube Server object that includes the +// description and flags. +func NewKubeControllerManager() *hyperkube.Server { + s := controllermgr.NewCMServer() + + hks := hyperkube.Server{ + SimpleUsage: "controller-manager", + Long: "A server that runs a set of active components. This includes replication controllers, service endpoints and nodes.", + Run: func(_ *hyperkube.Server, args []string) error { + return s.Run(args) + }, + } + s.AddFlags(hks.Flags()) + return &hks +} diff --git a/pkg/controllermanager/controllermanager.go b/cmd/kube-controller-manager/app/controllermanager.go similarity index 91% rename from pkg/controllermanager/controllermanager.go rename to cmd/kube-controller-manager/app/controllermanager.go index cc1246e5d95..c9e54ccc5fb 100644 --- a/pkg/controllermanager/controllermanager.go +++ b/cmd/kube-controller-manager/app/controllermanager.go @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package controllermanager implements a server that runs a set of active +// Package app implements a server that runs a set of active // components. This includes replication controllers, service endpoints and // nodes. -package controllermanager +package app import ( "net" @@ -32,7 +32,6 @@ import ( nodeControllerPkg "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/controller" replicationControllerPkg "github.com/GoogleCloudPlatform/kubernetes/pkg/controller" _ "github.com/GoogleCloudPlatform/kubernetes/pkg/healthz" - "github.com/GoogleCloudPlatform/kubernetes/pkg/hyperkube" "github.com/GoogleCloudPlatform/kubernetes/pkg/master/ports" "github.com/GoogleCloudPlatform/kubernetes/pkg/resourcequota" "github.com/GoogleCloudPlatform/kubernetes/pkg/service" @@ -84,22 +83,6 @@ func NewCMServer() *CMServer { return &s } -// NewHyperkubeServer creates a new hyperkube Server object that includes the -// description and flags. -func NewHyperkubeServer() *hyperkube.Server { - s := NewCMServer() - - hks := hyperkube.Server{ - SimpleUsage: "controller-manager", - Long: "A server that runs a set of active components. This includes replication controllers, service endpoints and nodes.", - Run: func(_ *hyperkube.Server, args []string) error { - return s.Run(args) - }, - } - s.AddFlags(hks.Flags()) - return &hks -} - // AddFlags adds flags for a specific CMServer to the specified FlagSet func (s *CMServer) AddFlags(fs *pflag.FlagSet) { fs.IntVar(&s.Port, "port", s.Port, "The port that the controller-manager's http service runs on") diff --git a/pkg/controllermanager/plugins.go b/cmd/kube-controller-manager/app/plugins.go similarity index 97% rename from pkg/controllermanager/plugins.go rename to cmd/kube-controller-manager/app/plugins.go index 391b74c7509..13d311bf365 100644 --- a/pkg/controllermanager/plugins.go +++ b/cmd/kube-controller-manager/app/plugins.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package controllermanager +package app import ( // This file exists to force the desired plugin implementations to be linked. diff --git a/cmd/kube-controller-manager/controller-manager.go b/cmd/kube-controller-manager/controller-manager.go index 007f89c8fd1..d4603ad3360 100644 --- a/cmd/kube-controller-manager/controller-manager.go +++ b/cmd/kube-controller-manager/controller-manager.go @@ -25,7 +25,7 @@ import ( "os" "runtime" - "github.com/GoogleCloudPlatform/kubernetes/pkg/controllermanager" + "github.com/GoogleCloudPlatform/kubernetes/cmd/kube-controller-manager/app" "github.com/GoogleCloudPlatform/kubernetes/pkg/util" "github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag" @@ -34,7 +34,7 @@ import ( func main() { runtime.GOMAXPROCS(runtime.NumCPU()) - s := controllermanager.NewCMServer() + s := app.NewCMServer() s.AddFlags(pflag.CommandLine) util.InitFlags()