Skip to content

Commit

Permalink
refactor: delete unused comment
Browse files Browse the repository at this point in the history
  • Loading branch information
spring-young authored and Yuyao committed Jan 16, 2024
1 parent af11193 commit ce78535
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions pkg/proxy/apiserver/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import (
var (
upgradeSubresources = sets.NewString("exec", "attach")
enableIpTable = os.Getenv(constants.EnvIPTable) == "true"
enableWebhookProxy = os.Getenv(constants.EnvEnableWebHookProxy) == "true"

disableCircuitBreaker = os.Getenv(constants.EnvDisableCircuitBreaker) == "true"
disableFaultInjection = os.Getenv(constants.EnvDisableCircuitBreaker) == "true"
Expand Down Expand Up @@ -141,15 +140,9 @@ type handler struct {
electionHandler leaderelection.Handler
}

func getReqInfoStr(r *apirequest.RequestInfo) string {
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)
}

func (h *handler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
startTime := time.Now()
requestInfo, ok := apirequest.RequestInfoFrom(r.Context())
// klog.Infof("handle http req %s", r.URL.String())
// klog.Infof(getReqInfoStr(requestInfo))
if !ok {
klog.Errorf("%s %s %s, no request info in context", r.Method, r.Header.Get("Content-Type"), r.URL)
http.Error(rw, "no request info in context", http.StatusBadRequest)
Expand Down Expand Up @@ -216,7 +209,6 @@ func (h *handler) getURL(r *http.Request) *url.URL {
u, _ := url.Parse(fmt.Sprintf("https://%s", r.Host))
if !enableIpTable {
u, _ = url.Parse(fmt.Sprintf(h.cfg.Host))
// klog.Infof("disable IPTABLE, proxy apiServer with real host %s", u.String())
r.Host = ""
}
return u
Expand Down

0 comments on commit ce78535

Please sign in to comment.