Replace custom proxy with httputil.ReverseProxy for kubecfg/kubectl.

Fixes #1149 - kubecfg proxy "411 Length Required" error on POST/PUT.
This commit is contained in:
alex
2014-10-21 18:52:18 +01:00
parent d5377e4a39
commit fb2b15a797
8 changed files with 254 additions and 128 deletions

View File

@@ -32,7 +32,8 @@ 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 := kubectl.NewProxyServer(getFlagString(cmd, "www"), getKubeClient(cmd), port)
server, err := kubectl.NewProxyServer(getFlagString(cmd, "www"), getKubeConfig(cmd), port)
checkErr(err)
glog.Fatal(server.Serve())
},
}