Split controller manager options from init

Make defaults and flags clearly distinct from initialization code.
This commit is contained in:
Clayton Coleman
2015-12-24 18:59:05 -05:00
parent ab6edd8170
commit 2326e2bae3
7 changed files with 214 additions and 177 deletions

View File

@@ -19,19 +19,20 @@ limitations under the License.
package main
import (
controllermgr "k8s.io/kubernetes/cmd/kube-controller-manager/app"
"k8s.io/kubernetes/cmd/kube-controller-manager/app"
"k8s.io/kubernetes/cmd/kube-controller-manager/app/options"
)
// NewKubeControllerManager creates a new hyperkube Server object that includes the
// description and flags.
func NewKubeControllerManager() *Server {
s := controllermgr.NewCMServer()
s := options.NewCMServer()
hks := Server{
SimpleUsage: "controller-manager",
Long: "A server that runs a set of active components. This includes replication controllers, service endpoints and nodes.",
Run: func(_ *Server, args []string) error {
return s.Run(args)
return app.Run(s)
},
}
s.AddFlags(hks.Flags())