@@ -51,7 +51,6 @@ import (
51
51
var (
52
52
upgradeSubresources = sets .NewString ("exec" , "attach" )
53
53
enableIpTable = os .Getenv (constants .EnvIPTable ) == "true"
54
- enableWebhookProxy = os .Getenv (constants .EnvEnableWebHookProxy ) == "true"
55
54
56
55
disableCircuitBreaker = os .Getenv (constants .EnvDisableCircuitBreaker ) == "true"
57
56
disableFaultInjection = os .Getenv (constants .EnvDisableCircuitBreaker ) == "true"
@@ -141,15 +140,9 @@ type handler struct {
141
140
electionHandler leaderelection.Handler
142
141
}
143
142
144
- func getReqInfoStr (r * apirequest.RequestInfo ) string {
145
- return fmt .Sprintf ("RequestInfo: { Path: %s, APIGroup: %s, Resource: %s, Subresource: %s, Verb: %s, Namespace: %s, Name: %s, APIVersion: %s }" , r .Path , r .APIGroup , r .Resource , r .Subresource , r .Verb , r .Namespace , r .Name , r .APIVersion )
146
- }
147
-
148
143
func (h * handler ) ServeHTTP (rw http.ResponseWriter , r * http.Request ) {
149
144
startTime := time .Now ()
150
145
requestInfo , ok := apirequest .RequestInfoFrom (r .Context ())
151
- // klog.Infof("handle http req %s", r.URL.String())
152
- // klog.Infof(getReqInfoStr(requestInfo))
153
146
if ! ok {
154
147
klog .Errorf ("%s %s %s, no request info in context" , r .Method , r .Header .Get ("Content-Type" ), r .URL )
155
148
http .Error (rw , "no request info in context" , http .StatusBadRequest )
@@ -216,7 +209,6 @@ func (h *handler) getURL(r *http.Request) *url.URL {
216
209
u , _ := url .Parse (fmt .Sprintf ("https://%s" , r .Host ))
217
210
if ! enableIpTable {
218
211
u , _ = url .Parse (fmt .Sprintf (h .cfg .Host ))
219
- // klog.Infof("disable IPTABLE, proxy apiServer with real host %s", u.String())
220
212
r .Host = ""
221
213
}
222
214
return u
0 commit comments