add goflag to parse glog flags
This commit is contained in:
parent
d316c013fa
commit
5483d5ef1f
7
main.go
7
main.go
|
|
@ -126,13 +126,10 @@ type options struct {
|
|||
}
|
||||
|
||||
func main() {
|
||||
// configure glog
|
||||
flag.CommandLine.Parse([]string{})
|
||||
flag.Lookup("logtostderr").Value.Set("true")
|
||||
|
||||
options := &options{collectors: make(collectorSet)}
|
||||
flags := pflag.NewFlagSet("", pflag.ExitOnError)
|
||||
|
||||
// add glog flags
|
||||
flags.AddGoFlagSet(flag.CommandLine)
|
||||
flags.BoolVar(&options.inCluster, "in-cluster", true, `If true, use the built in kubernetes cluster for creating the client`)
|
||||
flags.StringVar(&options.apiserver, "apiserver", "", `The URL of the apiserver to use as a master`)
|
||||
flags.StringVar(&options.kubeconfig, "kubeconfig", "", "Absolute path to the kubeconfig file")
|
||||
|
|
|
|||
Loading…
Reference in New Issue