[kube-proxy]enhance kubeproxy init flag

This commit is contained in:
stewart-yu
2017-12-28 09:25:26 +08:00
parent 5d144152e4
commit 25e110dffc
3 changed files with 42 additions and 52 deletions

View File

@@ -17,14 +17,11 @@ limitations under the License.
package main
import (
goflag "flag"
"fmt"
"math/rand"
"os"
"time"
"github.com/spf13/pflag"
utilflag "k8s.io/apiserver/pkg/util/flag"
"k8s.io/apiserver/pkg/util/logs"
"k8s.io/kubernetes/cmd/kube-proxy/app"
@@ -37,12 +34,7 @@ func main() {
command := app.NewProxyCommand()
// TODO: once we switch everything over to Cobra commands, we can go back to calling
// utilflag.InitFlags() (by removing its pflag.Parse() call). For now, we have to set the
// normalize func and add the go flag set by hand.
pflag.CommandLine.SetNormalizeFunc(utilflag.WordSepNormalizeFunc)
pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)
// utilflag.InitFlags()
utilflag.InitFlags()
logs.InitLogs()
defer logs.FlushLogs()