Split proxy and scheduler arguments

Keep options and flags distinct from initialization
This commit is contained in:
Clayton Coleman
2015-12-24 19:27:57 -05:00
parent b1e4831265
commit 715b77cbcd
11 changed files with 215 additions and 146 deletions

View File

@@ -19,13 +19,14 @@ limitations under the License.
package main
import (
kubeproxy "k8s.io/kubernetes/cmd/kube-proxy/app"
"k8s.io/kubernetes/cmd/kube-proxy/app"
"k8s.io/kubernetes/cmd/kube-proxy/app/options"
)
// NewKubeProxy creates a new hyperkube Server object that includes the
// description and flags.
func NewKubeProxy() *Server {
config := kubeproxy.NewProxyConfig()
config := options.NewProxyConfig()
hks := Server{
SimpleUsage: "proxy",
@@ -37,13 +38,13 @@ func NewKubeProxy() *Server {
config.AddFlags(hks.Flags())
hks.Run = func(_ *Server, args []string) error {
s, err := kubeproxy.NewProxyServerDefault(config)
hks.Run = func(_ *Server, _ []string) error {
s, err := app.NewProxyServerDefault(config)
if err != nil {
return err
}
return s.Run(args)
return s.Run()
}
return &hks