diff --git a/cmd/kubecfg/kubecfg.go b/cmd/kubecfg/kubecfg.go index 2358c95bbd5..4ebd4963fa8 100644 --- a/cmd/kubecfg/kubecfg.go +++ b/cmd/kubecfg/kubecfg.go @@ -130,6 +130,12 @@ func main() { } method := flag.Arg(0) + if len(flag.Args()) < 1 { + usage() + os.Exit(1) + } + method := flag.Arg(0) + matchFound := executeAPIRequest(method, auth) || executeControllerRequest(method, auth) if matchFound == false { glog.Fatalf("Unknown command %s", method) diff --git a/pkg/client/request.go b/pkg/client/request.go index ea643421433..e167d88cf48 100644 --- a/pkg/client/request.go +++ b/pkg/client/request.go @@ -234,3 +234,4 @@ func (r Result) Into(obj interface{}) error { func (r Result) Error() error { return r.err } + diff --git a/pkg/kubecfg/proxy_server.go b/pkg/kubecfg/proxy_server.go index 37ee056552f..94ead4c8de5 100644 --- a/pkg/kubecfg/proxy_server.go +++ b/pkg/kubecfg/proxy_server.go @@ -71,5 +71,7 @@ func (s *ProxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { s.doError(w, err) return } + w.WriteHeader(http.StatusOK) + w.Header().Add("Content-type", "application/json") w.Write(data) }