Refactor KubeProxy to allow mocking of all moving parts.

This commit is contained in:
gmarek
2015-09-21 12:05:22 +02:00
parent 45a8b5f98a
commit 1c25c2cd99
4 changed files with 173 additions and 99 deletions

View File

@@ -35,8 +35,8 @@ func init() {
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
s := app.NewProxyServer()
s.AddFlags(pflag.CommandLine)
config := app.NewProxyConfig()
config.AddFlags(pflag.CommandLine)
util.InitFlags()
util.InitLogs()
@@ -44,7 +44,13 @@ func main() {
verflag.PrintAndExitIfRequested()
if err := s.Run(pflag.CommandLine.Args()); err != nil {
s, err := app.NewProxyServerDefault(config)
if err != nil {
fmt.Fprintf(os.Stderr, "%v\n", err)
os.Exit(1)
}
if err = s.Run(pflag.CommandLine.Args()); err != nil {
fmt.Fprintf(os.Stderr, "%v\n", err)
os.Exit(1)
}