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

@@ -138,7 +138,7 @@ func getFlagInt(cmd *cobra.Command, flag string) int {
return v
}
func getKubeClient(cmd *cobra.Command) *client.Client {
func getKubeConfig(cmd *cobra.Command) *client.Config {
config := &client.Config{}
var host string
@@ -183,6 +183,12 @@ func getKubeClient(cmd *cobra.Command) *client.Client {
// The API version (e.g. v1beta1), not the binary version.
config.Version = getFlagString(cmd, "api-version")
return config
}
func getKubeClient(cmd *cobra.Command) *client.Client {
config := getKubeConfig(cmd)
// The binary version.
matchVersion := getFlagBool(cmd, "match-server-version")