Skip to content

Commit ce78535

Browse files
spring-youngYuyao
authored andcommitted
refactor: delete unused comment
1 parent af11193 commit ce78535

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

pkg/proxy/apiserver/handler.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ import (
5151
var (
5252
upgradeSubresources = sets.NewString("exec", "attach")
5353
enableIpTable = os.Getenv(constants.EnvIPTable) == "true"
54-
enableWebhookProxy = os.Getenv(constants.EnvEnableWebHookProxy) == "true"
5554

5655
disableCircuitBreaker = os.Getenv(constants.EnvDisableCircuitBreaker) == "true"
5756
disableFaultInjection = os.Getenv(constants.EnvDisableCircuitBreaker) == "true"
@@ -141,15 +140,9 @@ type handler struct {
141140
electionHandler leaderelection.Handler
142141
}
143142

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-
148143
func (h *handler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
149144
startTime := time.Now()
150145
requestInfo, ok := apirequest.RequestInfoFrom(r.Context())
151-
// klog.Infof("handle http req %s", r.URL.String())
152-
// klog.Infof(getReqInfoStr(requestInfo))
153146
if !ok {
154147
klog.Errorf("%s %s %s, no request info in context", r.Method, r.Header.Get("Content-Type"), r.URL)
155148
http.Error(rw, "no request info in context", http.StatusBadRequest)
@@ -216,7 +209,6 @@ func (h *handler) getURL(r *http.Request) *url.URL {
216209
u, _ := url.Parse(fmt.Sprintf("https://%s", r.Host))
217210
if !enableIpTable {
218211
u, _ = url.Parse(fmt.Sprintf(h.cfg.Host))
219-
// klog.Infof("disable IPTABLE, proxy apiServer with real host %s", u.String())
220212
r.Host = ""
221213
}
222214
return u

0 commit comments

Comments
 (0)