flags.StringVarP(&builder.apiserver,FlagApiServer,"s",builder.apiserver,"The address of the Kubernetes API server")
flags.BoolVar(&builder.matchApiVersion,FlagMatchApiVersion,false,"Require server version to match client version")
flags.StringVar(&builder.apiVersion,FlagApiVersion,latest.Version,"The API version to use when talking to the server")
flags.StringVarP(&builder.authPath,FlagAuthPath,"a",os.Getenv("HOME")+"/.kubernetes_auth","Path to the auth info file. If missing, prompt the user. Only used if using https.")
flags.Var(&builder.cmdAuthInfo.Insecure,FlagInsecure,"If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.")
flags.Var(&builder.cmdAuthInfo.CertFile,FlagCertFile,"Path to a client key file for TLS.")
flags.Var(&builder.cmdAuthInfo.KeyFile,FlagKeyFile,"Path to a client key file for TLS.")
flags.Var(&builder.cmdAuthInfo.CAFile,FlagCAFile,"Path to a cert. file for the certificate authority.")
flags.Var(&builder.cmdAuthInfo.BearerToken,FlagBearerToken,"Bearer token for authentication to the API server.")
returnnil,fmt.Errorf("no description has been implemented for %q",mapping.Kind)
returnnil,fmt.Errorf("no description has been implemented for %q",mapping.Kind)
}
}
...
@@ -73,23 +80,17 @@ Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`,
...
@@ -73,23 +80,17 @@ Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`,
Run:runHelp,
Run:runHelp,
}
}
f.ClientBuilder.BindFlags(cmds.PersistentFlags())
// Globally persistent flags across all subcommands.
// Globally persistent flags across all subcommands.
// TODO Change flag names to consts to allow safer lookup from subcommands.
// TODO Change flag names to consts to allow safer lookup from subcommands.
// TODO Add a verbose flag that turns on glog logging. Probably need a way
// TODO Add a verbose flag that turns on glog logging. Probably need a way
// to do that automatically for every subcommand.
// to do that automatically for every subcommand.
cmds.PersistentFlags().StringP("server","s","","Kubernetes apiserver to connect to")
cmds.PersistentFlags().StringP("auth-path","a",os.Getenv("HOME")+"/.kubernetes_auth","Path to the auth info file. If missing, prompt the user. Only used if using https.")
cmds.PersistentFlags().Bool("match-server-version",false,"Require server version to match client version")
cmds.PersistentFlags().String("api-version",latest.Version,"The version of the API to use against the server")
cmds.PersistentFlags().String("certificate-authority","","Path to a certificate file for the certificate authority")
cmds.PersistentFlags().String("client-certificate","","Path to a client certificate for TLS.")
cmds.PersistentFlags().String("client-key","","Path to a client key file for TLS.")
cmds.PersistentFlags().Bool("insecure-skip-tls-verify",false,"If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.")
cmds.PersistentFlags().String("ns-path",os.Getenv("HOME")+"/.kubernetes_ns","Path to the namespace info file that holds the namespace context to use for CLI requests.")
cmds.PersistentFlags().String("ns-path",os.Getenv("HOME")+"/.kubernetes_ns","Path to the namespace info file that holds the namespace context to use for CLI requests.")
cmds.PersistentFlags().StringP("namespace","n","","If present, the namespace scope for this CLI request.")
cmds.PersistentFlags().StringP("namespace","n","","If present, the namespace scope for this CLI request.")
cmds.AddCommand(NewCmdVersion(out))
cmds.AddCommand(f.NewCmdVersion(out))
cmds.AddCommand(NewCmdProxy(out))
cmds.AddCommand(f.NewCmdProxy(out))
cmds.AddCommand(f.NewCmdGet(out))
cmds.AddCommand(f.NewCmdGet(out))
cmds.AddCommand(f.NewCmdDescribe(out))
cmds.AddCommand(f.NewCmdDescribe(out))
...
@@ -99,7 +100,7 @@ Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`,
...
@@ -99,7 +100,7 @@ Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`,