mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Update the proxy server.
This commit is contained in:
parent
1ddc012b17
commit
14838df51e
@ -130,6 +130,12 @@ func main() {
|
|||||||
}
|
}
|
||||||
method := flag.Arg(0)
|
method := flag.Arg(0)
|
||||||
|
|
||||||
|
if len(flag.Args()) < 1 {
|
||||||
|
usage()
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
method := flag.Arg(0)
|
||||||
|
|
||||||
matchFound := executeAPIRequest(method, auth) || executeControllerRequest(method, auth)
|
matchFound := executeAPIRequest(method, auth) || executeControllerRequest(method, auth)
|
||||||
if matchFound == false {
|
if matchFound == false {
|
||||||
glog.Fatalf("Unknown command %s", method)
|
glog.Fatalf("Unknown command %s", method)
|
||||||
|
@ -234,3 +234,4 @@ func (r Result) Into(obj interface{}) error {
|
|||||||
func (r Result) Error() error {
|
func (r Result) Error() error {
|
||||||
return r.err
|
return r.err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,5 +71,7 @@ func (s *ProxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
s.doError(w, err)
|
s.doError(w, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
|
w.Header().Add("Content-type", "application/json")
|
||||||
w.Write(data)
|
w.Write(data)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user