add utility for binding flags and building api server clients
This commit is contained in:
@@ -24,7 +24,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func NewCmdProxy(out io.Writer) *cobra.Command {
|
||||
func (f *Factory) NewCmdProxy(out io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "proxy",
|
||||
Short: "Run a proxy to the Kubernetes API server",
|
||||
@@ -32,7 +32,11 @@ func NewCmdProxy(out io.Writer) *cobra.Command {
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
port := GetFlagInt(cmd, "port")
|
||||
glog.Infof("Starting to serve on localhost:%d", port)
|
||||
server, err := kubectl.NewProxyServer(GetFlagString(cmd, "www"), GetKubeConfig(cmd), port)
|
||||
|
||||
clientConfig, err := f.ClientBuilder.Config()
|
||||
checkErr(err)
|
||||
|
||||
server, err := kubectl.NewProxyServer(GetFlagString(cmd, "www"), clientConfig, port)
|
||||
checkErr(err)
|
||||
glog.Fatal(server.Serve())
|
||||
},
|
||||
|
Reference in New Issue
Block a user