move pkg/controllermanager to cmd/kube-controller-manager/app

This commit is contained in:
Tim Hockin 2015-02-07 20:07:00 -08:00
parent cb09571768
commit 0b17c0f225
5 changed files with 44 additions and 24 deletions

View File

@ -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())

View File

@ -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
}

View File

@ -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")

View File

@ -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.

View File

@ -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()