@@ -17,7 +17,6 @@ import (
1717 "context"
1818 "encoding/json"
1919 "fmt"
20- "go.uber.org/zap"
2120 "io"
2221 "net/http"
2322 _ "net/http/pprof" // Registers /debug/pprof endpoints in http.DefaultServeMux.
@@ -27,6 +26,8 @@ import (
2726 "sync"
2827 "time"
2928
29+ "go.uber.org/zap"
30+
3031 "github.com/uber/kraken/build-index/tagclient"
3132 "github.com/uber/kraken/core"
3233 "github.com/uber/kraken/lib/containerruntime"
@@ -56,9 +57,6 @@ type Config struct {
5657 // Timeout for readiness checks
5758 ReadinessTimeout time.Duration `yaml:"readiness_timeout"`
5859
59- // Maximum request body size for patch operations
60- MaxRequestBodySize int64 `yaml:"max_request_body_size"`
61-
6260 // Enable detailed request logging
6361 EnableRequestLogging bool `yaml:"enable_request_logging"`
6462}
@@ -74,9 +72,6 @@ func (c *Config) applyDefaults() {
7472 if c .ReadinessTimeout == 0 {
7573 c .ReadinessTimeout = 30 * time .Second
7674 }
77- if c .MaxRequestBodySize == 0 {
78- c .MaxRequestBodySize = 1024 * 1024 // 1MB
79- }
8075}
8176
8277// Server defines the agent HTTP server.
@@ -100,8 +95,8 @@ func New(
10095 sched scheduler.ReloadableScheduler ,
10196 tags tagclient.Client ,
10297 ac announceclient.Client ,
103- containerRuntime containerruntime.Factory ) * Server {
104-
98+ containerRuntime containerruntime.Factory ,
99+ ) * Server {
105100 config .applyDefaults ()
106101
107102 stats = stats .Tagged (map [string ]string {
@@ -184,7 +179,7 @@ func (s *Server) getLogger(ctx context.Context) *zap.SugaredLogger {
184179func (s * Server ) getTagHandler (w http.ResponseWriter , r * http.Request ) error {
185180 ctx := r .Context ()
186181 logger := s .getLogger (ctx )
187-
182+
188183 tag , err := httputil .ParseParam (r , "tag" )
189184 if err != nil {
190185 return handler .Errorf ("parse tag param: %s" , err ).Status (http .StatusBadRequest )
@@ -507,9 +502,6 @@ func (s *Server) readinessCheckHandler(w http.ResponseWriter, r *http.Request) e
507502func (s * Server ) patchSchedulerConfigHandler (w http.ResponseWriter , r * http.Request ) error {
508503 ctx := r .Context ()
509504 logger := s .getLogger (ctx )
510-
511- // Limit request body size
512- r .Body = http .MaxBytesReader (w , r .Body , s .config .MaxRequestBodySize )
513505 defer r .Body .Close ()
514506
515507 logger .Debugw ("patching scheduler config" )
0 commit comments