Split proxy and scheduler arguments
Keep options and flags distinct from initialization
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user